/* ============================================================
   FRANCÉS DESDE CERO — Sistema de diseño
   Paleta: placa de calle parisina + línea de Métro
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,400;0,9..144,600;0,9..144,700;1,9..144,500&family=Archivo:wght@400;500;600;700&family=Space+Mono:wght@400;700&display=swap');

:root {
  --ink: #1B2A4A;
  --ink-light: #2C4270;
  --cream: #F2EFE6;
  --paper: #FBF9F3;
  --gold: #C9A24B;
  --gold-light: #E4C878;
  --wine: #7A2E3A;
  --sage: #4C7A61;
  --line: rgba(27, 42, 74, 0.14);

  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'Archivo', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'Space Mono', monospace;

  --radius: 4px;
  --shadow-plaque: 0 3px 0 rgba(27,42,74,0.25), 0 6px 16px rgba(27,42,74,0.15);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: contain;
}

body {
  padding-bottom: 76px; /* espacio para nav inferior */
  min-height: 100vh;
}

a { color: inherit; }

button {
  font-family: inherit;
  cursor: pointer;
}

/* Respeta "reducir movimiento" */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}

/* ---------- Encabezado tipo placa de calle ---------- */
.plaque {
  background: var(--ink);
  color: var(--cream);
  padding: 28px 20px 22px;
  position: relative;
  border-bottom: 6px solid var(--gold);
}

.plaque::after {
  content: "";
  position: absolute;
  inset: 6px;
  border: 1px solid rgba(242,239,230,0.25);
  pointer-events: none;
}

.plaque-eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold-light);
  margin: 0 0 6px;
}

.plaque-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 28px;
  line-height: 1.15;
  margin: 0;
}

.plaque-subtitle {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 500;
  font-size: 15px;
  color: var(--gold-light);
  margin: 6px 0 0;
}

/* ---------- App shell ---------- */
.app-header {
  background: var(--ink);
  color: var(--cream);
  padding: 18px 20px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  border-bottom: 3px solid var(--gold);
}

.app-header .brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 20px;
}

.app-header .brand .dot { color: var(--gold); }

.app-header .streak {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--gold-light);
}

.view { padding: 20px; max-width: 640px; margin: 0 auto; }

/* ---------- Línea de Métro (mapa de progreso) ---------- */
.metro-line {
  position: relative;
  padding: 8px 0 8px 8px;
  margin: 8px 0 28px;
}

.metro-line::before {
  content: "";
  position: absolute;
  left: 27px;
  top: 26px;
  bottom: 26px;
  width: 4px;
  background: var(--ink);
  border-radius: 2px;
}

.metro-stop {
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 8px;
  margin-bottom: 2px;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
  border-radius: var(--radius);
  transition: background 0.15s ease;
}

.metro-stop:hover { background: rgba(27,42,74,0.05); }
.metro-stop:focus-visible { outline: 2px solid var(--wine); outline-offset: 2px; }

.metro-stop .node {
  position: relative;
  z-index: 1;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--paper);
  border: 3px solid var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}

.metro-stop.done .node {
  background: var(--sage);
  border-color: var(--sage);
  color: var(--paper);
}

.metro-stop.current .node {
  background: var(--gold);
  border-color: var(--ink);
  color: var(--ink);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(201,162,75,0.5); }
  50% { box-shadow: 0 0 0 8px rgba(201,162,75,0); }
}

.metro-stop .info { flex: 1; min-width: 0; }

.metro-stop .stop-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 16px;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.metro-stop .stop-sub {
  font-size: 12px;
  color: var(--ink-light);
  opacity: 0.75;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.metro-stop .check {
  font-size: 18px;
  color: var(--sage);
  flex-shrink: 0;
}

/* ---------- Tarjetas ---------- */
.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 16px;
}

.card-heading {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--wine);
  margin: 0 0 12px;
}

.intro-text {
  font-size: 15.5px;
  line-height: 1.6;
  color: var(--ink);
  margin: 0 0 20px;
}

/* ---------- Bloques de vocabulario ---------- */
.vocab-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.vocab-item:last-child { border-bottom: none; }

.speak-btn {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 2px solid var(--ink);
  background: var(--cream);
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.1s ease, background 0.15s ease;
}
.speak-btn:hover { background: var(--gold-light); }
.speak-btn:active { transform: scale(0.92); }
.speak-btn:focus-visible { outline: 2px solid var(--wine); outline-offset: 2px; }

.vocab-text .fr {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 17px;
  color: var(--ink);
}

.vocab-text .pho {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--wine);
  margin-top: 2px;
}

.vocab-text .es {
  font-size: 14px;
  color: var(--ink-light);
  margin-top: 3px;
}

.vocab-item.dialogue .fr { font-style: italic; }

/* ---------- Tip / consejo práctico ---------- */
.tip-box {
  background: var(--ink);
  color: var(--cream);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin: 20px 0;
  position: relative;
  border-left: 4px solid var(--gold);
}

.tip-box .tip-label {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold-light);
  display: block;
  margin-bottom: 6px;
}

.tip-box p {
  margin: 0;
  font-size: 14px;
  line-height: 1.55;
}

/* ---------- Ejercicios ---------- */
.exercise-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 14px;
}

.exercise-progress {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-light);
  margin-bottom: 10px;
}

.exercise-q {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 17px;
  margin: 0 0 16px;
  line-height: 1.4;
}

.mcq-option {
  display: block;
  width: 100%;
  text-align: left;
  padding: 12px 14px;
  margin-bottom: 8px;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  background: var(--cream);
  font-size: 14.5px;
  color: var(--ink);
  transition: border-color 0.15s ease, background 0.15s ease;
}
.mcq-option:hover:not(:disabled) { border-color: var(--gold); }
.mcq-option:focus-visible { outline: 2px solid var(--wine); outline-offset: 2px; }
.mcq-option:disabled { cursor: default; }

.mcq-option.correct {
  border-color: var(--sage);
  background: rgba(76,122,97,0.12);
  font-weight: 600;
}
.mcq-option.incorrect {
  border-color: var(--wine);
  background: rgba(122,46,58,0.10);
}

.fill-input {
  width: 100%;
  padding: 12px 14px;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  font-size: 15px;
  font-family: var(--font-body);
  background: var(--cream);
  color: var(--ink);
  margin-bottom: 10px;
}
.fill-input:focus { outline: none; border-color: var(--gold); }
.fill-input.correct { border-color: var(--sage); background: rgba(76,122,97,0.1); }
.fill-input.incorrect { border-color: var(--wine); background: rgba(122,46,58,0.08); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: var(--radius);
  border: none;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 14.5px;
  cursor: pointer;
  transition: transform 0.08s ease, opacity 0.15s ease;
}
.btn:active { transform: scale(0.97); }
.btn:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.btn:disabled { opacity: 0.45; cursor: default; }

.btn-primary { background: var(--ink); color: var(--cream); }
.btn-primary:hover:not(:disabled) { background: var(--ink-light); }

.btn-gold { background: var(--gold); color: var(--ink); }
.btn-gold:hover:not(:disabled) { background: var(--gold-light); }

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border: 2px solid var(--ink);
}
.btn-ghost:hover { background: rgba(27,42,74,0.06); }

.btn-block { width: 100%; }

.explain-box {
  margin-top: 10px;
  padding: 12px 14px;
  border-radius: var(--radius);
  font-size: 13.5px;
  line-height: 1.5;
}
.explain-box.correct { background: rgba(76,122,97,0.12); color: var(--ink); }
.explain-box.incorrect { background: rgba(122,46,58,0.10); color: var(--ink); }

/* ---------- Resultado final de ejercicios ---------- */
.result-card {
  text-align: center;
  padding: 32px 20px;
}

.result-score {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 48px;
  color: var(--ink);
  margin: 8px 0;
}

.result-score .of {
  font-size: 22px;
  color: var(--ink-light);
}

/* ---------- Navegación inferior ---------- */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--ink);
  border-top: 3px solid var(--gold);
  display: flex;
  justify-content: space-around;
  padding: 8px 6px calc(8px + env(safe-area-inset-bottom));
  z-index: 20;
}

.nav-btn {
  background: transparent;
  border: none;
  color: rgba(242,239,230,0.55);
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 6px 14px;
  border-radius: var(--radius);
}

.nav-btn .icon { font-size: 19px; }
.nav-btn.active { color: var(--cream); }
.nav-btn.active .icon { color: var(--gold); }
.nav-btn:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* ---------- Plan de estudio ---------- */
.plan-day {
  display: flex;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  align-items: flex-start;
}
.plan-day:last-child { border-bottom: none; }

.plan-day .day-num {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 13px;
  color: var(--wine);
  width: 44px;
  flex-shrink: 0;
  padding-top: 1px;
}

.plan-day .day-focus { font-size: 14px; line-height: 1.5; }

/* ---------- Utilidades ---------- */
.section-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 20px;
  margin: 0 0 4px;
}

.section-desc {
  font-size: 13.5px;
  color: var(--ink-light);
  margin: 0 0 18px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--gold-light);
  font-family: var(--font-mono);
  font-size: 12px;
  text-decoration: none;
  background: none;
  border: none;
  padding: 0;
  margin-bottom: 10px;
}

.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--ink-light);
}

.divider {
  border: none;
  border-top: 1px solid var(--line);
  margin: 22px 0;
}

.stat-row {
  display: flex;
  gap: 12px;
  margin-bottom: 22px;
}

.stat-box {
  flex: 1;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  text-align: center;
}

.stat-box .num {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 26px;
  color: var(--ink);
}

.stat-box .label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-light);
  margin-top: 2px;
}

@media (max-width: 380px) {
  .plaque-title { font-size: 24px; }
  .view { padding: 16px; }
}
