/* Viaje · Native Language — sistema de diseño oficial Native Language */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;800;900&display=swap');

:root {
  /* Native Language brand tokens (see native-language-brand/assets/brand.css) */
  --nl-near-black: #050708; --nl-ink: #121C1E; --nl-deep-slate: #1C2B2D;
  --nl-off-white: #F7F7F3; --nl-cloud: #F0F0F0; --nl-mid-gray: #89918D; --nl-light-gray: #CED4D1;
  --nl-bright-green: #55D27D; --nl-emerald: #1E7842; --nl-forest: #16302A; --nl-mint: #7EE8A6;
  --nl-font: 'Inter', 'Montserrat', 'Poppins', Arial, sans-serif;

  /* Mapped from the app's original design-system variable names, so every
     existing component keeps working unchanged. One signature green accent
     (bright green) replaces the old two-tone teal+coral system. */
  --ink: var(--nl-near-black); --ink-2: var(--nl-ink);
  --teal: var(--nl-emerald); --teal-2: var(--nl-bright-green); --teal-soft: #EAF3EC;
  --coral: var(--nl-bright-green); --coral-dark: var(--nl-emerald); --coral-soft: #E4F9EC;
  --cream: var(--nl-off-white); --paper: #fff;
  --line: var(--nl-light-gray); --muted: #5B6461;
  --green: var(--nl-emerald); --green-soft: #E4F3E9;
  --amber: #C25E1A; --amber-soft: #FBEEE3;
  --red: #B3391F; --red-soft: #FBE9E4;
  --shadow: 0 20px 50px rgba(5, 7, 8, .14); --shadow-sm: 0 8px 24px rgba(5, 7, 8, .10);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--nl-font);
  font-weight: 400;
  background: var(--cream);
  color: var(--ink);
  line-height: 1.5;
}
h1, h2, h3, h4 { font-family: var(--nl-font); font-weight: 800; letter-spacing: -0.01em; }
img { max-width: 100%; }
button { font-family: inherit; cursor: pointer; }
a { color: inherit; text-decoration: none; }

.skip-link { position: absolute; left: -999px; top: 0; background: var(--ink); color: #fff; padding: 10px 16px; z-index: 100; }
.skip-link:focus { left: 0; }

.app-loading { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; color: var(--muted); text-align: center; padding: 24px; }
.loading-mark { display: flex; gap: 8px; }
.loading-mark span { width: 12px; height: 12px; border-radius: 50%; background: var(--teal); animation: bounce 1.1s infinite ease-in-out; }
.loading-mark span:nth-child(2) { animation-delay: .15s; background: var(--coral); }
.loading-mark span:nth-child(3) { animation-delay: .3s; background: var(--teal-2); }
.loading-mark span:nth-child(4) { animation-delay: .45s; background: var(--green); }
@keyframes bounce { 0%, 80%, 100% { transform: translateY(0); opacity: .5; } 40% { transform: translateY(-10px); opacity: 1; } }

.eyebrow { display: inline-block; font-family: var(--nl-font); font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--teal); margin-bottom: 8px; }

.button { display: inline-flex; align-items: center; gap: 8px; border: none; border-radius: 999px; padding: 12px 22px; font-family: var(--nl-font); font-weight: 700; font-size: 14px; transition: transform .15s ease, box-shadow .15s ease, background-color .15s ease; }
.button.primary { background: var(--coral-dark); color: #fff; box-shadow: var(--shadow-sm); }
.button.primary:hover { background: var(--nl-forest); transform: translateY(-1px); box-shadow: var(--shadow); }
.button.secondary { background: var(--teal-soft); color: var(--ink-2); }
.button.secondary:hover { background: var(--coral-soft); }
.button.ghost { background: transparent; color: var(--ink-2); border: 1px solid var(--line); }
.button.ghost:hover { border-color: var(--teal); color: var(--teal); }
.button.small { padding: 8px 16px; font-size: 13px; }

.toast-stack { position: fixed; bottom: 20px; right: 20px; display: flex; flex-direction: column; gap: 10px; z-index: 200; }
.toast { background: var(--nl-near-black); color: #fff; padding: 12px 18px; border-radius: 12px; box-shadow: var(--shadow); font-size: 14px; }
.toast.error { background: var(--amber); }

.app-shell { min-height: 100vh; display: flex; flex-direction: column; }

.top-header { display: flex; align-items: center; gap: 20px; padding: 16px 28px; background: var(--nl-near-black); border-bottom: 1px solid var(--nl-deep-slate); position: sticky; top: 0; z-index: 20; flex-wrap: wrap; }
.brand-lockup { display: flex; align-items: center; gap: 12px; }
.brand-lockup img { width: 40px; height: 40px; object-fit: contain; }
.brand-lockup b { display: block; font-family: var(--nl-font); font-weight: 800; font-size: 16px; color: #fff; }
.brand-lockup small { color: var(--nl-mid-gray); font-size: 10px; letter-spacing: .08em; }
.top-nav { display: flex; gap: 6px; margin-left: auto; }
.top-nav button { background: transparent; border: none; padding: 10px 16px; border-radius: 999px; font-family: var(--nl-font); font-weight: 600; color: var(--nl-light-gray); }
.top-nav button.active, .top-nav button:hover { background: var(--nl-ink); color: var(--nl-bright-green); }
.progress-chip { background: var(--nl-ink); color: var(--nl-bright-green); border-radius: 14px; padding: 8px 14px; text-align: center; line-height: 1.2; }
.progress-chip span { display: block; font-weight: 800; }
.progress-chip small { font-size: 10px; color: var(--nl-mid-gray); }

.page { max-width: 1180px; margin: 0 auto; padding: 32px 24px 60px; width: 100%; flex: 1; }

.hero { background: linear-gradient(135deg, var(--nl-near-black) 0%, var(--nl-ink) 55%, var(--nl-forest) 130%); color: #fff; border-radius: 24px; padding: 40px; margin-bottom: 40px; box-shadow: var(--shadow); }
.hero .eyebrow { color: var(--teal-2); }
.hero h1 { font-family: var(--nl-font); font-weight: 900; letter-spacing: -0.02em; font-size: clamp(26px, 4vw, 38px); line-height: 1.15; margin: 0 0 14px; max-width: 760px; }
.hero p { color: rgba(255,255,255,.85); max-width: 640px; margin: 0 0 22px; }
.hero-progress { display: flex; flex-direction: column; gap: 10px; max-width: 420px; }
.hero-progress span { font-size: 13px; color: rgba(255,255,255,.8); }

.progress-track { height: 8px; border-radius: 999px; background: rgba(5,7,8,.08); overflow: hidden; }
.progress-track.big { height: 12px; background: rgba(255,255,255,.18); }
.progress-track i { display: block; height: 100%; background: var(--coral); border-radius: 999px; transition: width .3s ease; }

.section-block { margin-bottom: 44px; }
.section-head { margin-bottom: 18px; display: flex; flex-direction: column; gap: 4px; }
.section-head h2 { margin: 0; font-family: var(--nl-font); font-weight: 800; font-size: 22px; }
.section-head p { margin: 0; color: var(--muted); }

.situation-grid { display: grid; gap: 18px; }
.situation-grid.core { grid-template-columns: repeat(3, 1fr); }
.situation-grid.bonus { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 900px) { .situation-grid.core, .situation-grid.bonus { grid-template-columns: 1fr; } }

.situation-card { position: relative; text-align: left; background: var(--paper); border: 1px solid var(--line); border-radius: 20px; padding: 24px; display: flex; flex-direction: column; gap: 14px; box-shadow: var(--shadow-sm); transition: transform .15s ease, box-shadow .15s ease; }
.situation-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.situation-card.big { padding: 28px; }
.situation-icon { font-size: 34px; }
.situation-copy h3 { margin: 0 0 6px; font-size: 19px; }
.situation-copy p { margin: 0; color: var(--muted); font-size: 14px; }
.situation-progress small { color: var(--muted); font-size: 12px; }
.bonus-tag { position: absolute; top: 16px; right: 16px; background: var(--amber-soft); color: var(--amber); font-size: 10px; font-weight: 800; letter-spacing: .06em; padding: 4px 10px; border-radius: 999px; }

.page-head { display: flex; flex-direction: column; gap: 14px; margin-bottom: 28px; }
.page-head h1 { margin: 6px 0; font-size: 28px; }
.page-head p { margin: 0; color: var(--muted); max-width: 720px; }
.page-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.dialogue-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.dialogue-card { text-align: left; background: var(--paper); border: 1px solid var(--line); border-radius: 18px; padding: 20px; display: flex; flex-direction: column; gap: 10px; box-shadow: var(--shadow-sm); }
.dialogue-card:hover { border-color: var(--teal-2); }
.dialogue-card.done { background: var(--green-soft); border-color: var(--green); }
.dialogue-card-top { display: flex; justify-content: space-between; align-items: center; }
.level-pill { font-size: 11px; text-transform: uppercase; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: var(--teal-soft); color: var(--ink-2); }
.level-pill.intermedio { background: var(--amber-soft); color: var(--amber); }
.fav-star { color: var(--coral-dark); font-size: 16px; }
.dialogue-card h3 { margin: 0; font-size: 17px; }
.dialogue-card p { margin: 0; color: var(--muted); font-size: 13px; flex: 1; }
.dialogue-status { font-weight: 700; font-size: 13px; color: var(--teal); }
.dialogue-card.done .dialogue-status { color: var(--green); }

.dialogue-stage { display: grid; grid-template-columns: 1.5fr 1fr; gap: 26px; align-items: start; }
@media (max-width: 940px) { .dialogue-stage { grid-template-columns: 1fr; } }
.exchange { display: flex; flex-direction: column; gap: 12px; background: var(--paper); border: 1px solid var(--line); border-radius: 20px; padding: 24px; box-shadow: var(--shadow-sm); }
.bubble { max-width: 88%; border-radius: 16px; padding: 12px 16px; }
.bubble small { display: block; font-size: 10px; letter-spacing: .06em; opacity: .7; margin-bottom: 4px; }
.bubble.tourist { align-self: flex-end; background: var(--coral-soft); border: 1px solid #bfe9d0; }
.bubble.local { align-self: flex-start; background: var(--nl-cloud); border: 1px solid var(--line); }
.bubble p.es { margin: 0 0 4px; font-weight: 600; }
.bubble p.pt { margin: 0; color: var(--muted); font-size: 13px; font-style: italic; }
.bubble-audio { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }

.speech-slot:empty { display: none; }
.speech-slot { margin-top: 14px; }
.speech-lab { background: var(--paper); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; box-shadow: var(--shadow-sm); }
.speech-target { padding: 22px; background: var(--ink-2); color: #fff; }
.speech-target small { color: var(--teal-2); font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.speech-target h2 { font-family: var(--nl-font); font-weight: 800; font-size: clamp(19px, 3vw, 26px); margin: 10px 0; line-height: 1.35; }
.speech-target-actions { display: flex; gap: 9px; }
.speech-target .button.ghost { border-color: rgba(255,255,255,.25); background: rgba(255,255,255,.08); color: #fff; }
.speech-target .button.ghost:hover { border-color: var(--nl-bright-green); color: var(--nl-bright-green); }
.speech-control { padding: 20px 22px; display: grid; grid-template-columns: 100px 1fr; gap: 20px; align-items: center; }
.record-button { width: 90px; height: 90px; border-radius: 50%; border: 8px solid var(--coral-soft); background: var(--coral-dark); color: #fff; display: grid; place-items: center; cursor: pointer; box-shadow: 0 10px 24px rgba(30,120,66,.28); font-weight: 800; font-size: 12px; text-align: center; line-height: 1.3; }
.record-button.recording { animation: recordPulse 1s infinite alternate; background: var(--red); border-color: var(--red-soft); }
@keyframes recordPulse { to { box-shadow: 0 0 0 16px rgba(85,210,125,.20); } }
.speech-control h3 { margin: 0 0 6px; font-size: 15px; }
.speech-control p { color: var(--muted); margin: 0; font-size: 13px; }
.speech-result-box:empty { display: none; }
.speech-results { border-top: 1px solid var(--line); padding: 20px 22px; display: flex; flex-direction: column; gap: 12px; }
.own-recording { display: flex; flex-direction: column; gap: 6px; }
.own-recording small, .speech-transcript small { color: var(--muted); font-weight: 800; letter-spacing: .08em; font-size: 10px; text-transform: uppercase; }
.own-recording audio { width: 100%; }
.speech-transcript p { margin: 4px 0 0; font-style: italic; }
.match-score { display: flex; align-items: baseline; gap: 8px; background: var(--cream); border-radius: 12px; padding: 10px 14px; width: fit-content; }
.match-score strong { font-size: 22px; }
.match-score span { color: var(--muted); font-size: 12px; }
.match-score.good strong { color: var(--green); }
.match-score.retry strong { color: var(--amber); }
.speech-note { margin: 0; color: var(--muted); font-size: 12px; }
.speech-disclaimer { color: var(--muted); font-size: 11px; }

.alert { padding: 12px 14px; border-radius: 12px; margin: 12px 0 0; line-height: 1.5; font-size: 13px; }
.alert.error { background: var(--red-soft); color: var(--red); border: 1px solid #f0cdc3; }
.alert.info { background: var(--teal-soft); color: var(--ink-2); border: 1px solid var(--line); }
.alert.warning { background: var(--amber-soft); color: var(--amber); border: 1px solid #f0d2b8; }

@media (max-width: 640px) {
  .speech-control { grid-template-columns: 1fr; text-align: center; }
  .record-button { margin: auto; }
  .match-score { margin: auto; }
}

.side-panel { display: flex; flex-direction: column; gap: 22px; }
.trap-card { background: var(--paper); border: 1px solid var(--line); border-radius: 16px; padding: 16px; margin-bottom: 12px; box-shadow: var(--shadow-sm); }
.wrong-right { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.contrast { border-radius: 12px; padding: 10px 14px; }
.contrast.wrong { background: var(--red-soft); color: var(--red); }
.contrast.right { background: var(--green-soft); color: var(--green); }
.contrast small { display: block; font-size: 10px; font-weight: 800; letter-spacing: .06em; margin-bottom: 4px; }
.trap-why { margin: 0; font-size: 13px; color: var(--ink-2); }

.variants-card { background: var(--paper); border: 1px solid var(--line); border-radius: 16px; padding: 16px; box-shadow: var(--shadow-sm); }
.variants-card ul { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.variants-card li b { display: block; }
.variants-card li small { color: var(--muted); font-style: italic; }

.empty-state { text-align: center; padding: 60px 20px; background: var(--paper); border: 1px dashed var(--line); border-radius: 20px; color: var(--muted); }
.empty-state h2 { color: var(--ink); }

.country-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; }
.country-card { display: flex; flex-direction: column; align-items: center; gap: 6px; background: var(--paper); border: 1px solid var(--line); border-radius: 16px; padding: 18px 10px; box-shadow: var(--shadow-sm); text-align: center; }
.country-card:hover { border-color: var(--teal-2); }
.country-card.visited { background: var(--green-soft); }
.country-flag { font-size: 32px; }
.country-card small { color: var(--green); font-size: 11px; font-weight: 700; }

.country-stage { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; align-items: start; }
@media (max-width: 900px) { .country-stage { grid-template-columns: 1fr; } }
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: 20px; padding: 24px; box-shadow: var(--shadow-sm); }
.attraction-list { display: flex; flex-direction: column; gap: 14px; margin-top: 12px; }
.attraction-item h3 { margin: 0 0 4px; font-size: 15px; }
.attraction-item p { margin: 0; color: var(--muted); font-size: 13px; }
.tip-list { margin: 12px 0 0; }
.tip-list dt { font-weight: 700; margin-top: 14px; }
.tip-list dt:first-child { margin-top: 0; }
.tip-list dd { margin: 4px 0 0; color: var(--ink-2); font-size: 14px; }
.tip-list ul { margin: 4px 0 0; padding-left: 18px; }

.phrase-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin-top: 14px; }
.phrase-item { background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 12px 16px; box-shadow: var(--shadow-sm); }
.phrase-item b { display: block; font-size: 14px; }
.phrase-item small { display: block; color: var(--muted); font-style: italic; margin-top: 2px; }

.verb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; margin-top: 14px; }
.verb-card { background: var(--paper); border: 1px solid var(--line); border-radius: 18px; padding: 20px; box-shadow: var(--shadow-sm); }
.verb-card h3 { margin: 0 0 6px; font-size: 20px; color: var(--teal); text-transform: capitalize; }
.verb-note { margin: 0 0 12px; color: var(--muted); font-size: 13px; }
.verb-conjugation { display: flex; flex-direction: column; gap: 6px; }
.verb-row { display: flex; justify-content: space-between; border-top: 1px solid var(--line); padding-top: 6px; }
.verb-row:first-child { border-top: none; padding-top: 0; }
.verb-row span { color: var(--muted); font-size: 13px; text-transform: capitalize; }
.verb-row b { font-size: 14px; }

.trap-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; margin-top: 14px; }
.trap-grid .trap-card { margin-bottom: 0; }

.site-footer { display: flex; justify-content: space-between; padding: 18px 28px; color: var(--muted); font-size: 12px; border-top: 1px solid var(--line); flex-wrap: wrap; gap: 8px; }

@media (max-width: 640px) {
  .top-header { padding: 12px 16px; }
  .top-nav { width: 100%; justify-content: space-between; order: 3; margin-left: 0; }
  .page { padding: 20px 16px 40px; }
  .hero { padding: 26px; }
}
