
/* ================================================================
   IDIOMASOFÍA® – General English Test
   Stylesheet.html · Estilos globales
   ================================================================ */

/* ── Tokens de diseño ─────────────────────────────────────── */
:root {
  --ink:        #0F1923;
  --ink-soft:   #3D4F5C;
  --ink-muted:  #7A8E9B;
  --paper:      #FAF8F5;
  --cream:      #F2EDE6;
  --border:     #D8D0C6;
  --border-lt:  #EDE8E0;
  --blue:       #1E3A5F;
  --blue-mid:   #2A4F7F;
  --blue-lt:    #E8EFF7;
  --gold:       #C4922A;
  --gold-lt:    #F0D9A8;
  --gold-pale:  #FDF6E8;
  --green:      #1B5E42;
  --green-lt:   #E5F3EC;
  --red:        #8B2020;
  --red-lt:     #FFF0F0;
  --shadow-sm:  0 1px 6px rgba(15,25,35,.06);
  --shadow-md:  0 3px 18px rgba(15,25,35,.10);
  --radius-sm:  6px;
  --radius-md:  10px;
  --radius-lg:  16px;
  --transition: .2s cubic-bezier(.4,0,.2,1);
}

/* ── Reset & base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--paper);
  color: var(--ink);
  min-height: 100vh;
  line-height: 1.6;
  font-size: 15px;
}

/* ── Tipografía ───────────────────────────────────────────── */
h1, h2, h3, .serif { font-family: 'Playfair Display', serif; }

/* ── Header ───────────────────────────────────────────────── */
.app-header {
  background: var(--blue);
  color: #fff;
  padding: 18px 24px;
  text-align: center;
  position: relative;
  z-index: 10;
}
.app-header::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--gold), #e8b840, var(--gold));
}
.header-logo {
  font-family: 'Playfair Display', serif;
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: -.4px;
}
.header-logo span { color: var(--gold-lt); }
.header-tagline {
  font-size: .75rem;
  opacity: .65;
  letter-spacing: .07em;
  text-transform: uppercase;
  margin-top: 3px;
}

/* ── Barra de progreso ────────────────────────────────────── */
.progress-bar-wrap {
  background: var(--cream);
  border-bottom: 1px solid var(--border);
  padding: 10px 24px;
  display: none;
  align-items: center;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 9;
}
.progress-bar-wrap.visible { display: flex; }
.progress-track {
  flex: 1;
  height: 6px;
  background: var(--border);
  border-radius: 99px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--blue), var(--gold));
  border-radius: 99px;
  transition: width .5s var(--transition);
}
.progress-label {
  font-size: .78rem;
  color: var(--ink-soft);
  white-space: nowrap;
  min-width: 72px;
  text-align: right;
}

/* ── Main wrapper ─────────────────────────────────────────── */
.app-main {
  max-width: 740px;
  margin: 0 auto;
  padding: 28px 16px 72px;
}

/* ── Steps ─────────────────────────────────────────────────── */
.step { display: none; }
.step.active {
  display: block;
  animation: fadeUp .35s ease;
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Intro card ───────────────────────────────────────────── */
.intro-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px 36px;
  box-shadow: var(--shadow-md);
  text-align: center;
}
.intro-card h1 {
  font-size: 2rem;
  color: var(--blue);
  margin-bottom: 12px;
}
.intro-card .subtitle {
  color: var(--ink-soft);
  font-size: .95rem;
  max-width: 480px;
  margin: 0 auto 24px;
}
.badge-row {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 28px;
}
.badge {
  background: var(--blue-lt);
  color: var(--blue);
  border-radius: 99px;
  padding: 5px 14px;
  font-size: .76rem;
  font-weight: 600;
  letter-spacing: .02em;
}
.divider { border: none; border-top: 1px solid var(--border); margin: 24px 0; }

/* ── Campos de formulario ──────────────────────────────────── */
.field { margin-bottom: 18px; text-align: left; }
.field label {
  display: block;
  font-size: .78rem;
  font-weight: 600;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: 6px;
}
.field input {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: .95rem;
  background: var(--paper);
  color: var(--ink);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.field input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(30,58,95,.1);
}
.field input.invalid { border-color: var(--red); }
.field-error {
  color: var(--red);
  font-size: .78rem;
  margin-top: 5px;
  display: none;
}
.field-error.visible { display: block; }

/* ── Sección de preguntas ─────────────────────────────────── */
.section-header {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 22px;
}
.level-chip {
  background: var(--blue);
  color: #fff;
  border-radius: 99px;
  padding: 5px 16px;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .06em;
  white-space: nowrap;
  flex-shrink: 0;
  margin-top: 3px;
}
.level-chip.gold { background: var(--gold); }
.section-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.2rem;
  color: var(--blue);
}
.section-desc { font-size: .82rem; color: var(--ink-muted); margin-top: 3px; }

/* ── Tarjeta de pregunta ──────────────────────────────────── */
.q-card {
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px 22px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-sm);
  transition: border-color var(--transition);
}
.q-card:hover { border-color: #b8b0a6; }
.q-card.unanswered {
  border-color: #e8a0a0;
  background: var(--red-lt);
  animation: shake .35s ease;
}
@keyframes shake {
  0%,100% { transform: translateX(0); }
  25%      { transform: translateX(-4px); }
  75%      { transform: translateX(4px); }
}
.q-number {
  font-size: .7rem;
  font-weight: 700;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 6px;
}
.q-text {
  font-size: .97rem;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 14px;
  line-height: 1.55;
}
.q-text em {
  font-style: italic;
  border-bottom: 1.5px dashed var(--border);
  padding-bottom: 1px;
  font-weight: 600;
}

/* ── Opciones de respuesta ────────────────────────────────── */
.options { display: flex; flex-direction: column; gap: 8px; }
.option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  border: 1.5px solid var(--border-lt);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition);
  font-size: .92rem;
  user-select: none;
}
.option:hover { background: var(--blue-lt); border-color: #b0c4de; }
.option.selected {
  background: var(--blue-lt);
  border-color: var(--blue);
  font-weight: 500;
}
.option input[type="radio"] {
  accent-color: var(--blue);
  width: 16px;
  height: 16px;
  cursor: pointer;
  flex-shrink: 0;
}
.opt-letter {
  font-size: .72rem;
  font-weight: 700;
  color: var(--ink-muted);
  min-width: 16px;
}

/* ── Botones ──────────────────────────────────────────────── */
.btn-row {
  display: flex;
  gap: 12px;
  margin-top: 28px;
  justify-content: flex-end;
}
.btn {
  padding: 11px 26px;
  border: none;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: .92rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover {
  background: var(--blue-mid);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(30,58,95,.28);
}
.btn-secondary {
  background: var(--cream);
  color: var(--ink-soft);
  border: 1px solid var(--border);
}
.btn-secondary:hover { background: var(--border); }
.btn-submit {
  background: linear-gradient(135deg, var(--gold), #e8a820);
  color: #fff;
}
.btn-submit:hover {
  filter: brightness(1.07);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(196,146,42,.35);
}
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none !important; box-shadow: none !important; }

/* ── Loading ──────────────────────────────────────────────── */
.loading-wrap {
  text-align: center;
  padding: 72px 24px;
}
.spinner {
  width: 50px;
  height: 50px;
  border: 4px solid var(--border);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin .9s linear infinite;
  margin: 0 auto 20px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-text { color: var(--ink-soft); font-size: .95rem; }
.loading-sub   { font-size: .8rem; color: var(--ink-muted); margin-top: 6px; }

/* ── Resultados ───────────────────────────────────────────── */
.result-hero {
  background: linear-gradient(135deg, var(--blue) 0%, var(--blue-mid) 100%);
  color: #fff;
  border-radius: var(--radius-lg);
  padding: 36px 28px;
  text-align: center;
  margin-bottom: 18px;
  overflow: hidden;
  position: relative;
}
.result-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/svg%3E");
}
.result-level-badge {
  display: inline-block;
  background: var(--gold);
  font-family: 'Playfair Display', serif;
  font-size: 2.6rem;
  font-weight: 700;
  padding: 6px 28px;
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  position: relative;
}
.result-level-name { font-size: 1.05rem; opacity: .82; margin-bottom: 6px; }
.result-score { font-size: 3.2rem; font-weight: 700; line-height: 1; }
.result-score span { font-size: 1.2rem; opacity: .6; }
.result-pct { font-size: .9rem; opacity: .6; margin-top: 4px; margin-bottom: 10px; }
.result-desc { font-size: .88rem; opacity: .8; max-width: 480px; margin: 10px auto 0; }

/* ── Tarjetas de resultado ────────────────────────────────── */
.result-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 22px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}
.result-card h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.05rem;
  color: var(--blue);
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--cream);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ── Barras de nivel ──────────────────────────────────────── */
.level-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.level-row-label { font-size: .78rem; font-weight: 600; min-width: 26px; color: var(--ink-soft); }
.level-track      { flex: 1; height: 8px; background: var(--cream); border-radius: 99px; overflow: hidden; }
.level-fill       { height: 100%; border-radius: 99px; width: 0%; transition: width 1s ease; }
.level-row-pct    { font-size: .75rem; color: var(--ink-muted); min-width: 70px; text-align: right; }

/* ── Items de mejora ──────────────────────────────────────── */
.improvement-item {
  border-left: 3px solid var(--gold);
  background: var(--gold-pale);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 12px 16px;
  margin-bottom: 12px;
}
.improvement-level {
  font-size: .72rem;
  font-weight: 700;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: .05em;
}
.improvement-text { font-size: .87rem; color: var(--ink-soft); margin-top: 5px; line-height: 1.55; }
.topics-row { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 6px; }
.topic-tag {
  background: var(--gold-lt);
  color: #7a5a10;
  font-size: .7rem;
  padding: 2px 10px;
  border-radius: 99px;
}

/* ── Próximo paso ─────────────────────────────────────────── */
.next-step-card {
  background: linear-gradient(135deg, var(--blue) 0%, var(--blue-mid) 100%);
  color: #fff;
  border-radius: var(--radius-md);
  padding: 24px;
  margin-bottom: 16px;
}
.next-step-card h3 {
  font-family: 'Playfair Display', serif;
  color: var(--gold-lt);
  font-size: 1.05rem;
  margin-bottom: 10px;
}
.next-step-card p { font-size: .92rem; line-height: 1.65; opacity: .9; }

/* ── Nota de email ────────────────────────────────────────── */
.email-note {
  background: var(--green-lt);
  border: 1px solid #a7d4bc;
  border-radius: var(--radius-sm);
  padding: 13px 18px;
  font-size: .85rem;
  color: var(--green);
  text-align: center;
}

/* ── Error ────────────────────────────────────────────────── */
.error-wrap { text-align: center; padding: 48px 20px; }
.error-box {
  background: var(--red-lt);
  border: 1px solid #f5c0c0;
  border-radius: var(--radius-md);
  padding: 32px;
  max-width: 420px;
  margin: 0 auto;
}
.error-box h3 { color: var(--red); margin-bottom: 10px; font-size: 1.1rem; }
.error-box p  { color: var(--ink-soft); font-size: .9rem; }

/* ── Footer ───────────────────────────────────────────────── */
.app-footer {
  text-align: center;
  padding: 20px;
  font-size: .74rem;
  color: var(--ink-muted);
  border-top: 1px solid var(--border);
  margin-top: 40px;
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 520px) {
  .intro-card { padding: 26px 18px; }
  .btn-row    { flex-direction: column-reverse; }
  .btn        { justify-content: center; width: 100%; }
  .result-score { font-size: 2.4rem; }
  .result-level-badge { font-size: 2rem; }
}


/* ── Botón WhatsApp ───────────────────────────────────────── */
.btn-whatsapp {
  background: #25D366;
  color: #fff;
  text-decoration: none;
  font-size: 1rem;
  padding: 14px 32px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  transition: all var(--transition);
  box-shadow: 0 4px 18px rgba(37,211,102,.30);
}
.btn-whatsapp:hover {
  background: #1ebe5d;
  transform: translateY(-2px);
  box-shadow: 0 6px 22px rgba(37,211,102,.42);
}
.btn-whatsapp:active {
  transform: translateY(0);
}
