/* Paleta "Turquesa sereno": turquesa profundo, verde agua y arena. Siempre en
   modo claro: en una clínica el blanco transmite limpieza. */
:root {
  color-scheme: light;
  --bg: #f4faf9;
  --surface: #ffffff;
  --ink: #1e3335;
  --muted: #4f6466;
  --line: #d6e6e4;
  --brand: #0e6f78;
  --brand-dark: #0a545b;
  --brand-ink: #ffffff;
  --brand-soft: #e3f1f0;
  --aqua: #5fb3b0;
  --sand: #e9dcc7;
  --sand-soft: #f6efe4;
  --sand-ink: #7a5a2e;
  --accent: #e0a63a;
  --danger: #c2453d;
  --danger-soft: #fbecea;
  --warn: #9a6512;
  --warn-soft: #fbf0dc;
  --ok: #2e7d5b;
  --ok-soft: #e3f3ec;
  --radius: 18px;
  --shadow: 0 12px 32px -14px rgba(20, 33, 35, .18);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "Plus Jakarta Sans", system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.55;
}
h1, h2, h3 { line-height: 1.15; margin: 0 0 .5em; }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
a { color: var(--brand); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.muted { color: var(--muted); }
.fine { color: var(--muted); font-size: .85rem; }
.lead { color: var(--muted); max-width: 60ch; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4em;
  border: 0; border-radius: 999px; cursor: pointer;
  background: var(--brand); color: var(--brand-ink);
  font: inherit; font-weight: 700; padding: .8em 1.4em; text-decoration: none;
  transition: transform .15s, opacity .15s;
}
.btn:hover { transform: translateY(-1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn-sm { padding: .5em 1em; font-size: .9rem; }
.btn-lg { padding: 1em 2em; font-size: 1.05rem; }
.btn-ghost { background: transparent; color: var(--brand); box-shadow: inset 0 0 0 2px var(--brand); }
.icon-btn { background: none; border: 0; color: inherit; font-size: 1.1rem; cursor: pointer; padding: .4em; }

/* Top bar */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .8rem clamp(16px, 4vw, 48px);
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: .5rem; font-weight: 800; color: var(--ink); text-decoration: none; }
.brand-mark { width: 34px; height: 34px; border-radius: 10px; background: var(--brand); display: grid; place-items: center; }
.brand-mark svg { width: 20px; fill: var(--brand-ink); }
.nav { display: flex; align-items: center; gap: 1.2rem; }
.nav a:not(.btn) { color: var(--muted); text-decoration: none; font-weight: 600; font-size: .95rem; }
@media (max-width: 640px) { .nav a:not(.btn) { display: none; } }

/* Hero */
.hero {
  display: grid; grid-template-columns: 1.2fr 1fr; gap: 3rem; align-items: center;
  padding: clamp(2rem, 6vw, 5rem) clamp(16px, 4vw, 48px);
  max-width: 1200px; margin: 0 auto;
}
.hero h1 { font-size: clamp(2.1rem, 5vw, 3.6rem); letter-spacing: -.02em; }
.hero h1 em { font-style: normal; color: var(--brand); }
.hero p { font-size: 1.1rem; color: var(--muted); max-width: 52ch; }
.pill { display: inline-block; background: var(--sand-soft); color: var(--sand-ink); font-weight: 700; font-size: .8rem; padding: .35em .9em; border-radius: 999px; margin-bottom: 1rem; }
.hero-cta { display: flex; flex-wrap: wrap; gap: .8rem; margin: 1.6rem 0; }
.hero-facts { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 1.5rem; color: var(--muted); font-size: .95rem; }
.hero-facts strong { color: var(--ink); }
.hero-card { background: linear-gradient(150deg, var(--brand) 0%, var(--brand-dark) 100%); border-radius: 28px; padding: 2rem; box-shadow: var(--shadow); }
.mock-chat { display: flex; flex-direction: column; gap: .7rem; }
.mock-who { display: flex; align-items: center; gap: .6rem; color: #fff; font-size: .9rem; }
.mock-who img { border-radius: 50%; background: var(--sand); border: 2px solid #fff; }
.mock-msg { padding: .75em 1em; border-radius: 16px; max-width: 85%; font-size: .95rem; }
.mock-msg.bot { background: #ffffff; color: var(--ink); border-bottom-left-radius: 4px; }
.mock-msg.me { background: #07434a; color: #fff; box-shadow: inset 0 0 0 1px rgba(255,255,255,.18); align-self: flex-end; border-bottom-right-radius: 4px; }
@media (max-width: 860px) { .hero { grid-template-columns: 1fr; } .hero-card { display: none; } }

/* Sections */
.section { max-width: 1200px; margin: 0 auto; padding: 3rem clamp(16px, 4vw, 48px); }
.services { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; margin-top: 1.5rem; }
.service { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; transition: transform .2s, box-shadow .2s; }
.service:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.service img { width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; display: block; background: var(--brand-soft); }
.service-body { padding: 1rem 1.1rem 1.1rem; display: flex; flex-direction: column; flex: 1; }
.service h3 { font-size: 1.05rem; margin-bottom: .25em; }
.service p { color: var(--muted); font-size: .9rem; margin: 0 0 .8em; flex: 1; }
.service-foot { display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.service .price { font-weight: 800; color: var(--sand-ink); background: var(--sand-soft); padding: .2em .65em; border-radius: 999px; font-size: .9rem; }
.link-btn { background: none; border: 0; color: var(--brand); font: inherit; font-weight: 700; font-size: .88rem; cursor: pointer; padding: .2em 0; }
.link-btn:hover { text-decoration: underline; }

/* AI tools */
.tools { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; margin-top: 1.5rem; }
@media (max-width: 860px) { .tools { grid-template-columns: 1fr; } }
.tool { background: var(--surface); border: 1px solid var(--line); border-radius: 24px; padding: 1.5rem; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 1rem; }
.tool header { display: flex; gap: 1rem; align-items: flex-start; }
.tool header p { margin: 0; color: var(--muted); font-size: .95rem; }
.tool h3 { margin: 0 0 .2em; }
.tool-icon { font-size: 1.6rem; width: 52px; height: 52px; border-radius: 14px; background: var(--brand-soft); display: grid; place-items: center; flex: none; }
.tool form { display: flex; flex-direction: column; gap: .8rem; }

textarea, input, select {
  width: 100%; font: inherit; color: var(--ink);
  background: var(--bg); border: 1.5px solid var(--line); border-radius: 12px; padding: .75em .9em;
}
textarea:focus, input:focus, select:focus { outline: none; border-color: var(--brand); }

.chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.chips button { font: inherit; font-size: .82rem; background: var(--brand-soft); color: var(--brand); border: 0; border-radius: 999px; padding: .35em .85em; cursor: pointer; }

.drop { border: 2px dashed var(--line); border-radius: 16px; min-height: 170px; display: grid; place-items: center; text-align: center; color: var(--muted); cursor: pointer; overflow: hidden; }
.drop:hover { border-color: var(--brand); }
.drop img { max-width: 100%; max-height: 260px; display: block; }

/* Results */
.result { border-radius: 16px; padding: 1.1rem 1.2rem; background: var(--brand-soft); animation: fade .3s ease; }
.result h4 { margin: 0 0 .5em; font-size: 1.05rem; }
.result ul { margin: .4em 0; padding-left: 1.2em; }
.result p { margin: .4em 0; }
.result.error { background: var(--danger-soft); }
.result .disclaimer { font-size: .8rem; color: var(--muted); margin-top: .8em; }
.badge { display: inline-block; font-weight: 800; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; padding: .3em .8em; border-radius: 999px; }
.badge.urgente { background: var(--danger); color: #fff; }
.badge.prioritaria { background: var(--accent); color: #3a2600; }
.badge.rutina { background: var(--ok); color: #fff; }
.alarm { background: var(--danger-soft); border: 1px solid color-mix(in srgb, var(--danger) 35%, transparent); padding: .7em .9em; border-radius: 8px; margin: .6em 0; font-weight: 600; }
.loading { display: flex; align-items: center; gap: .6rem; color: var(--muted); }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid var(--line); border-top-color: var(--brand); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } }

/* Booking */
.booking { background: var(--surface); border: 1px solid var(--line); border-radius: 24px; padding: clamp(1.2rem, 3vw, 2rem); display: flex; flex-direction: column; gap: 1rem; max-width: 980px; box-shadow: var(--shadow); }

/* Agenda: calendario + turnos del día */
.agenda { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 1.5rem; padding-bottom: 1rem; border-bottom: 1px solid var(--line); }
@media (max-width: 760px) { .agenda { grid-template-columns: 1fr; } }
.agenda-titulo { font-weight: 800; font-size: 1.1rem; margin: .2rem 0 0; }
.agenda-titulo::first-letter { text-transform: uppercase; }
.agenda-dia .fine { margin: .2rem 0 .8rem; }
.agenda-dia .slot-list { max-height: 300px; overflow-y: auto; padding: 2px; }
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: .6rem; }
.cal-mes { margin: 0; font-size: 1.05rem; }
.cal-nav { width: 36px; height: 36px; border-radius: 50%; border: 1.5px solid var(--line); background: none; color: var(--ink); cursor: pointer; display: grid; place-items: center; }
.cal-nav svg { width: 18px; fill: none; stroke: currentColor; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.cal-nav:disabled { opacity: .3; cursor: default; }
.cal-semana, .cal-dias { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-semana span { text-align: center; font-size: .75rem; font-weight: 700; color: var(--muted); padding: .3rem 0; }
.cal-dia { aspect-ratio: 1; border: 0; border-radius: 10px; font: inherit; font-weight: 700; font-size: .92rem; cursor: pointer; position: relative; background: transparent; color: var(--ink); }
.cal-dia.vacio { visibility: hidden; }
.cal-dia.libre { background: var(--ok-soft); color: var(--ok); }
.cal-dia.pocos { background: var(--warn-soft); color: var(--warn); }
.cal-dia.lleno { background: var(--danger-soft); color: var(--danger); text-decoration: line-through; }
.cal-dia.cerrado, .cal-dia.pasado { color: var(--muted); opacity: .45; cursor: default; }
.cal-dia.hoy { box-shadow: inset 0 0 0 2px var(--ink); }
.cal-dia.elegido { background: var(--brand); color: var(--brand-ink); }
.cal-dia:not(:disabled):hover { filter: brightness(.95); }
.cal-dia:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.cal-leyenda { list-style: none; padding: 0; margin: .9rem 0 0; display: flex; flex-wrap: wrap; gap: .4rem 1rem; font-size: .8rem; color: var(--muted); }
.punto { display: inline-block; width: 11px; height: 11px; border-radius: 4px; vertical-align: -1px; margin-right: .2rem; }
.punto.libre { background: var(--ok); }
.punto.pocos { background: var(--accent); }
.punto.lleno { background: var(--danger); }
.punto.cerrado { background: var(--line); }
.slot-list .slot-off { display: inline-flex; flex-direction: column; align-items: center; padding: .3em .7em; border-radius: 10px; border: 1.5px dashed var(--line); color: var(--muted); font-weight: 600; font-size: .85rem; line-height: 1.2; }
.slot-list .slot-off small { display: block; border: 0; padding: 0; font-size: .62rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; }

/* Panel: agenda */
.tabs { display: flex; gap: .4rem; margin-bottom: 1rem; }
.tab { font: inherit; font-weight: 700; padding: .5em 1.2em; border-radius: 999px; border: 1.5px solid var(--line); background: none; color: var(--muted); cursor: pointer; }
.tab[aria-selected="true"] { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.panel-agenda { display: grid; grid-template-columns: minmax(260px, 340px) 1fr; gap: 1.5rem; align-items: start; }
.panel-agenda[hidden] { display: none; }
@media (max-width: 800px) { .panel-agenda { grid-template-columns: 1fr; } }
#panel-cal { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 1rem; position: sticky; top: 1rem; }
.cal-dia.sincitas { background: var(--bg); }
.cal-dia.concitas { background: var(--brand-soft); color: var(--brand); }
.cal-dia.urgente { background: var(--danger-soft); color: var(--danger); }
.cal-puntos { position: absolute; left: 0; right: 0; bottom: 4px; display: flex; justify-content: center; gap: 2px; }
.cal-puntos i { width: 4px; height: 4px; border-radius: 50%; background: currentColor; }
.cal-dia.elegido .cal-puntos i { background: var(--brand-ink); }
.timeline { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; }
.timeline li { display: grid; grid-template-columns: 56px 1fr; gap: .8rem; padding: .45rem 0; border-top: 1px solid var(--line); align-items: start; }
.timeline time { font-weight: 800; font-variant-numeric: tabular-nums; padding-top: .15rem; color: var(--muted); }
.timeline li.ocupado time { color: var(--ink); }
.timeline li.libre .muted { font-size: .85rem; }
.timeline .card { margin-bottom: .4rem; }
.card.cancelada { opacity: .55; }

/* Créditos */
.creditos h1 { font-size: clamp(1.6rem, 4vw, 2.2rem); }
.creditos-lista { padding-left: 1.2em; display: flex; flex-direction: column; gap: .5rem; max-width: 80ch; }
.booking label { display: flex; flex-direction: column; gap: .35rem; font-weight: 600; font-size: .92rem; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 600px) { .grid2 { grid-template-columns: 1fr; } }
.slots { border: 0; padding: 0; margin: 0; }
.slots legend { font-weight: 600; font-size: .92rem; margin-bottom: .4rem; }
.slot-list { display: flex; flex-wrap: wrap; gap: .5rem; }
.slot-list label { flex-direction: row; }
.slot-list input { position: absolute; opacity: 0; width: 1px; }
.slot-list span { display: inline-block; padding: .45em .9em; border-radius: 10px; border: 1.5px solid var(--line); cursor: pointer; font-weight: 600; font-size: .9rem; }
.slot-list input:checked + span { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.slot-list input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }
.booking .check { flex-direction: row; align-items: flex-start; gap: .6rem; font-weight: 500; font-size: .85rem; color: var(--muted); }
.booking .check input { width: auto; margin-top: .3em; }
.triage-attached { background: var(--brand-soft); border-radius: 12px; padding: .8rem 1rem; font-size: .9rem; display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }

/* Ubicación */
.ubicacion { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 1.5rem; align-items: stretch; margin-top: 1.5rem; }
@media (max-width: 860px) { .ubicacion { grid-template-columns: 1fr; } }
.mapa { position: relative; border-radius: 24px; overflow: hidden; border: 1px solid var(--line); min-height: 340px; background: var(--brand-soft); }
.mapa iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.mapa-tag { position: absolute; left: 12px; top: 12px; background: var(--sand-soft); color: var(--sand-ink); border: 1px solid var(--sand); font-size: .78rem; font-weight: 700; padding: .35em .8em; border-radius: 999px; }
.ubicacion-info { background: var(--surface); border: 1px solid var(--line); border-radius: 24px; padding: 1.5rem; display: flex; flex-direction: column; gap: .4rem; }
.ubicacion-info h3 { margin: 0 0 .2rem; }
.ubicacion-info p { margin: .2rem 0; color: var(--muted); }
.ubicacion-btns { display: flex; flex-direction: column; gap: .6rem; margin-top: auto; padding-top: 1rem; }

/* Footer */
.footer { border-top: 1px solid var(--line); padding: 2rem clamp(16px, 4vw, 48px) 6rem; text-align: center; }
.footer p { margin: .3em auto; max-width: 70ch; }

/* Chat */
.chat-fab {
  position: fixed; right: 20px; bottom: 20px; z-index: 30;
  width: 60px; height: 60px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--sand); border: 3px solid var(--brand); box-shadow: 0 8px 20px -8px rgba(30, 51, 53, .45); display: grid; place-items: center; padding: 0;
}
.chat-fab img { width: 54px; height: 54px; border-radius: 50%; display: block; }
.fab-dot { position: absolute; right: 2px; bottom: 2px; width: 14px; height: 14px; border-radius: 50%; background: #3cc47c; border: 2.5px solid #fff; }
.chat-fab:hover { transform: scale(1.05); }
.chat-fab { transition: transform .15s; }
.chat {
  position: fixed; right: 20px; bottom: 92px; z-index: 31;
  width: min(390px, calc(100vw - 32px)); height: min(600px, calc(100vh - 120px));
  background: var(--surface); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; overflow: hidden; animation: fade .2s ease;
}
.chat[hidden] { display: none; }
@media (max-width: 520px) { .chat { right: 16px; bottom: 88px; } }
.chat-head { display: flex; justify-content: space-between; align-items: center; padding: .9rem 1rem; background: var(--brand); color: var(--brand-ink); }
.chat-head span { display: block; font-size: .78rem; }
.chat-head .chat-who span:not(.avatar) { color: #d8efed; }
.chat-who { display: flex; align-items: center; gap: .7rem; }
.avatar { position: relative; flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--sand); display: inline-block; }
.avatar img { width: 100%; height: 100%; border-radius: 50%; display: block; }
.avatar-lg { width: 44px; height: 44px; border: 2px solid #fff; }
.avatar .online { position: absolute; right: -1px; bottom: -1px; width: 11px; height: 11px; border-radius: 50%; background: #3cc47c; border: 2px solid var(--brand); }
.msg-row { display: flex; align-items: flex-end; gap: .45rem; max-width: 92%; }
.msg-row .msg { max-width: 100%; }
.chat-body { flex: 1; overflow-y: auto; padding: 1rem; display: flex; flex-direction: column; gap: .6rem; }
.msg { max-width: 85%; padding: .65em .9em; border-radius: 16px; font-size: .93rem; white-space: pre-wrap; word-wrap: break-word; }
.msg.bot { background: var(--brand-soft); border-bottom-left-radius: 4px; }
.msg.me { background: var(--brand); color: var(--brand-ink); align-self: flex-end; border-bottom-right-radius: 4px; }
.msg.err { background: var(--danger-soft); }
.msg .msg-cta { margin-top: .5em; }
.chat-chips { padding: 0 1rem .6rem; }
.chat-form { display: flex; gap: .5rem; padding: .7rem; border-top: 1px solid var(--line); }
.chat-form input { border-radius: 999px; }

/* Panel */
.panel-wrap { max-width: 1100px; margin: 0 auto; padding: 2rem clamp(16px, 4vw, 48px); }
.panel-login { max-width: 380px; margin: 10vh auto; display: flex; flex-direction: column; gap: 1rem; background: var(--surface); padding: 2rem; border-radius: 24px; border: 1px solid var(--line); box-shadow: var(--shadow); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1rem; margin: 1.5rem 0; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 1rem 1.2rem; }
.stat b { display: block; font-size: 1.8rem; }
.stat span { color: var(--muted); font-size: .85rem; }
.cards { display: flex; flex-direction: column; gap: .8rem; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 1rem 1.2rem; display: grid; grid-template-columns: 1fr auto; gap: .4rem 1rem; }
.card.urgente { border-color: color-mix(in srgb, var(--danger) 45%, var(--line)); background: color-mix(in srgb, var(--danger-soft) 45%, var(--surface)); }
.card.prioritaria { border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); }
.card.rutina { border-color: color-mix(in srgb, var(--ok) 35%, var(--line)); }
.card h3 { margin: 0; font-size: 1.05rem; }
.card .meta { color: var(--muted); font-size: .88rem; }
.card .ai { grid-column: 1 / -1; background: var(--brand-soft); border-radius: 10px; padding: .6em .8em; font-size: .9rem; }
.card .right { text-align: right; }
.empty { text-align: center; color: var(--muted); padding: 3rem 1rem; background: var(--surface); border-radius: 16px; border: 1px dashed var(--line); }

/* ---------- Acceso al panel ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); }
.auth-side {
  background: linear-gradient(160deg, var(--brand) 0%, var(--brand-dark) 100%);
  color: #fff; padding: clamp(2rem, 5vw, 4rem); display: flex; flex-direction: column; justify-content: space-between; gap: 2rem;
  position: relative; overflow: hidden;
}
.auth-side::after { content: ""; position: absolute; right: -120px; bottom: -120px; width: 340px; height: 340px; border-radius: 50%; background: rgba(233, 220, 199, .12); }
.auth-brand { color: #fff; font-size: 1.1rem; }
.auth-brand .brand-mark { background: var(--sand); }
.auth-brand .brand-mark svg { fill: var(--brand-dark); }
.auth-pitch h1 { font-size: clamp(1.8rem, 3.2vw, 2.6rem); letter-spacing: -.02em; max-width: 16ch; }
.auth-pitch ul { list-style: none; padding: 0; margin: 2rem 0 0; display: flex; flex-direction: column; gap: 1rem; max-width: 40ch; }
.auth-pitch li { display: flex; gap: .8rem; align-items: flex-start; color: #e6f4f2; }
.auth-pitch li span { width: 34px; height: 34px; flex: none; border-radius: 10px; background: rgba(255,255,255,.12); display: grid; place-items: center; font-size: 1rem; }
.auth-foot { color: #cfe7e4; font-size: .85rem; margin: 0; position: relative; z-index: 1; }
.auth-main { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 2rem 16px; background: var(--bg); }
.auth-card { width: 100%; max-width: 420px; background: var(--surface); border: 1px solid var(--line); border-radius: 24px; padding: clamp(1.5rem, 4vw, 2.4rem); box-shadow: var(--shadow); }
.auth-form { display: flex; flex-direction: column; gap: 1rem; }
.auth-form h2 { margin: 0; font-size: 1.6rem; }
.auth-form > .muted { margin: -.5rem 0 .3rem; font-size: .95rem; }
.auth-form label { display: flex; flex-direction: column; gap: .4rem; font-weight: 600; font-size: .9rem; }
.auth-form input { padding: .8em .95em; }
.auth-form input:focus { box-shadow: 0 0 0 3px var(--brand-soft); }
.label-row { display: flex; justify-content: space-between; align-items: baseline; gap: .5rem; }
.label-row .link-btn { font-size: .82rem; font-weight: 600; }
.pass { position: relative; display: block; }
.pass input { padding-right: 3rem; }
.eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; border: 0; border-radius: 8px; background: none; color: var(--muted); cursor: pointer; display: grid; place-items: center; }
.eye:hover { color: var(--brand); background: var(--brand-soft); }
.eye:focus-visible { outline: 2px solid var(--brand); }
.eye svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.hint { font-weight: 500; font-size: .8rem; color: var(--muted); }
.strength { height: 4px; border-radius: 4px; background: var(--line); overflow: hidden; }
.strength i { display: block; height: 100%; width: 0; border-radius: 4px; transition: width .25s, background .25s; }
.btn-block { width: 100%; padding: .9em 1.2em; margin-top: .2rem; }
.form-msg { margin: 0; padding: .7em .9em; border-radius: 10px; font-size: .88rem; font-weight: 500; background: var(--danger-soft); color: var(--danger); }
.form-msg.ok { background: var(--ok-soft); color: var(--ok); }
.auth-switch { text-align: center; color: var(--muted); font-size: .9rem; margin: .3rem 0 0; }
.back { align-self: flex-start; font-size: .88rem; }
.auth-legal { font-size: .85rem; margin-top: 1.2rem; }
.auth-legal a { color: var(--muted); }

/* Usuario en la cabecera del panel */
.user-chip { display: flex; align-items: center; gap: .5rem; padding-left: .8rem; border-left: 1px solid var(--line); }
.user-ini { width: 34px; height: 34px; border-radius: 50%; background: var(--sand); color: var(--sand-ink); font-weight: 800; font-size: .85rem; display: grid; place-items: center; }
.user-name { font-weight: 600; font-size: .9rem; }
@media (max-width: 640px) { .user-name { display: none; } }

@media (max-width: 880px) {
  .auth { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .auth-side { padding: 1.2rem 16px; gap: .6rem; }
  .auth-side::after, .auth-pitch ul, .auth-foot { display: none; }
  .auth-pitch h1 { font-size: 1.25rem; max-width: none; margin: 0; }
}
