/* Vuelve — cáscara visual Marca Vuelve (tokens portados de la referencia cf-deploy) */
:root {
  color-scheme: light dark;
  --bg: #f7f3ec;
  --bg-soft: #f1eadd;
  --surface: #fffdf8;
  --surface-2: #faf5ec;
  --ink: #514951;
  --ink-strong: #38303a;
  --ink-soft: #7a6f78;
  --line: #e4d9cc;
  --gold: #c9a24d;
  --rose: #a8566a;
  --rose-deep: #8c4357;
  --rose-soft: #f6e3e0;
  --sage: #66785c;
  --sage-deep: #4f6147;
  --sage-soft: #e7ecdd;
  --butter: #e9c887;
  --butter-soft: #faf0d7;
  --plum-1: #5e2a44;
  --plum-2: #8c4357;
  --shadow: 0 10px 30px rgba(81, 73, 81, 0.10);
  --radius: 18px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #241f26;
    --bg-soft: #2c2530;
    --surface: #332b36;
    --surface-2: #3a313d;
    --ink: #eadfe4;
    --ink-strong: #fbf5f1;
    --ink-soft: #bfb0ba;
    --line: #4c414e;
    --rose: #e2a3b4;
    --rose-deep: #f0bfce;
    --rose-soft: #4a323e;
    --sage: #b3c4a4;
    --sage-deep: #cfdec2;
    --sage-soft: #39412f;
    --butter: #eecf92;
    --butter-soft: #4a3f2a;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  }
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Montserrat", system-ui, sans-serif;
  font-size: 16.5px;
  line-height: 1.65;
}
h1, h2, h3, .serif { font-family: "Cormorant Garamond", Georgia, serif; color: var(--ink-strong); line-height: 1.15; margin: 0; }
p { margin: 0 0 1em; }
a { color: var(--rose-deep); }
button { font-family: inherit; cursor: pointer; }
img { max-width: 100%; display: block; }
:focus-visible { outline: 3px solid var(--rose); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }

/* ---------- Botones (armonización Marca Vuelve) ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: 999px; padding: 13px 26px;
  font-weight: 600; font-size: 15.5px; text-decoration: none;
  border: 1.5px solid transparent; transition: transform .15s ease, box-shadow .15s ease;
}
.btn:active { transform: scale(.98); }
.btn-block { display: flex; width: 100%; }
.btn-primary {
  color: #fff;
  background: linear-gradient(135deg, var(--plum-1), var(--plum-2));
  box-shadow: inset 0 0 0 1.5px rgba(233, 200, 135, .85), var(--shadow);
}
.btn-rose {
  color: #fff;
  background: linear-gradient(135deg, var(--rose), var(--rose-deep));
  box-shadow: inset 0 0 0 1.5px rgba(233, 200, 135, .7), var(--shadow);
}
.btn-ghost {
  color: var(--ink-strong); background: var(--surface-2);
  border-color: var(--gold);
}

/* ---------- Selector ES/EN ---------- */
.lang-switch {
  display: inline-flex; background: var(--surface-2);
  border: 1.5px solid var(--gold); border-radius: 999px; padding: 3px; gap: 2px;
}
.lang-switch button {
  border: 0; background: transparent; color: var(--ink-soft);
  font-weight: 700; font-size: 13px; padding: 5px 13px; border-radius: 999px;
}
.lang-switch button.active {
  color: #fff; background: linear-gradient(135deg, var(--rose), var(--rose-deep));
}

/* ---------- Puerta de acceso / pausa ---------- */
.view { min-height: 100vh; }
.gate-wrap {
  min-height: 100vh; display: flex; flex-direction: column; align-items: center;
  justify-content: center; padding: 22px 16px 30px;
  background:
    radial-gradient(120% 60% at 50% 0%, var(--rose-soft) 0%, transparent 55%),
    radial-gradient(100% 50% at 50% 110%, var(--sage-soft) 0%, transparent 55%),
    var(--bg);
}
.gate-lang { width: min(460px, 100%); display: flex; justify-content: flex-end; margin-bottom: 10px; }
.gate-card {
  width: min(460px, 100%); background: var(--surface);
  border: 1.5px solid var(--gold); border-radius: 26px;
  box-shadow: inset 0 0 0 4px var(--surface), inset 0 0 0 5.5px rgba(201, 162, 77, .45), var(--shadow);
  padding: 30px 26px 26px; text-align: center;
}
.gate-logo {
  width: 118px; height: 118px; object-fit: cover; margin: 0 auto 10px;
  border-radius: 50%; border: 3px solid var(--gold);
  box-shadow: 0 0 0 5px var(--rose-soft);
}
.gate-badge {
  margin: 0 0 2px; font-size: 11.5px; font-weight: 700; letter-spacing: .22em; color: var(--rose-deep);
}
.gate-title { font-size: 44px; font-weight: 700; }
.gate-hook { font-family: "EB Garamond", Georgia, serif; font-style: italic; font-size: 18px; color: var(--ink-soft); }
.gate-tabs { display: flex; gap: 8px; margin: 18px 0 16px; }
.gate-tab {
  flex: 1; padding: 11px; border-radius: 999px; font-weight: 700; font-size: 15px;
  background: var(--surface-2); color: var(--ink-soft); border: 1.5px solid var(--line);
}
.gate-tab.active { color: #fff; background: linear-gradient(135deg, var(--plum-1), var(--plum-2)); border-color: transparent; }
.gate-form { text-align: left; display: flex; flex-direction: column; gap: 12px; }
.gate-form label { display: flex; flex-direction: column; gap: 5px; font-size: 13.5px; font-weight: 600; color: var(--ink-soft); }
.gate-form input {
  font: inherit; font-size: 16px; color: var(--ink-strong);
  background: var(--surface-2); border: 1.5px solid var(--line); border-radius: 12px;
  padding: 11px 13px; width: 100%;
}
.gate-form input:focus { outline: none; border-color: var(--rose); }
.form-error {
  margin: 0; padding: 10px 13px; border-radius: 12px; font-size: 14.5px;
  background: var(--rose-soft); color: var(--rose-deep); font-weight: 600;
}
.gate-note { margin: 0; font-size: 13.5px; color: var(--ink-soft); text-align: center; }
.gate-code-btn { margin: 0 0 16px; }
.gate-divider { height: 1px; background: var(--line); margin: 20px 0 14px; }
.gate-guide-link {
  background: none; border: 0; color: var(--rose-deep); font-weight: 700; font-size: 15px; padding: 4px;
}
.gate-foot { margin-top: 14px; font-size: 13px; color: var(--ink-soft); }

/* ---------- Barra superior ---------- */
.appbar {
  position: sticky; top: 0; z-index: 45;
  display: flex; align-items: center; gap: 10px;
  background: var(--surface); border-bottom: 1px solid var(--line);
  padding: 8px 16px;
}
.menu-btn {
  flex: 0 0 auto; width: 44px; height: 44px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--surface-2); border: 1.5px solid var(--line); border-radius: 12px;
  color: var(--ink-strong);
}
.menu-btn:hover { border-color: var(--rose); color: var(--rose-deep); }
.appbar .brand-mini { display: flex; align-items: center; gap: 9px; flex: 0 0 auto; }
.appbar .brand-mini img { width: 33px; height: 44px; border-radius: 8px; object-fit: cover; border: 2px solid var(--rose-soft); background: #f7f0e6; }
.appbar .brand-name { font-family: "Cormorant Garamond", serif; font-size: 24px; font-weight: 700; color: var(--ink-strong); line-height: 1; white-space: nowrap; }
.appbar .current-section {
  font-size: 13.5px; font-weight: 600; color: var(--ink-soft);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0;
  border-left: 1px solid var(--line); padding-left: 10px;
}
.appbar-badge {
  margin-left: auto; font-size: 10.5px; font-weight: 700; letter-spacing: .16em;
  color: var(--rose-deep); background: var(--rose-soft);
  border: 1px solid var(--gold); border-radius: 999px; padding: 4px 10px; white-space: nowrap;
}
@media (max-width: 560px) {
  .appbar { padding: 8px 10px; gap: 8px; }
  .appbar .brand-name { display: none; }
  .appbar .current-section { border-left: none; padding-left: 0; font-size: 14.5px; color: var(--ink-strong); }
  .appbar-badge { display: none; }
}

/* ---------- Menú lateral ---------- */
.drawer { position: fixed; inset: 0; z-index: 60; visibility: hidden; transition: visibility 0s linear 0.32s; }
.drawer.open { visibility: visible; transition-delay: 0s; }
.drawer-backdrop { position: absolute; inset: 0; background: rgba(30, 22, 30, 0.45); opacity: 0; transition: opacity 0.3s ease; }
.drawer.open .drawer-backdrop { opacity: 1; }
.drawer-panel {
  position: absolute; top: 0; left: 0; bottom: 0;
  width: min(320px, 86vw);
  background: var(--surface); border-right: 1px solid var(--line);
  box-shadow: var(--shadow);
  padding: 20px 18px calc(20px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 4px; overflow-y: auto;
  transform: translateX(-105%); transition: transform 0.3s ease;
}
.drawer.open .drawer-panel { transform: translateX(0); }
.drawer-head { display: flex; align-items: center; gap: 10px; padding-bottom: 12px; border-bottom: 1px solid var(--line); margin-bottom: 8px; }
.drawer-head img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; border: 2px solid var(--gold); }
.drawer-head .drawer-brand { font-family: "Cormorant Garamond", serif; font-size: 24px; font-weight: 700; color: var(--ink-strong); line-height: 1; }
.drawer-group { margin: 10px 0 2px; font-size: 11px; font-weight: 700; letter-spacing: .18em; color: var(--rose-deep); text-transform: uppercase; }
.drawer-item {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  width: 100%; text-align: left; padding: 10px 12px; border-radius: 12px;
  background: transparent; border: 0; font-size: 15.5px; color: var(--ink-strong); font-weight: 500;
}
.drawer-item.active { background: var(--rose-soft); font-weight: 700; }
.drawer-item:disabled { color: var(--ink-soft); cursor: default; }
.soon-tag { font-size: 10.5px; font-weight: 700; letter-spacing: .08em; color: var(--sage-deep); background: var(--sage-soft); border-radius: 999px; padding: 2px 8px; }
.drawer-foot { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line); }

/* ---------- Inicio ---------- */
.home { max-width: 680px; margin: 0 auto; padding: 20px 16px 40px; }
.home-date { margin: 0 0 2px; font-size: 13.5px; font-weight: 600; letter-spacing: .06em; color: var(--ink-soft); text-transform: capitalize; }
.home-greeting { font-size: 34px; font-weight: 700; margin-bottom: 14px; }
.class-strip {
  display: flex; align-items: center; gap: 7px; flex-wrap: wrap;
  background: linear-gradient(135deg, var(--butter-soft), var(--rose-soft));
  border: 1.5px solid var(--gold); border-radius: 999px;
  padding: 8px 16px; font-size: 14px; font-weight: 600; color: var(--ink-strong);
  text-decoration: none; margin-bottom: 18px;
}
.class-strip-label { color: var(--rose-deep); font-weight: 700; }
.hero-card {
  border-radius: 26px; padding: 30px 22px 24px; text-align: center; margin-bottom: 18px;
  border: 1.5px solid var(--gold);
  background:
    linear-gradient(rgba(255, 251, 243, .88), rgba(255, 251, 243, .82)),
    radial-gradient(90% 120% at 15% 0%, var(--rose-soft) 0%, transparent 55%),
    radial-gradient(80% 110% at 90% 100%, var(--sage-soft) 0%, transparent 55%),
    var(--surface);
  box-shadow: var(--shadow);
}
@media (prefers-color-scheme: dark) {
  .hero-card { background: linear-gradient(rgba(51, 43, 54, .9), rgba(51, 43, 54, .86)), var(--surface); }
}
.hero-logo {
  width: 168px; height: 168px; object-fit: cover; margin: 0 auto 12px;
  border-radius: 22px; border: 3px solid var(--gold);
  box-shadow: 0 0 0 6px var(--surface), 0 0 0 8px rgba(201, 162, 77, .5);
}
.hero-hook { font-family: "EB Garamond", Georgia, serif; font-style: italic; font-size: 20px; color: var(--ink-strong); margin: 0; }
.card {
  background: var(--surface); border: 1.5px solid rgba(201, 162, 77, .55);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 20px 20px 16px; margin-bottom: 16px;
}
.card-title { font-size: 23px; font-weight: 700; margin-bottom: 8px; }
.card-note { font-size: 14px; color: var(--ink-soft); }
.affirmation-text { font-family: "EB Garamond", Georgia, serif; font-size: 21px; font-style: italic; color: var(--ink-strong); }
.mirror-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.mirror-dots { display: inline-flex; gap: 7px; }
.mirror-dots span { width: 15px; height: 15px; border-radius: 50%; border: 2px solid var(--gold); background: transparent; }
.mirror-dots span.on { background: radial-gradient(circle at 35% 35%, var(--butter), var(--gold)); }
.mirror-done { margin: 10px 0 0; font-weight: 700; color: var(--sage-deep); }
.moon-line { text-align: center; font-size: 14.5px; color: var(--ink-soft); margin: 4px 0 18px; }
.home-foot { text-align: center; font-family: "EB Garamond", Georgia, serif; font-style: italic; color: var(--ink-soft); border-top: 1px solid var(--line); padding-top: 16px; }
.home-foot p { margin: 0; }

/* ---------- Modal ---------- */
.modal { position: fixed; inset: 0; z-index: 80; display: flex; align-items: center; justify-content: center; padding: 18px; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(30, 22, 30, 0.45); }
.modal-card {
  position: relative; width: min(440px, 100%); background: var(--surface);
  border: 1.5px solid var(--gold); border-radius: 22px; box-shadow: var(--shadow);
  padding: 24px 22px 20px;
}
