/* styles.css — Diseño "pro" de la app de inglés. Tema claro/oscuro por atributo. */

/* ---------------------------------------------------------- Tokens */
:root {
  --bg: #eef1f8;
  --bg-grad: radial-gradient(1200px 600px at 80% -10%, #e6e9ff 0%, transparent 60%),
             radial-gradient(1000px 500px at -10% 10%, #e8fbf3 0%, transparent 55%);
  --surface: #ffffff;
  --surface-2: #f7f9fd;
  --text: #14181f;
  --muted: #6b7484;
  --border: #e5e9f2;
  --accent: #0d9488;
  --accent-2: #14b8a6;
  --accent-soft: #d9f2ee;
  --ok: #16a34a;
  --ok-soft: rgba(22, 163, 74, 0.12);
  --no: #e11d48;
  --no-soft: rgba(225, 29, 72, 0.1);
  --ring-track: #e5e9f2;
  --shadow-sm: 0 1px 3px rgba(20, 30, 60, 0.06);
  --shadow: 0 6px 24px rgba(20, 30, 60, 0.08);
  --shadow-lg: 0 16px 48px rgba(20, 30, 60, 0.14);
  --radius: 16px;
  --radius-sm: 10px;
}

[data-theme="dark"] {
  --bg: #0b0f18;
  --bg-grad: radial-gradient(1200px 600px at 80% -10%, #1a1e3a 0%, transparent 60%),
             radial-gradient(1000px 500px at -10% 10%, #0f2a24 0%, transparent 55%);
  --surface: #151a26;
  --surface-2: #1b2130;
  --text: #e9edf6;
  --muted: #9aa5b8;
  --border: #2a3346;
  --accent: #2dd4bf;
  --accent-2: #5eead4;
  --accent-soft: #16302c;
  --ok: #34d399;
  --ok-soft: rgba(52, 211, 153, 0.14);
  --no: #fb7185;
  --no-soft: rgba(251, 113, 133, 0.14);
  --ring-track: #2a3346;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.5);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  background-image: var(--bg-grad);
  background-attachment: fixed;
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1 { font-size: 1.9rem; line-height: 1.15; letter-spacing: -0.02em; }
h2 { font-size: 1.35rem; letter-spacing: -0.01em; }
h3 { font-size: 1.1rem; }
.muted { color: var(--muted); }
.accent { color: var(--accent); }

/* ---------------------------------------------------------- Top bar */
.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 22px;
  background: color-mix(in srgb, var(--surface) 78%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 800; letter-spacing: -0.02em; }
.brand .logo {
  width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; font-size: 15px;
  box-shadow: var(--shadow-sm);
}
.topbar-right { display: flex; align-items: center; gap: 12px; }
.mini-progress { display: flex; align-items: center; gap: 8px; font-size: 0.82rem; color: var(--muted); }
.mini-progress .bar { width: 90px; height: 7px; background: var(--ring-track); border-radius: 20px; overflow: hidden; }
.mini-progress .bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.icon-btn {
  width: 38px; height: 38px; border-radius: 11px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font-size: 16px; cursor: pointer;
  display: grid; place-items: center; transition: transform .12s, border-color .12s;
}
.icon-btn:hover { transform: translateY(-1px); border-color: var(--accent); }

#app { max-width: 900px; margin: 0 auto; padding: 34px 20px 90px; }

/* ---------------------------------------------------------- Hero */
.hero {
  display: flex; align-items: center; gap: 26px; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow);
  margin-bottom: 28px;
}
.hero-text { flex: 1 1 280px; }
.hero h1 { font-size: 2.1rem; margin-bottom: 8px; }
.hero .tag { color: var(--muted); margin-bottom: 16px; }
.hero-stats { display: flex; gap: 22px; flex-wrap: wrap; }
.hero-stats .s strong { display: block; font-size: 1.4rem; color: var(--accent); line-height: 1.1; }
.hero-stats .s span { font-size: 0.78rem; color: var(--muted); }

/* Anillo de progreso (SVG) */
.ring { position: relative; width: 132px; height: 132px; flex: 0 0 auto; }
.ring svg { transform: rotate(-90deg); }
.ring svg circle { transition: stroke-dashoffset .6s ease; }
.ring .label { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; }
.ring .label b { font-size: 1.7rem; letter-spacing: -0.03em; }
.ring .label small { display: block; font-size: 0.68rem; color: var(--muted); }

/* ---------------------------------------------------------- Grid módulos */
.section-title { font-size: 0.82rem; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); margin: 6px 4px 14px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 18px; }

.card {
  position: relative; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px; cursor: pointer; overflow: hidden;
  transition: transform .16s, box-shadow .16s, border-color .16s; box-shadow: var(--shadow-sm);
}
.card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: var(--card-accent, var(--accent)); }
.card:hover:not(.locked) { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.card.locked { opacity: .55; cursor: not-allowed; filter: grayscale(.4); }
.card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.card h3 { margin: 12px 0 4px; }
.card .goal { font-size: 0.86rem; color: var(--muted); min-height: 42px; }
.card-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 14px; font-size: 0.82rem; color: var(--muted); }
.card .lock { font-size: 1.05rem; }
.card .hint { font-size: 0.76rem; font-style: italic; color: var(--muted); margin-top: 8px; }

.level-badge {
  display: inline-block; padding: 3px 11px; border-radius: 999px; font-size: 0.72rem;
  font-weight: 800; color: #fff; letter-spacing: .04em;
}
.lvl-a2 { background: linear-gradient(135deg, #10b981, #34d399); }
.lvl-b1 { background: linear-gradient(135deg, #3b82f6, #60a5fa); }
.lvl-b2 { background: linear-gradient(135deg, #8b5cf6, #a78bfa); }
.lvl-c1 { background: linear-gradient(135deg, #ec4899, #f472b6); }

/* Mini anillo dentro de la card */
.mini-ring { position: relative; width: 46px; height: 46px; flex: 0 0 auto; }
.mini-ring svg { transform: rotate(-90deg); }
.mini-ring b { position: absolute; inset: 0; display: grid; place-items: center; font-size: 0.7rem; font-weight: 800; }

/* ---------------------------------------------------------- Botones */
button { font-family: inherit; cursor: pointer; border: none; }
.btn-primary {
  display: inline-flex; align-items: center; gap: 8px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff;
  padding: 13px 24px; border-radius: 12px; font-size: 1rem; font-weight: 700;
  box-shadow: 0 8px 20px color-mix(in srgb, var(--accent) 35%, transparent);
  transition: transform .12s, filter .12s;
}
.btn-primary:hover { transform: translateY(-2px); filter: brightness(1.05); }
.btn-ghost {
  background: var(--surface); color: var(--muted); padding: 11px 20px;
  border: 1px solid var(--border); border-radius: 12px; font-size: 0.92rem; font-weight: 600;
}
.btn-ghost:hover { color: var(--text); border-color: var(--accent); }
.btn-back { background: transparent; color: var(--accent); font-size: 0.92rem; margin-bottom: 20px; padding: 4px 0; font-weight: 700; }

/* ---------------------------------------------------------- Módulo */
.module-header { margin-bottom: 22px; }
.module-header .level-badge { margin-bottom: 12px; }
.topic-list { display: flex; flex-direction: column; gap: 11px; }
.topic-row {
  display: flex; align-items: center; gap: 14px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 14px; padding: 15px 18px;
  cursor: pointer; transition: border-color .14s, transform .1s, box-shadow .14s;
}
.topic-row:hover { border-color: var(--accent); transform: translateX(4px); box-shadow: var(--shadow-sm); }
.topic-status { font-size: 1.15rem; width: 24px; text-align: center; }
.topic-title { flex: 1; font-weight: 600; }
.topic-mini-bar { width: 70px; height: 6px; background: var(--ring-track); border-radius: 20px; overflow: hidden; }
.topic-mini-bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.topic-score { color: var(--muted); font-weight: 700; font-size: 0.85rem; width: 42px; text-align: right; }

/* ---------------------------------------------------------- Lección */
.card-pane { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow); }
.lesson .level-badge { margin-bottom: 12px; }
.lesson h1 { margin-bottom: 16px; }
.lesson-body { margin: 6px 0 22px; }
.lesson-body p { margin-bottom: 14px; }
.lesson-body strong { color: var(--accent); }
.lesson-body em { color: var(--text); font-style: italic; opacity: .9; }

/* Teoría enriquecida */
.th-h {
  font-size: 1.02rem; font-weight: 800; letter-spacing: -0.01em; margin: 22px 0 10px;
  padding-left: 12px; border-left: 3px solid var(--accent); color: var(--text);
}
.lesson-body > .th-h:first-child { margin-top: 0; }
.th-list { margin: 0 0 14px 4px; padding-left: 20px; }
.th-list li { margin-bottom: 6px; }
.lesson-body code, .review-item code, .feedback code {
  font-family: "SF Mono", ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 0.88em; background: var(--accent-soft); color: var(--accent);
  padding: 1px 6px; border-radius: 6px; font-weight: 600;
}
.th-table-wrap { overflow-x: auto; margin: 4px 0 18px; border-radius: 10px; border: 1px solid var(--border); }
.th-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.th-table th, .th-table td { padding: 9px 13px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: top; }
.th-table th { background: var(--surface-2); font-weight: 700; font-size: 0.82rem; }
.th-table tr:last-child td { border-bottom: none; }
.th-table td:first-child { font-weight: 600; }

/* Banner del test de nivel */
.leveltest-banner {
  display: flex; align-items: center; gap: 16px; cursor: pointer;
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 14%, var(--surface)), var(--surface));
  border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--border));
  border-radius: var(--radius); padding: 18px 20px; margin-bottom: 26px;
  transition: transform .15s, box-shadow .15s;
}
.leveltest-banner:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.lt-icon { font-size: 1.9rem; }
.lt-text { flex: 1; display: flex; flex-direction: column; }
.lt-text strong { font-size: 1.05rem; }
.lt-text span { font-size: 0.86rem; color: var(--muted); }
.lt-go { color: var(--accent); font-weight: 700; white-space: nowrap; }

/* Banner de vocabulario (variante del de test) */
.vocab-banner {
  background: linear-gradient(135deg, color-mix(in srgb, #ec4899 12%, var(--surface)), var(--surface));
  border-color: color-mix(in srgb, #ec4899 32%, var(--border));
}
.vocab-banner .lt-go { color: #ec4899; }
.exam-banner {
  background: linear-gradient(135deg, color-mix(in srgb, #3b82f6 13%, var(--surface)), var(--surface));
  border-color: color-mix(in srgb, #3b82f6 32%, var(--border));
}
.exam-banner .lt-go { color: #3b82f6; }

/* Flashcards */
.vocab-stats { display: flex; gap: 20px; flex-wrap: wrap; margin: 18px 0 22px; }
.vocab-stats .s strong { display: block; font-size: 1.5rem; color: var(--accent); line-height: 1.1; }
.vocab-stats .s span { font-size: 0.78rem; color: var(--muted); }
.chip-row { display: flex; gap: 10px; flex-wrap: wrap; }
.chip {
  padding: 8px 16px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface-2); color: var(--text); font-weight: 700; font-size: 0.85rem;
  transition: border-color .12s, transform .1s;
}
.chip:hover { border-color: var(--accent); transform: translateY(-1px); }

.flashcard { margin-top: 22px; text-align: center; }
.fc-front {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 14px;
  padding: 34px 24px; margin-bottom: 16px;
}
.fc-en { font-size: 1.7rem; font-weight: 800; letter-spacing: -0.02em; }
.fc-reveal { margin-top: 0; }
.fc-back { animation: pop .25s ease; margin-bottom: 18px; }
.fc-es { font-size: 1.3rem; font-weight: 700; color: var(--accent); margin-bottom: 10px; }
.fc-ex { color: var(--muted); font-style: italic; display: flex; align-items: center; justify-content: center; gap: 8px; }
.rate-row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.rate { padding: 13px 22px; border-radius: 12px; font-weight: 700; font-size: 0.95rem; color: #fff; transition: transform .12s, filter .12s; }
.rate:hover { transform: translateY(-2px); filter: brightness(1.06); }
.rate-again { background: linear-gradient(135deg, #e11d48, #f43f5e); }
.rate-good { background: linear-gradient(135deg, #3b82f6, #60a5fa); }
.rate-easy { background: linear-gradient(135deg, #16a34a, #22c55e); }

/* Resultado del test de nivel */
.level-result-badge {
  width: 110px; height: 110px; border-radius: 50%; margin: 0 auto 18px;
  display: grid; place-items: center; font-size: 2.4rem; font-weight: 800; color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 10px 30px color-mix(in srgb, var(--accent) 40%, transparent);
}
.lvl-breakdown { text-align: left; max-width: 460px; margin: 22px auto 0; display: flex; flex-direction: column; gap: 12px; }
.lvl-bar-row { display: flex; align-items: center; gap: 12px; }
.lvl-bar-row .level-badge { width: 38px; text-align: center; }

.lesson-cta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 8px; }

/* Etiquetas de paso en la lección guiada */
.step-label {
  display: inline-block; font-size: 0.74rem; font-weight: 800; letter-spacing: .06em;
  text-transform: uppercase; padding: 5px 12px; border-radius: 999px; margin-bottom: 14px;
  background: var(--accent-soft); color: var(--accent);
}
.step-label.practice { background: color-mix(in srgb, #16a34a 15%, transparent); color: var(--ok); }

/* Banco de frases (audio) */
.phrasebank { margin: 8px 0 24px; }
.phrasebank h3 { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.phrase {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; margin-bottom: 9px;
}
.phrase .en { font-weight: 600; }
.phrase .es { font-size: 0.85rem; color: var(--muted); }
.phrase .txt { flex: 1; }
.speak {
  flex: 0 0 auto; width: 40px; height: 40px; border-radius: 11px; border: 1px solid var(--border);
  background: var(--surface); color: var(--accent); font-size: 17px; cursor: pointer;
  display: grid; place-items: center; transition: transform .12s, background .12s;
}
.speak:hover { transform: scale(1.06); background: var(--accent-soft); }
.speak.playing { background: var(--accent); color: #fff; animation: pulse 1s infinite; }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 45%, transparent); } 50% { box-shadow: 0 0 0 6px transparent; } }

/* ---------------------------------------------------------- Quiz */
.quiz-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.quiz-progress { font-size: 0.82rem; color: var(--muted); font-weight: 600; }
.progress-bar { height: 8px; background: var(--ring-track); border-radius: 20px; overflow: hidden; margin-bottom: 22px; }
.progress-bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); border-radius: 20px; transition: width .4s; }
.question { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 20px; }
.question .qtext { flex: 1; font-size: 1.15rem; font-weight: 600; }
.opts { display: flex; flex-direction: column; gap: 11px; }
.opt {
  position: relative; text-align: left; background: var(--surface-2); border: 2px solid var(--border);
  border-radius: 12px; padding: 15px 16px; font-size: 1rem; color: var(--text);
  transition: border-color .14s, background .14s, transform .1s;
}
.opt:hover:not(:disabled) { border-color: var(--accent); background: var(--accent-soft); transform: translateX(2px); }
.opt.correct { border-color: var(--ok); background: var(--ok-soft); font-weight: 700; }
.opt.wrong { border-color: var(--no); background: var(--no-soft); }
.opt:disabled { cursor: default; }
.opt .tag { float: right; font-size: 0.75rem; font-weight: 800; }
.opt.correct .tag { color: var(--ok); }
.opt.wrong .tag { color: var(--no); }

/* Banner de feedback instantáneo */
.feedback { margin-top: 20px; padding: 18px 20px; border-radius: 14px; animation: pop .25s ease; }
@keyframes pop { from { opacity: 0; transform: translateY(-8px) scale(.98); } to { opacity: 1; transform: none; } }
.feedback.ok { background: var(--ok-soft); border: 1px solid color-mix(in srgb, var(--ok) 30%, transparent); border-left: 4px solid var(--ok); }
.feedback.no { background: var(--no-soft); border: 1px solid color-mix(in srgb, var(--no) 30%, transparent); border-left: 4px solid var(--no); }
.fb-title { font-size: 1.05rem; display: flex; align-items: center; gap: 8px; }
.fb-answer { margin: 10px 0; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.fb-answer .lbl { color: var(--muted); }
.fb-answer strong { color: var(--ok); font-size: 1.02rem; }
.feedback p { margin: 6px 0 14px; color: var(--text); }

/* ---------------------------------------------------------- Resultado */
.result { text-align: center; padding: 20px 10px; }
.result-ring { position: relative; width: 150px; height: 150px; margin: 0 auto 20px; }
.result-ring svg { transform: rotate(-90deg); }
.result-ring svg circle { transition: stroke-dashoffset .7s ease; }
.result-ring b { position: absolute; inset: 0; display: grid; place-items: center; font-size: 2rem; letter-spacing: -0.03em; }
.result h1 { margin-bottom: 6px; }
.result-actions { display: flex; gap: 12px; justify-content: center; margin-top: 22px; flex-wrap: wrap; }
.result-review { text-align: left; margin-top: 32px; }
.result-review h3 { margin-bottom: 12px; }
.review-item { background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--no); border-radius: 12px; padding: 15px 16px; margin-bottom: 11px; }
.review-item.ok { border-left-color: var(--ok); }
.review-item .rq { font-weight: 700; margin-bottom: 6px; display: flex; align-items: center; gap: 8px; }
.review-item .ra { font-size: 0.9rem; color: var(--muted); margin-top: 2px; }
.review-item .ra b { color: var(--ok); }
.review-item .ra .mine { color: var(--no); }

/* Repaso de respuestas (test de nivel y simulacros) */
.rev-q { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 15px 16px; margin-bottom: 12px; }
.rev-qh { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.rev-mark { font-size: 1rem; }
.rev-qtext { font-weight: 700; flex: 1; min-width: 60%; }
.rev-opts { display: flex; flex-direction: column; gap: 7px; }
.rev-opt { padding: 9px 13px; border-radius: 9px; border: 2px solid var(--border); background: var(--surface-2); font-size: 0.93rem; }
.rev-opt .tag { float: right; font-size: 0.72rem; font-weight: 800; }
.rev-opt.correct { border-color: var(--ok); background: var(--ok-soft); font-weight: 700; }
.rev-opt.correct .tag { color: var(--ok); }
.rev-opt.wrong { border-color: var(--no); background: var(--no-soft); }
.rev-opt.wrong .tag { color: var(--no); }
.rev-explain { margin-top: 10px; color: var(--muted); font-size: 0.88rem; }

/* Simulacros de examen */
.exam-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.exam-timer {
  font-variant-numeric: tabular-nums; font-weight: 800; font-size: 1.1rem;
  padding: 5px 14px; border-radius: 999px; background: var(--accent-soft); color: var(--accent);
}
.exam-timer.low { background: var(--no-soft); color: var(--no); animation: pulse 1s infinite; }
.exam-nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 22px; }
.exam-nav .btn-primary, .exam-nav .btn-ghost { margin-top: 0; }
.opt.selected { border-color: var(--accent); background: var(--accent-soft); font-weight: 700; }
.exam-grid { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 16px; }
.exam-dot { width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface-2); font-size: 0.8rem; font-weight: 700; color: var(--muted); cursor: pointer; }
.exam-dot.done { background: var(--accent); color: #fff; border-color: var(--accent); }
.exam-dot.current { outline: 2px solid var(--accent); }

.foot { text-align: center; margin-top: 44px; }

/* ---------------------------------------------------------- Sin JavaScript */
.noscript-box {
  max-width: 760px; margin: 30px auto; padding: 26px 22px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
}
.noscript-box h1 { margin-bottom: 10px; }

/* ---------------------------------------------------------- Huecos de anuncio */
.ad-wrap { max-width: 900px; margin: 0 auto; padding: 0 20px; }
.ad-slot {
  position: relative; display: grid; place-items: center;
  min-height: 100px; margin: 26px 0; padding: 12px;
  border: 1px dashed color-mix(in srgb, var(--muted) 45%, transparent);
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--surface-2) 60%, transparent);
}
.ad-slot[data-ad="leaderboard"] { min-height: 110px; }
.ad-slot[data-ad="in-content"] { min-height: 250px; }
.ad-label {
  font-size: 0.66rem; text-transform: uppercase; letter-spacing: .16em;
  color: var(--muted); opacity: .7;
}

/* ---------------------------------------------------------- Contenido SEO */
.site-content { max-width: 900px; margin: 10px auto 0; padding: 20px 20px 40px; }
.site-content h2 { margin: 28px 0 12px; }
.site-content h3 { margin: 30px 0 12px; }
.site-content h4 { margin: 0 0 6px; font-size: 1rem; }
.site-content p { margin-bottom: 14px; color: var(--text); }
.site-content strong { color: var(--accent); }
.site-content em { font-style: italic; opacity: .9; }

.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin: 14px 0 6px; }
.step {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow-sm);
}
.step-ico { font-size: 1.7rem; margin-bottom: 8px; }
.step p { font-size: 0.9rem; color: var(--muted); margin: 0; }

.feature-list { margin: 6px 0 14px 4px; padding-left: 22px; display: flex; flex-direction: column; gap: 9px; }
.feature-list li { color: var(--text); }

.site-content details {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 4px 18px; margin-bottom: 10px;
}
.site-content details[open] { box-shadow: var(--shadow-sm); }
.site-content summary {
  cursor: pointer; font-weight: 700; padding: 14px 0; list-style: none;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.site-content summary::-webkit-details-marker { display: none; }
.site-content summary::after { content: "+"; color: var(--accent); font-size: 1.3rem; font-weight: 700; }
.site-content details[open] summary::after { content: "–"; }
.site-content details p { margin: 0 0 16px; color: var(--muted); }

/* ---------------------------------------------------------- Pie de página */
.site-footer {
  border-top: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 70%, transparent);
  margin-top: 20px;
}
.sf-inner { max-width: 900px; margin: 0 auto; padding: 30px 20px; text-align: center; }
.sf-brand { display: flex; align-items: center; justify-content: center; gap: 10px; font-weight: 800; margin-bottom: 14px; flex-wrap: wrap; }
.sf-logo {
  width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; font-size: 12px;
}
.sf-domain { color: var(--muted); font-weight: 500; font-size: 0.85rem; }
.sf-nav { display: flex; flex-wrap: wrap; gap: 6px 22px; justify-content: center; margin-bottom: 14px; }
.sf-nav a { color: var(--muted); text-decoration: none; font-size: 0.9rem; font-weight: 600; }
.sf-nav a:hover { color: var(--accent); text-decoration: underline; }
.sf-copy { color: var(--muted); font-size: 0.8rem; max-width: 620px; margin: 0 auto; }

/* ---------------------------------------------------------- Aviso de cookies */
.cookie-consent {
  position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%);
  z-index: 200; width: min(680px, calc(100% - 28px));
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 16px 20px; border-radius: 16px;
  background: var(--surface); border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
}
.cc-text { flex: 1 1 260px; font-size: 0.86rem; color: var(--text); margin: 0; }
.cc-text a { color: var(--accent); }
.cc-actions { display: flex; gap: 10px; flex: 0 0 auto; }
.cc-btn { padding: 10px 18px; border-radius: 10px; font-weight: 700; font-size: 0.88rem; }
.cc-reject { background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); }
.cc-reject:hover { color: var(--text); border-color: var(--accent); }
.cc-accept { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; }
.cc-accept:hover { filter: brightness(1.05); }

/* ---------------------------------------------------------- Páginas legales */
.legal-page { max-width: 800px; margin: 0 auto; padding: 34px 20px 80px; }
.legal-topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 22px; background: color-mix(in srgb, var(--surface) 78%, transparent);
  backdrop-filter: saturate(180%) blur(12px); border-bottom: 1px solid var(--border);
}
.legal-topbar .brand { text-decoration: none; color: var(--text); }
.legal-topbar a.back { color: var(--accent); font-weight: 700; text-decoration: none; font-size: 0.9rem; }
.legal-page h1 { margin-bottom: 6px; }
.legal-page .updated { color: var(--muted); font-size: 0.85rem; margin-bottom: 26px; }
.legal-page h2 { margin: 30px 0 10px; font-size: 1.2rem; }
.legal-page p, .legal-page li { color: var(--text); margin-bottom: 12px; }
.legal-page ul { padding-left: 22px; margin-bottom: 14px; }
.legal-page a { color: var(--accent); }
/* Los botones dentro de páginas legales mantienen su texto blanco (no el color de enlace) */
.legal-page a.btn-primary { color: #fff; }
.legal-page .todo {
  background: var(--no-soft); border: 1px dashed var(--no);
  border-radius: 10px; padding: 4px 10px; color: var(--no); font-weight: 700; font-size: 0.88em;
}

/* ---------------------------------------------------------- Guías / Artículos */
.article { max-width: 760px; margin: 0 auto; padding: 30px 20px 80px; }
.breadcrumb { font-size: .82rem; color: var(--muted); margin-bottom: 18px; }
.breadcrumb a { color: var(--muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--accent); }
.article h1 { font-size: clamp(1.7rem, 4.5vw, 2.3rem); line-height: 1.12; margin-bottom: 10px; }
.article-meta { display: flex; flex-wrap: wrap; gap: 8px 16px; color: var(--muted); font-size: .85rem; margin-bottom: 26px; }
.article-meta .lvl { display: inline-block; padding: 2px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.article-lead { font-size: 1.12rem; color: var(--text); margin-bottom: 24px; }
.article h2 { font-size: 1.4rem; margin: 34px 0 12px; letter-spacing: -.01em; }
.article h3 { font-size: 1.12rem; margin: 24px 0 8px; }
.article p { margin-bottom: 15px; }
.article ul, .article ol { padding-left: 22px; margin: 0 0 16px; display: flex; flex-direction: column; gap: 8px; }
.article strong { color: var(--text); font-weight: 700; }
.article a { color: var(--accent); }
.article .en { font-weight: 600; }
.article .tr { color: var(--muted); font-style: italic; }

.a-table-wrap { overflow-x: auto; margin: 6px 0 20px; border: 1px solid var(--border); border-radius: 12px; }
.a-table { width: 100%; border-collapse: collapse; font-size: .93rem; }
.a-table th, .a-table td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: top; }
.a-table th { background: var(--surface-2); font-weight: 700; font-size: .82rem; }
.a-table tr:last-child td { border-bottom: none; }

.box { border-radius: 14px; padding: 16px 18px; margin: 20px 0; border: 1px solid var(--border); }
.box .box-t { font-weight: 800; margin-bottom: 6px; display: flex; align-items: center; gap: 8px; }
.box p { margin: 0; }
.box.tip { background: color-mix(in srgb, var(--accent) 8%, var(--surface)); border-color: color-mix(in srgb, var(--accent) 30%, var(--border)); }
.box.warn { background: var(--no-soft); border-color: color-mix(in srgb, var(--no) 30%, var(--border)); }
.box.warn .box-t { color: var(--no); }

.cta-box {
  margin: 34px 0; padding: 26px; border-radius: var(--radius); text-align: center;
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 12%, var(--surface)), var(--surface));
  border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--border));
}
.cta-box h3 { margin: 0 0 6px; }
.cta-box p { margin: 0 0 16px; color: var(--muted); }
.cta-box a.btn-primary { color: #fff; }

.related { margin-top: 40px; border-top: 1px solid var(--border); padding-top: 24px; }
.related h3 { margin-bottom: 14px; }
.related-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.related-list a {
  display: block; padding: 14px 16px; border: 1px solid var(--border); border-radius: 12px;
  text-decoration: none; color: var(--text); background: var(--surface); font-weight: 600; font-size: .92rem;
  transition: border-color .14s, transform .1s;
}
.related-list a:hover { border-color: var(--accent); transform: translateY(-2px); }

/* Índice de guías */
.guides-hero { max-width: 900px; margin: 0 auto; padding: 34px 20px 10px; }
.guides-hero h1 { font-size: clamp(1.9rem, 5vw, 2.6rem); margin-bottom: 8px; }
.guides-hero p { color: var(--muted); font-size: 1.05rem; max-width: 60ch; }
.guides-grid { max-width: 900px; margin: 0 auto; padding: 20px 20px 70px; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; }
.guide-card {
  display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 22px; text-decoration: none; color: inherit; box-shadow: var(--shadow-sm);
  transition: transform .16s, box-shadow .16s, border-color .16s; position: relative; overflow: hidden;
}
.guide-card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.guide-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: var(--accent); }
.guide-card .lvl { align-self: flex-start; font-size: .7rem; font-weight: 800; letter-spacing: .04em; padding: 3px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); margin-bottom: 12px; }
.guide-card h2 { font-size: 1.12rem; margin: 0 0 6px; }
.guide-card p { font-size: .9rem; color: var(--muted); margin: 0; flex: 1; }
.guide-card .go { margin-top: 14px; font-weight: 700; color: var(--accent); font-size: .88rem; }

/* ---------------------------------------------------------- Responsive */
@media (max-width: 560px) {
  .hero { flex-direction: column-reverse; text-align: center; }
  .hero-stats { justify-content: center; }
  #app { padding: 24px 14px 80px; }
  .mini-progress .bar { width: 60px; }
  .cookie-consent { flex-direction: column; align-items: stretch; text-align: center; }
  .cc-actions { justify-content: center; }
}
