.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ================================================================
   Entrar / crear cuenta (AuthA) y bienvenida (AuthB2)
================================================================ */

.auth-page { display: flex; flex-wrap: wrap; min-height: calc(100vh - var(--navbar-h)); }
.auth-main { flex: 1 1 480px; min-width: 0; display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.auth-form { width: 100%; max-width: 400px; display: flex; flex-direction: column; gap: 16px; }
.auth-form h1 { margin: 0; font-size: 34px; line-height: 1.1; font-weight: 700; letter-spacing: -.02em; }
.auth-sub { margin: 0 0 8px; font-size: 16px; line-height: 1.55; color: var(--mid); }
.auth-error { margin: 0; padding: 12px 14px; border-radius: 12px; background: rgba(220,38,38,.1); color: var(--pass); font-size: 14px; font-weight: 600; }
:root[data-theme="dark"] .auth-error { color: #FCA5A5; }

.auth-field { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 600; }
.auth-field input {
  font: inherit; font-size: 16px; font-weight: 400; min-height: 52px; padding: 0 16px;
  border-radius: 14px; border: 1px solid var(--border-light); background: var(--bg-card); color: var(--text);
}
.auth-field input:focus { outline: 2px solid var(--accent-text); outline-offset: 1px; }
.auth-field small { font-weight: 400; color: var(--muted); }
.auth-pw { position: relative; display: flex; }
.auth-pw input { flex: 1; padding-right: 52px; }
.auth-pw button {
  position: absolute; right: 4px; top: 4px; width: 44px; height: 44px; border: 0; background: transparent;
  color: var(--mid); display: grid; place-items: center; cursor: pointer; border-radius: 10px;
}
.auth-who { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; background: var(--bg-2); font-size: 15px; }
.auth-who a { font-weight: 600; color: var(--accent-text); padding: 4px 0; }
.auth-submit {
  min-height: 52px; border-radius: 16px; border: 0; background: var(--primary); color: #fff;
  font: inherit; font-size: 16px; font-weight: 600; cursor: pointer;
}
.auth-submit:hover { background: var(--primary-dark); }
.auth-small { margin: 0; font-size: 13px; line-height: 1.5; color: var(--muted); }
.auth-small a, .auth-link { color: var(--accent-text); font-weight: 600; }

.auth-panel { flex: 1 1 480px; min-width: 0; padding: 16px; }
.auth-panel-inner { position: relative; height: 100%; min-height: 560px; border-radius: 28px; overflow: hidden; background: #0F172A; }
/* Mosaico con las portadas de las categorías, como las de la agenda */
.auth-mosaic { position: absolute; inset: 0 0 112px; padding: 10px 10px 0; box-sizing: border-box; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-rows: minmax(0, 1fr); gap: 10px; }
.auth-tile { min-height: 0; padding: 16px; border-radius: 20px; display: flex; flex-direction: column; justify-content: space-between; color: #fff; font-size: 18px; font-weight: 700; line-height: 1.1; overflow: hidden; }
.auth-tile svg { flex: none; }
.auth-tile:nth-child(5n + 1) { grid-column: span 2; }
.auth-panel-inner p { position: absolute; left: 28px; right: 28px; bottom: 24px; z-index: 1; margin: 0; font-size: 22px; line-height: 1.35; font-weight: 600; color: #fff; max-width: 460px; }

/* Bienvenida */
.welcome { max-width: 600px; margin: 0 auto; padding: 48px 24px 64px; }
.welcome-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 28px; padding: 28px; display: flex; flex-direction: column; gap: 20px; box-shadow: var(--shadow); }
.welcome-saved { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 600; color: var(--accent-text); margin: 0; }
.welcome-card h1 { margin: 0; font-size: 26px; line-height: 1.15; font-weight: 700; }
.welcome-card p { margin: 6px 0 0; font-size: 15px; color: var(--mid); }
.welcome-chips { display: flex; flex-wrap: wrap; gap: 8px; border: 0; margin: 0; padding: 0; }
.welcome-chip input, .welcome-freq input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.welcome-chip span {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 16px; border-radius: 999px;
  border: 1px solid var(--border-light); background: var(--bg-card); font-size: 15px; font-weight: 600; cursor: pointer;
}
.welcome-chip input:checked + span { background: var(--primary); color: #fff; border-color: var(--primary); }
.welcome-chip input:focus-visible + span, .welcome-freq input:focus-visible + span { outline: 2px solid var(--accent-text); outline-offset: 2px; }
.welcome-freq-group { border: 0; margin: 0; padding: 0; }
.welcome-freq-group legend { font-size: 15px; font-weight: 600; margin-bottom: 8px; padding: 0; }
.welcome-freqs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.welcome-freq span {
  display: grid; place-items: center; min-height: 48px; padding: 0 8px; border-radius: 14px; text-align: center;
  border: 1px solid var(--border-light); font-size: 14px; font-weight: 600; cursor: pointer;
}
.welcome-freq input:checked + span { background: var(--accent-soft); color: var(--accent-text); border: 2px solid var(--accent-text); }
.welcome-actions { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.welcome-actions .auth-submit { padding: 0 28px; }
.welcome-skip { font: inherit; font-size: 14px; font-weight: 600; color: var(--mid); background: none; border: 0; padding: 12px 0; cursor: pointer; }

@media (max-width: 768px) {
  .auth-page { flex-direction: column-reverse; flex-wrap: nowrap; min-height: 0; padding: 0; }
  .auth-panel, .auth-main { width: 100%; box-sizing: border-box; }
  .auth-panel { padding: 0; flex: none; }
  .auth-panel-inner { min-height: 0; height: 200px; border-radius: 0; }
  .auth-panel-inner p { display: none; }
  .auth-mosaic { inset: 0; grid-template-columns: repeat(5, minmax(0, 1fr)); padding: 8px 8px 32px; gap: 8px; }
  .auth-tile { padding: 0; border-radius: 14px; align-items: center; justify-content: center; }
  .auth-tile:nth-child(5n + 1) { grid-column: auto; }
  .auth-tile span { display: none; }
  .auth-main { align-items: flex-start; padding: 24px 20px 40px; margin-top: -24px; position: relative; z-index: 1; background: var(--bg); border-radius: 24px 24px 0 0; }
  .auth-form h1 { font-size: 26px; }
  .welcome { padding: 20px 16px 40px; }
  .welcome-freqs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
