/* ==========================================================================
   BULLDER · auth — entrar, crear cuenta, recuperar contraseña y bienvenida.
   Prefijo: au-
   ========================================================================== */

/* ------------------------------------------------------------------ marco */
.au-shell { min-height: 100dvh; display: flex; flex-direction: column; background: var(--bg); position: relative; overflow: hidden; }
.au-shell::before {
  content: ""; position: absolute; left: 50%; top: -220px; width: 620px; height: 520px; transform: translateX(-50%); pointer-events: none;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--navy) 70%, transparent), transparent);
  opacity: .9;
}
:root[data-theme="light"] .au-shell::before { opacity: .16; }
.au-brand { display: none; }
.au-panel {
  position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; width: 100%;
  padding: calc(var(--safe-t) + 36px) var(--sp-5) calc(var(--safe-b) + 20px);
}
.au-card { width: 100%; max-width: 420px; margin: auto 0; display: flex; flex-direction: column; gap: var(--sp-6); animation: au-rise .42s var(--ease) both; }
@keyframes au-rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.au-head { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; }
.au-head h1 { font-size: 28px; letter-spacing: -.02em; }
.au-head p { max-width: 340px; font-size: 15px; }
.au-logo { margin-bottom: 14px; }
.au-logo img { width: 132px; height: auto; }
.au-strong { color: var(--text); font-weight: 650; word-break: break-word; }
.au-state-ic { width: 76px; height: 76px; border-radius: 26px; display: grid; place-items: center; margin-bottom: 12px; background: var(--surface); color: var(--text-2); }
.au-state-ic.is-ok { background: var(--accent-soft); color: var(--accent); }
.au-state-ic.is-warn { background: var(--warn-soft); color: var(--warn); }

.au-form { display: flex; flex-direction: column; gap: var(--sp-4); }
.au-form > .btn-lg { margin-top: 4px; }
.au-row-end { display: flex; justify-content: flex-end; margin-top: -6px; }
.au-row-end .link { display: inline-flex; align-items: center; min-height: 32px; }
.au-alt { text-align: center; color: var(--text-2); }
.au-alt .link { display: inline-block; padding: 6px 2px; }
.au-legal { width: 100%; max-width: 420px; margin-top: var(--sp-6); text-align: center; font-size: 12.5px; line-height: 1.5; color: var(--text-3); }
.au-legal a { color: var(--text-2); text-decoration: underline; text-underline-offset: 2px; }
.au-legal a:hover { color: var(--text); }

/* ------------------------------------------------------------------ campos */
.au-input { position: relative; }
.au-input > .ic { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--text-3); pointer-events: none; width: 20px; height: 20px; transition: color .15s; }
.au-input:focus-within > .ic { color: var(--accent); }
.au-input .input { min-height: 54px; border-radius: 14px; }
.au-input.has-icon .input { padding-left: 48px; }
.au-input.has-suffix .input { padding-right: 52px; }
.au-input .input:-webkit-autofill { -webkit-text-fill-color: var(--text); box-shadow: 0 0 0 60px var(--surface-2) inset; caret-color: var(--text); }
.au-eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); color: var(--text-3); }
.au-eye:active { transform: translateY(-50%) scale(.9); }
.au-eye:hover { color: var(--text); }
.au-eye .ic { width: 20px; height: 20px; }
.au-form-error span { font-weight: 600; }

.au-meter { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; margin-top: 2px; }
.au-meter i { height: 4px; border-radius: 2px; background: var(--surface-3); transition: background .2s; }
.au-meter[data-score="1"] i:nth-child(-n+1) { background: var(--danger); }
.au-meter[data-score="2"] i:nth-child(-n+2) { background: var(--warn); }
.au-meter[data-score="3"] i:nth-child(-n+3) { background: var(--ok); }
.au-meter[data-score="4"] i { background: var(--ok); }

/* estado de la comprobación del nombre de usuario */
.au-status { display: flex; align-items: center; gap: 6px; min-height: 18px; font-size: 12.5px; color: var(--text-3); }
.au-status[data-state="ok"] { color: var(--ok); }
.au-status[data-state="bad"] { color: var(--danger); }
.au-dot-spin { width: 13px; height: 13px; border-radius: 50%; border: 2px solid var(--surface-3); border-top-color: var(--text-2); animation: spin .7s linear infinite; flex: none; }

/* casilla de aceptación */
.au-check { display: flex; align-items: flex-start; gap: 12px; cursor: pointer; font-size: 13.5px; line-height: 1.45; color: var(--text-2); position: relative; padding: 2px 0; }
.au-check input { position: absolute; opacity: 0; width: 24px; height: 24px; margin: 0; left: 0; top: 2px; cursor: pointer; }
.au-check-box { width: 24px; height: 24px; border-radius: 8px; border: 1.5px solid var(--line-strong); background: var(--surface); display: grid; place-items: center; flex: none; color: transparent; transition: all .15s var(--ease); }
.au-check-box .ic { width: 16px; height: 16px; stroke-width: 3; }
.au-check input:checked + .au-check-box { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.au-check input:focus-visible + .au-check-box { outline: 2px solid var(--accent); outline-offset: 2px; }
.au-check.is-invalid .au-check-box { border-color: var(--danger); }
.au-check a { color: var(--text); text-decoration: underline; text-underline-offset: 2px; }

/* ------------------------------------------------------------------ escritorio: dos columnas */
@media (min-width: 960px) {
  .au-shell { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(500px, .92fr); }
  .au-shell::before { display: none; }
  .au-panel { padding: 48px 56px 28px; justify-content: center; }
  .au-card { margin: auto 0; max-width: 400px; }
  .au-logo { display: none; }
  .au-head { align-items: flex-start; text-align: left; }
  .au-head h1 { font-size: 34px; }
  .au-head p { max-width: none; }
  .au-alt { text-align: left; }
  .au-legal { max-width: 400px; text-align: left; }

  .au-brand {
    display: flex; flex-direction: column; position: relative; overflow: hidden; padding: 44px 56px 0; color: #fff; isolation: isolate;
    background:
      radial-gradient(900px 520px at 85% -10%, color-mix(in srgb, var(--navy) 100%, #fff 12%), transparent 62%),
      linear-gradient(165deg, color-mix(in srgb, var(--navy) 92%, #000) 0%, color-mix(in srgb, var(--navy) 38%, #000) 100%);
    border-right: 1px solid var(--line);
  }
  .au-brand-top { display: flex; align-items: center; gap: 14px; }
  .au-brand-mark { height: 54px; width: auto; }
  .au-brand-word { height: 20px; width: auto; }
  .au-brand-copy { margin-top: clamp(28px, 7vh, 72px); max-width: 520px; position: relative; z-index: 2; }
  .au-brand-copy h2 { font-size: clamp(34px, 3.4vw, 50px); line-height: 1.06; letter-spacing: -.025em; color: #fff; }
  .au-brand-copy h2 em { font-style: normal; color: #b9f53c; }
  .au-points { list-style: none; margin: clamp(22px, 4vh, 40px) 0 0; padding: 0; display: grid; gap: 16px; }
  .au-points li { display: flex; align-items: flex-start; gap: 14px; }
  .au-points b { display: block; font: 650 15.5px/1.3 var(--font); color: #fff; }
  .au-points div > span { display: block; font-size: 14px; color: rgba(255, 255, 255, .68); margin-top: 2px; }
  .au-point-ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex: none; background: rgba(255, 255, 255, .09); color: #b9f53c; margin: 0; }
  .au-point-ic .ic { width: 20px; height: 20px; }

  /* collage de ejercicios: mosaico inclinado que se asoma por abajo */
  .au-collage {
    position: relative; z-index: 0; margin: clamp(28px, 5vh, 56px) -90px -70px -20px; flex: 1; min-height: 200px;
    display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-content: start;
    transform: rotate(-7deg) translateY(10px); transform-origin: 30% 0;
    -webkit-mask-image: linear-gradient(to bottom, #000 38%, transparent 96%); mask-image: linear-gradient(to bottom, #000 38%, transparent 96%);
  }
  .au-tile { margin: 0; border-radius: 18px; overflow: hidden; background: #fff; aspect-ratio: 16 / 10; box-shadow: 0 18px 40px rgba(0, 0, 0, .38); }
  .au-tile img, .au-tile video { width: 100%; height: 100%; object-fit: contain; background: #fff; }
  .au-tile:nth-child(3n+2) { transform: translateY(26px); }
  .au-tile:nth-child(3n) { transform: translateY(52px); }
}
@media (min-width: 960px) and (max-height: 760px) {
  .au-points li:nth-child(n+4) { display: none; }
}

/* ------------------------------------------------------------------ bienvenida (asistente) */
.au-ob { min-height: 100dvh; display: flex; flex-direction: column; background: var(--bg); position: relative; }
.au-ob-top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: var(--sp-2); padding: calc(var(--safe-t) + 8px) var(--sp-2) 8px; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.au-ob-top .progress { flex: 1; height: 6px; }
.au-ob-top .icon-btn[disabled] { opacity: 0; pointer-events: none; }
.au-ob-skip { min-width: 76px; color: var(--text-2); }
.au-ob-body { flex: 1; width: 100%; max-width: 520px; margin: 0 auto; padding: var(--sp-5) var(--sp-5) var(--sp-6); display: flex; flex-direction: column; }
.au-ob-step { display: flex; flex-direction: column; gap: var(--sp-5); animation: au-step .3s var(--ease) both; }
.au-ob-step.is-back { animation-name: au-step-back; }
@keyframes au-step { from { opacity: 0; transform: translateX(22px); } to { opacity: 1; transform: none; } }
@keyframes au-step-back { from { opacity: 0; transform: translateX(-22px); } to { opacity: 1; transform: none; } }
.au-ob-count { font: 700 12px/1 var(--font); letter-spacing: .09em; text-transform: uppercase; color: var(--accent); }
.au-ob-title { font-size: 28px; letter-spacing: -.02em; margin-top: 10px; }
.au-ob-sub { color: var(--text-2); margin-top: 8px; font-size: 15px; }
.au-ob-options { display: flex; flex-direction: column; gap: 10px; }
.au-ob-options .option { min-height: 66px; }
.au-opt-ic { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; background: var(--surface-2); color: var(--text-2); flex: none; transition: all .15s; }
.option.is-active .au-opt-ic { background: var(--accent); color: var(--on-accent); }
.au-opt-check { margin-left: auto; width: 24px; height: 24px; border-radius: 50%; border: 1.5px solid var(--line-strong); display: grid; place-items: center; color: transparent; flex: none; transition: all .15s; }
.au-opt-check .ic { width: 14px; height: 14px; stroke-width: 3.2; }
.option.is-active .au-opt-check { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }

.au-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.au-day { aspect-ratio: 1 / 1.15; min-height: 52px; border-radius: 14px; background: var(--surface); border: 1.5px solid var(--line); font: 700 21px/1 var(--font-display); font-variant-numeric: tabular-nums; color: var(--text-2); transition: all .15s var(--ease); }
.au-day:hover { border-color: var(--line-strong); color: var(--text); }
.au-day.is-active { background: var(--accent); border-color: var(--accent); color: var(--on-accent); transform: scale(1.04); }
.au-days-note { min-height: 44px; text-align: center; color: var(--text-2); font-size: 14.5px; }
.au-days-note b { color: var(--text); }

.au-triple { display: grid; grid-template-columns: .8fr 1.5fr 1fr; gap: 10px; }
.au-triple .select { min-height: 56px; border-radius: 14px; }
.au-big { display: flex; flex-direction: column; gap: 8px; }
.au-big-row { display: flex; align-items: stretch; gap: 10px; }
.au-big-input { position: relative; flex: 1; min-width: 0; }
.au-big-input .input { min-height: 64px; border-radius: 16px; font: 700 26px/1 var(--font-display); font-variant-numeric: tabular-nums; padding-right: 54px; }
.au-big-input .input::placeholder { color: var(--text-3); font-weight: 500; opacity: .6; }
.au-big-input > span { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); color: var(--text-3); font-weight: 650; pointer-events: none; }
.au-big-row .segmented { width: 116px; flex: none; border-radius: 16px; }
.au-big-row .segmented button { min-height: 54px; border-radius: 12px; font-size: 15px; }
.au-ob-note { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; line-height: 1.45; color: var(--text-3); }
.au-ob-note .ic { width: 16px; height: 16px; margin-top: 2px; }
.au-ob-note a { color: var(--text-2); text-decoration: underline; text-underline-offset: 2px; }

.au-ob-foot { position: sticky; bottom: 0; z-index: 5; padding: var(--sp-3) var(--sp-5) calc(var(--safe-b) + var(--sp-4)); background: linear-gradient(to top, var(--bg) 72%, transparent); }
.au-ob-foot-in { width: 100%; max-width: 480px; margin: 0 auto; display: flex; flex-direction: column; gap: 6px; }

/* final */
.au-done { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: var(--sp-6); padding: var(--sp-4) 0; animation: au-rise .5s var(--ease) both; }
.au-done-head { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.au-done-head h1 { font-size: 30px; letter-spacing: -.02em; }
.au-done-badge { width: 84px; height: 84px; border-radius: 28px; display: grid; place-items: center; background: var(--accent); color: var(--on-accent); margin-bottom: 8px; animation: au-pop .5s var(--ease) .1s both; }
.au-done-badge .ic { width: 40px; height: 40px; stroke-width: 2.6; }
@keyframes au-pop { from { transform: scale(.5); opacity: 0; } 60% { transform: scale(1.08); } to { transform: none; opacity: 1; } }
.au-summary { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.au-paths { display: flex; flex-direction: column; gap: 12px; }
.au-path { display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; padding: 18px var(--sp-4); border-radius: var(--r-lg); background: var(--surface); border: 1.5px solid var(--line); transition: transform .12s var(--ease), border-color .15s, background .15s; }
.au-path:hover { border-color: var(--line-strong); }
.au-path:active { transform: scale(.98); }
.au-path b { display: block; font: 700 17px/1.25 var(--font-display); }
.au-path span span { display: block; font-size: 13.5px; color: var(--text-2); margin-top: 3px; }
.au-path > .ic { margin-left: auto; color: var(--text-3); }
.au-path-ic { width: 48px; height: 48px; border-radius: 15px; display: grid; place-items: center; background: var(--surface-2); color: var(--text-2); flex: none; }
.au-path.is-main { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.au-path.is-main span span { color: color-mix(in srgb, var(--on-accent) 76%, transparent); }
.au-path.is-main .au-path-ic { background: color-mix(in srgb, var(--on-accent) 14%, transparent); color: var(--on-accent); }
.au-path.is-main > .ic { color: var(--on-accent); }
.au-path.is-loading { opacity: .6; pointer-events: none; }

@media (min-width: 960px) {
  .au-ob { background: radial-gradient(900px 480px at 50% -10%, color-mix(in srgb, var(--navy) 55%, transparent), transparent 70%), var(--bg); }
  :root[data-theme="light"] .au-ob { background: var(--bg); }
  .au-ob-top { max-width: 620px; width: 100%; margin: 0 auto; padding-top: 28px; background: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; position: static; }
  .au-ob-body { max-width: 560px; padding-top: 36px; }
  .au-ob-title { font-size: 34px; }
  .au-ob-body { flex: none; }
  .au-ob.is-done .au-ob-body { flex: 1; }
  .au-ob-foot { position: static; background: none; padding-top: 28px; padding-bottom: 48px; }
}

/* tema claro: el verde de marca no alcanza contraste AA como texto; los enlaces usan un tono más oscuro */
:root[data-theme="light"] .au-panel .link, :root[data-theme="light"] .au-ob .link { color: color-mix(in srgb, var(--accent) 58%, #000); }
