/* Inicio de sesión y solicitud de demostración. Usan la identidad de marca
   (brand.css): papel, tinta y lima. Son pantallas de trabajo: una sola cosa
   que hacer y un botón principal. El formulario no tiene animación de
   entrada: se puede usar desde el primer instante. En el inicio de sesión el
   movimiento es de la semana (js/semana.js), que nunca lo bloquea. */

.auth-grid { min-height: 100dvh; display: grid; }

.auth-main {
  display: grid; grid-template-rows: auto 1fr auto; gap: 32px;
  padding: clamp(20px, 4vw, 40px) clamp(20px, 6vw, 72px) calc(clamp(20px, 4vw, 40px) + env(safe-area-inset-bottom));
}
.auth-main > .logo { justify-self: start; }
.auth-box { align-self: center; width: min(400px, 100%); display: grid; gap: clamp(24px, 4vh, 36px); }
.auth-box header { display: grid; gap: 12px; }
.auth .huge { font-size: clamp(2.25rem, 4.2vw, 3.25rem); }
.auth-box header p { color: var(--text-2); font-size: 1.0625rem; line-height: 1.5; text-wrap: pretty; }

/* Campos: etiqueta en texto normal, borde que se ve y foco con halo lima. */
.auth .input { min-height: 52px; border-radius: 12px; border: 1px solid var(--line-strong); background: var(--surface); }
.auth .input:focus { border-color: var(--ink); box-shadow: 0 0 0 4px var(--focus); }
.auth .form { gap: 18px; }
.auth .form .btn { margin-top: 6px; }
.auth .error { font-weight: 500; }
.auth .field i { font-style: normal; font-weight: 400; color: var(--text-3); }

.auth-foot { font-size: 0.9375rem; color: var(--text-2); }
.auth-foot a { color: var(--text); font-weight: 600; text-decoration: underline; text-decoration-color: var(--lime-strong); text-decoration-thickness: 2px; text-underline-offset: 4px; }

/* La pieza de tinta aparece cuando hay espacio. */
.auth-side { display: none; }
@media (min-width: 960px) {
  .auth-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); }
  .auth-side {
    display: grid; align-content: end; gap: 28px;
    margin: clamp(8px, 1.2vw, 16px); border-radius: clamp(24px, 2.6vw, 36px);
    padding: clamp(36px, 4vw, 64px);
  }
  .auth-side .mega { font-size: clamp(2.75rem, 4.8vw, 4.75rem); }
  .auth-side .lead { max-width: 26em; color: var(--text-2); }
}

/* ── Pedir una demostración ── */
.demo .auth-box { width: min(520px, 100%); padding: 16px 0; }
.demo .form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 18px; }
.demo textarea.input { min-height: 88px; padding: 14px; line-height: 1.45; resize: vertical; }
.demo .form .caption { color: var(--text-3); }
.demo .lead { color: var(--text-2); }
.demo .lead b { color: var(--text); font-weight: 600; }
.demo #done:focus { outline: none; }
/* Campo trampa para robots: fuera de la vista y del orden de tabulación. */
.trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.demo-points { list-style: none; margin: 0; padding: 0; display: grid; max-width: 32em; }
.demo-points li { padding: 14px 0; border-top: 1px solid var(--line); color: var(--text-2); font-size: 1rem; line-height: 1.45; }
.demo-points li:first-child { color: var(--text); font-weight: 550; border-top: 0; padding-top: 0; }

.auth-box [hidden] { display: none; }

/* ── Inicio de sesión: escenario gris con la semana y hoja blanca ── */
.login { background: var(--surface-3); }
.login .auth-grid { grid-template-rows: clamp(168px, 29dvh, 280px) 1fr; }
.login .stage { display: grid; grid-template-rows: minmax(0, 1fr); place-items: center; overflow: hidden; padding: calc(12px + env(safe-area-inset-top)) 0 12px; min-height: 0; }
#semana { display: block; width: min(300px, 70vw); height: 100%; overflow: visible; opacity: 0; transition: opacity var(--t-ui) ease; }
#semana.on { opacity: 1; }

.login .auth-main { position: relative; background: var(--surface); border-radius: 28px 28px 0 0; justify-items: center; text-align: center; gap: 24px; }
.login .auth-main > .logo { justify-self: center; }
.login .auth-box { width: min(360px, 100%); gap: clamp(24px, 3.6vh, 36px); }
.login .auth-box header { gap: 8px; }
.login .huge { font-size: clamp(2rem, 3.2vw, 2.75rem); }
.login .auth-box header p { font-size: 1rem; }
.login .form { text-align: start; gap: 22px; }
.login .error { margin-top: -6px; }
.login #google-login { display: grid; justify-content: center; }
.login #google-login:empty { display: none; }

/* Campo de una línea. El trazo de foco crece sobre la base. */
.login .field { gap: 0; }
.login .field label { font-size: 0.875rem; line-height: 1.4; font-weight: 500; color: var(--text-2); }
.login .line { position: relative; display: flex; align-items: center; border-bottom: 1px solid var(--line-strong); }
.login .line::after { content: ""; position: absolute; inset: auto 0 -1px; height: 2px; background: var(--ink); transform: scaleX(0); transform-origin: left; transition: transform var(--t-ui) var(--ease-out); pointer-events: none; }
.login .line:focus-within::after { transform: none; }
.login .input, .login .input:focus { flex: 1; min-width: 0; min-height: 46px; padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none; font-size: 1.0625rem; }
.login .input:-webkit-autofill { -webkit-text-fill-color: var(--text); box-shadow: inset 0 0 0 99px var(--surface); }
.login .wrong .field label { color: var(--danger); }
.login .wrong .line { border-color: var(--danger); }
.login .wrong .line::after { background: var(--danger); }

/* Mostrar u ocultar la contraseña: la raya se traza sobre el ojo. */
.peek { flex: none; display: grid; place-items: center; width: 44px; height: 44px; margin-right: -10px; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--text-2); cursor: pointer; transition: transform var(--t-press) var(--ease-out); }
.peek svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.peek .slash { stroke-dasharray: 1 2; stroke-dashoffset: 0; transition: stroke-dashoffset var(--t-ui) var(--ease-out), opacity var(--t-press) ease; }
.peek[aria-pressed="true"] { color: var(--text); }
.peek[aria-pressed="true"] .slash { stroke-dashoffset: 1; opacity: 0; }
.peek:active { transform: scale(0.92); }
@media (hover: hover) and (pointer: fine) { .peek:hover { color: var(--text); } }

/* Activar la cuenta */
.login .field .caption { margin-top: 8px; color: var(--text-2); }
.login #google-first { display: grid; gap: 20px; }
.login #google-first[hidden] { display: none; }
.login #google-first .google-login::before { content: none; }
.login .or { font-size: 0.875rem; color: var(--text-2); }
.login #lead { overflow-wrap: anywhere; }

/* Semana: los días que ya pasaron en tinta, hoy en lima y los que faltan en
   blanco. Las letras se ocultan junto con la contraseña. Al entrar, la semana
   queda completa en lima. */
.day { --day: var(--ink); --day-text: var(--surface); }
.day.today, #semana[data-mood="joy"] .day { --day: var(--lime); --day-text: var(--ink); }
.day.next { --day: var(--surface); --day-text: var(--ink); }
.day path { fill: none; stroke: var(--day); stroke-linecap: round; transition: stroke var(--t-ui) ease; }
.day text { fill: var(--day-text); font: 600 18px/1 var(--sans); text-anchor: middle; transition: opacity var(--t-ui) ease, fill var(--t-ui) ease; }
#semana:is([data-mood="secret"], [data-mood="wait"]) text { opacity: 0; }

@media (min-width: 960px) {
  .login .auth-grid { grid-template: 100dvh / minmax(0, 1.35fr) minmax(440px, 1fr); }
  .login .stage { place-items: center; padding: 0; }
  #semana { width: min(600px, 76%); height: auto; max-height: 72dvh; }
  .login .auth-main { margin: 12px 12px 12px 0; border-radius: 32px; overflow-y: auto; padding-block: clamp(24px, 5vh, 56px); }
}
@media (min-width: 960px) and (max-height: 640px) {
  .login .auth-main { gap: 14px; padding-block: 20px; }
  .login .auth-box { gap: 16px; }
  .login .form { gap: 14px; }
}
/* Teléfono acostado: todo el alto es para el formulario. */
@media (max-width: 959px) and (max-height: 520px) {
  .login .auth-grid { grid-template-rows: 1fr; }
  .login .stage { display: none; }
  .login .auth-main { border-radius: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .login .line::after, .peek, .peek .slash { transition: none; }
  .peek:active { transform: none; }
}
@media (prefers-contrast: more) { .login .line { border-color: var(--ink); } }

/* ── Comprobar un reporte (código QR) ── */
.check-page .auth-main { min-height: 100dvh; justify-items: center; }
.check-page .auth-box { width: min(560px, 100%); min-width: 0; }
.check-page .auth-foot { width: min(560px, 100%); }
.check-page #result { display: grid; gap: 16px; }
.check-page :is(#result, #compare)[hidden] { display: none; }
.check-page .caption { color: var(--text-2); }
.check-data { margin: 0; display: grid; }
.check-data > div { display: grid; grid-template-columns: minmax(0, 10rem) minmax(0, 1fr); gap: 4px 16px; padding: 12px 0; border-top: 1px solid var(--line); }
.check-data > div:first-child { border-top: 0; }
.check-data dt { color: var(--text-2); }
.check-data dd { margin: 0; font-weight: 500; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.check-data code { display: block; margin-top: 4px; font-size: 0.8125rem; font-weight: 400; color: var(--text-2); }
.check-data .bad, .check-result.bad { color: var(--danger); }
.check-result { font-weight: 600; }
.check-result:empty { display: none; }
.check-page input[type="file"] { padding: 12px 14px; }
@media (max-width: 480px) { .check-data > div { grid-template-columns: minmax(0, 1fr); } }
