/* MesaViva · acceso y alta (templates/login.html y register.html).
   Las dos pantallas visten como la portada (static/landing.css): hueso cálido de base, rojo tomate para la acción,
   vino para lo elegido y DM Serif para los titulares. Se carga además de style.css y solo actúa en las páginas que
   tienen .auth-layout: primero cambia los colores y medidas comunes, y luego lo propio de cada pieza. */

@font-face { font-family: "DM Serif"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/dm-serif.woff2") format("woff2"); }
@font-face { font-family: "DM Serif"; font-style: italic; font-weight: 400; font-display: swap; src: url("fonts/dm-serif-italic.woff2") format("woff2"); }

body:has(.auth-layout) {
  /* Los mismos tonos que la portada, sobre los nombres que ya usa style.css */
  --ground: #f8f4ee; --surface: #fffdf9; --surface-2: #fbf7f1; --sunk: #efe6da;
  --ink: #241a15; --ink-2: #40322b; --ink-3: #65574e; --line: #e6dccf; --line-2: #d6c8b8;
  --tomato: #d63b25; --tomato-hover: #bd301b; --tomato-tint: #fbe5dd; --tomato-ink: #a52a17;
  --tile: #d63b25; --tile-tint: #fbe5dd; --tile-ink: #a52a17; --focus: #d63b25; --ring: 0 0 0 3px rgb(214 59 37 / .18);
  --wine: #3a1611; --on-wine: #fff6ef; --on-wine-muted: #e2cbbf; --gold-accent: #f4b63f;
  --serif: "DM Serif", Georgia, "Times New Roman", serif;
  --gutter: clamp(20px, 5vw, 64px);
  --wide: calc(1200px + 2 * var(--gutter));
  --bar-h: 72px;
  --control-h: 48px; --control-fs: 16px;
  --r-sm: 10px; --r: 12px; --r-lg: 16px;
  --shadow-soft: 0 1px 2px rgb(58 22 17 / .06), 0 12px 28px -16px rgb(58 22 17 / .22);
  --shadow-deep: 0 2px 6px rgb(58 22 17 / .08), 0 36px 64px -32px rgb(58 22 17 / .45);
  --ease: cubic-bezier(.22, 1, .36, 1);
  color: var(--ink);
  font-size: 16px;
  accent-color: var(--tomato);
}
body.public:not(.direct):has(.auth-layout) { background: var(--ground); }      /* style.css paints public pages white with this same weight */
body:has(.auth-layout) ::selection { background: var(--tomato); color: #fff; }
body:has(.auth-layout) :focus-visible { outline-color: var(--tomato); }

/* ---------- Cabecera y pie, como en la portada ---------- */
body:has(.auth-layout) .public-header { position: sticky; top: 0; z-index: 50; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--ground) 88%, transparent); backdrop-filter: blur(14px) saturate(1.2); -webkit-backdrop-filter: blur(14px) saturate(1.2); }
body:has(.auth-layout) .public-header-inner { max-width: var(--wide); }
body:has(.auth-layout) .public-header .brand { gap: 10px; font-size: 22px; font-weight: 650; letter-spacing: -.04em; }
body:has(.auth-layout) .public-header .brand b { color: var(--tomato); }
body:has(.auth-layout) .public-header .brand-mark { width: 32px; height: 32px; }
body:has(.auth-layout) .public-header nav { gap: 12px; }
body:has(.auth-layout) .public-header .ghost-link { min-height: 44px; padding: 0 8px; color: var(--ink); font-size: 15px; font-weight: 600; }
body:has(.auth-layout) .public-header .ghost-link:hover { background: transparent; color: var(--tomato-ink); }
body:has(.auth-layout) .public-header .button.small { min-height: 44px; margin-left: 4px; padding: 0 16px; border-radius: 12px; font-size: 15px; font-weight: 620; }
body:has(.auth-layout) .public-main { max-width: var(--wide); min-height: calc(100vh - 190px); padding: clamp(40px, 6vw, 80px) var(--gutter) clamp(56px, 7vw, 96px); background: transparent; }
body:has(.auth-layout) .public-footer { max-width: var(--wide); padding: 28px var(--gutter) 36px; border-top-color: var(--line); color: var(--ink-3); font-size: 14.5px; }
body:has(.auth-layout) .public-footer a { color: var(--ink); font-weight: 520; }
body:has(.auth-layout) .public-footer a:hover { color: var(--tomato-ink); }

/* ---------- Botones, enlaces y campos ---------- */
body:has(.auth-layout) .button { border-radius: 12px; font-weight: 620; letter-spacing: -.01em; box-shadow: none; transition: background-color .2s, translate .25s var(--ease), box-shadow .25s var(--ease); }
body:has(.auth-layout) .button.wide { min-height: 52px; font-size: 16px; }
body:has(.auth-layout) .button .icon { transition: transform .25s var(--ease); }
body:has(.auth-layout) .button:hover .icon { transform: translateX(3px); }
body:has(.auth-layout) .text-link { color: var(--tomato-ink); font-size: inherit; font-weight: 600; text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 4px; }
body:has(.auth-layout) .text-link:hover { color: var(--tomato); }
body:has(.auth-layout) label { margin-bottom: 8px; font-size: 14.5px; font-weight: 600; }
body:has(.auth-layout) :is(input, select, textarea) { border-radius: 12px; border-color: var(--line-2); background: #fff; font-size: 16px; }
body:has(.auth-layout) :is(input, select, textarea):hover { border-color: #bfae9c; }
body:has(.auth-layout) :is(input, select, textarea)::placeholder { color: #a39488; }
body:has(.auth-layout) .field-hint, body:has(.auth-layout) .helptext { color: var(--ink-3); font-size: 13.5px; line-height: 1.45; }
body:has(.auth-layout) .session-note { border-radius: 12px; box-shadow: none; font-size: 14.5px; }
body:has(.auth-layout) .form-errors { border-radius: 12px; box-shadow: inset 0 0 0 1px #f1c6b8; font-size: 14.5px; }
body:has(.auth-layout) :is(.errorlist, .field-error) { font-size: 13.5px; }

/* ---------- La columna de presentación ---------- */
.auth-layout { gap: clamp(32px, 5vw, 72px); }
.auth-layout .eyebrow { display: flex; align-items: center; gap: 12px; width: auto; margin: 0 0 16px; padding: 0; border-radius: 0; background: none; box-shadow: none; color: var(--tomato-ink); font-size: 13px; font-weight: 650; line-height: 1.4; letter-spacing: .14em; text-transform: uppercase; }
.auth-layout .eyebrow .icon { display: none; }
.auth-layout .eyebrow::before { content: ""; width: 24px; height: 2px; border-radius: 2px; background: currentColor; flex: none; }
.auth-layout .auth-intro h1 { margin-bottom: 20px; font: 680 clamp(40px, 4.8vw, 64px)/1.03 var(--font); letter-spacing: -.04em; text-wrap: balance; }
.auth-layout .auth-intro h1 em { color: var(--tomato); font-family: var(--serif); font-style: italic; font-weight: 400; letter-spacing: -.02em; }
.auth-layout .auth-lede { max-width: 46ch; color: var(--ink-3); font-size: clamp(17px, 1.4vw, 19px); line-height: 1.55; }

/* Acceso: la sala en directo, en su marco */
.auth-layout .live-demo { margin-top: 36px; padding: 16px; border-radius: 24px; box-shadow: var(--shadow-deep), 0 0 0 1px var(--line); }
.auth-layout .live-demo-head { margin: 2px 4px 14px; font-size: 14px; }
.auth-layout .live-floor { border-radius: 14px; }

/* Alta: los tres pasos, con su número en cursiva como en la portada */
.auth-layout .register-steps { gap: 20px; max-width: 460px; margin-top: 36px; padding-top: 28px; border-top: 1px solid var(--line); }
.auth-layout .register-steps li { gap: 16px; align-items: baseline; }
.auth-layout .auth-intro .register-steps .step-dot { width: 30px; height: auto; border-radius: 0; background: none; box-shadow: none; color: var(--tomato); font: italic 400 34px/1 var(--serif); }
.auth-layout .register-steps p { gap: 4px; color: var(--ink-3); font-size: 15.5px; line-height: 1.5; }
.auth-layout .register-steps strong { color: var(--ink); font-size: 17px; font-weight: 600; letter-spacing: -.01em; }

/* ---------- La tarjeta del formulario ---------- */
.auth-layout .login-card { padding: clamp(24px, 3vw, 36px); border-radius: 28px; background: var(--surface); box-shadow: var(--shadow-soft), 0 0 0 1px var(--line); }
.auth-layout .login-card .card-head { margin-bottom: 24px; }
.auth-layout .login-card .card-head h2 { font: 400 clamp(28px, 2.6vw, 34px)/1.1 var(--serif); letter-spacing: -.015em; }
.auth-layout .login-card .card-head .muted { margin-top: 8px; color: var(--ink-3); font-size: 15.5px; }
.auth-layout .login-card form p { margin-bottom: 16px; }
.auth-layout .login-card form > .button.wide, .auth-layout .register-form > .button.wide { margin-top: 12px; }
.auth-layout .login-switch { margin-top: 24px; padding-top: 20px; border-top-color: var(--line); color: var(--ink-3); font-size: 15px; }
.auth-layout .demo-credentials { border-radius: 14px; font-size: 14.5px; }
.auth-layout .request-sent { display: grid; gap: 20px; justify-items: start; }
.auth-layout .request-sent .card-head { margin: 0; }
.auth-layout .request-sent-icon { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; background: #e2f1e7; color: #1f7a45; }
.auth-layout .request-sent-icon .icon { width: 26px; height: 26px; }
.auth-layout .request-privacy { margin: 4px 0 0; }
.auth-layout textarea { min-height: 96px; padding: 12px 14px; }

/* Alta: apartados y planes */
.auth-layout .register-form fieldset + fieldset { margin-top: 28px; }
.auth-layout .register-form legend { margin-bottom: 16px; color: var(--tomato-ink); font-size: 12.5px; font-weight: 650; letter-spacing: .14em; text-transform: uppercase; }
.auth-layout .register-form .field { gap: 0; margin-bottom: 16px; }
.auth-layout .form-row { gap: 0 16px; }
.auth-layout .plan-options { gap: 10px; }
.auth-layout .plan-option { gap: 6px; padding: 16px; border-radius: 16px; background: var(--ground); box-shadow: inset 0 0 0 1px var(--line-2); cursor: pointer; transition: background-color .25s, box-shadow .25s, translate .3s var(--ease); }
.auth-layout .plan-option:hover { box-shadow: inset 0 0 0 1px var(--ink-3); translate: 0 -2px; }
.auth-layout .plan-option-top { flex-direction: column; flex-wrap: nowrap; align-items: flex-start; gap: 4px; }
.auth-layout .plan-option-name { font: 400 21px/1.15 var(--serif); letter-spacing: -.01em; }
.auth-layout .plan-option-price { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 4px; color: var(--tomato); font-size: 16px; font-weight: 650; white-space: normal; }
.auth-layout .plan-option-price small { color: var(--ink-3); font-size: 12px; font-weight: 500; }
.auth-layout .plan-option-pitch { color: var(--ink-3); font-size: 13px; line-height: 1.45; }
.auth-layout .plan-option:has(input:checked) { background: var(--wine); box-shadow: 0 16px 28px -18px rgb(58 22 17 / .6); color: var(--on-wine); }
.auth-layout .plan-option:has(input:checked) .plan-option-price { color: var(--gold-accent); }
.auth-layout .plan-option:has(input:checked) :is(.plan-option-pitch, .plan-option-price small) { color: var(--on-wine-muted); }
.auth-layout .plan-option:has(input:focus-visible) { outline: 3px solid var(--tomato); outline-offset: 3px; }

/* ---------- Movimiento: entran la presentación y la tarjeta; nada con «reducir movimiento» ---------- */
@media (prefers-reduced-motion: no-preference) {
  .auth-layout .auth-intro > * { animation: auth-rise .8s var(--ease) both; }
  .auth-layout .auth-intro > :nth-child(2) { animation-delay: .07s; }
  .auth-layout .auth-intro > :nth-child(3) { animation-delay: .14s; }
  .auth-layout .auth-intro > :nth-child(4) { animation-delay: .22s; }
  .auth-layout .login-card { animation: auth-rise .9s var(--ease) .12s both; }
  body:has(.auth-layout) .button:not(.secondary):hover { translate: 0 -2px; box-shadow: 0 12px 24px -12px rgb(214 59 37 / .75); }
}
@keyframes auth-rise { from { opacity: 0; translate: 0 22px; } }
/* After a wrong try the page comes back as it was, without its entrance: the warning is the only news. */
.auth-layout.has-errors .auth-intro > *, .auth-layout.has-errors .login-card { animation: none; }

@media (max-width: 900px) {
  body:has(.auth-layout) { --bar-h: 60px; }
  body:has(.auth-layout) .public-header .brand { font-size: 20px; }
  body:has(.auth-layout) .public-header .brand-mark { width: 28px; height: 28px; }
  body:has(.auth-layout) .public-header .button.small { padding: 0 12px; font-size: 14px; }
  .auth-layout .plan-options { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  body:has(.auth-layout) .public-header .ghost-link.login-link { display: none; }
  .auth-layout .login-card { border-radius: 22px; }
  .auth-layout .form-row { grid-template-columns: 1fr; }
}
