/* ===================================================================
   assets/css/auth.css — Recuperar y restablecer contraseña (Océano oscuro)
   Mismo lenguaje que login.php: fondo océano, tarjeta de vidrio,
   botón azul píldora, campos translúcidos. Solo presentación.
   =================================================================== */

:root{
  --a-bg:     #06121C;
  --a-text:   #F2F8FC;
  --a-soft:   var(--rail-text);
  --a-muted:  var(--rail-text-2);
  --a-line:   rgba(255,255,255,.10);
  --a-accent: var(--o-accent);
  --a-accent-h:var(--o-accent-hover);
  --a-bright: var(--o-accent-bright);
  --a-sans:   'Montserrat', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --a-ease:   cubic-bezier(.2,.7,.2,1);
}

*, *::before, *::after { box-sizing: border-box; }
html { min-height: 100%; background: var(--a-bg); }
body.auth {
  margin: 0; min-height: 100vh; min-height: 100svh; overflow-x: hidden;
  font-family: var(--a-sans); color: var(--a-text);
  -webkit-font-smoothing: antialiased;
  background:
    radial-gradient(circle at 18% 22%, #0ea5e924, transparent 29%),
    radial-gradient(circle at 82% 14%, #2dd4bf1f, transparent 26%),
    radial-gradient(circle at 54% 92%, #38bdf818, transparent 31%),
    #06121C;
}
body.auth button, body.auth input { font: inherit; }
body.auth ::selection { background: var(--o-accent-bright); color: #06121C; }
.hidden { display: none !important; }

/* ── Escenario ── */
.stage {
  position: relative; isolation: isolate; min-height: 100vh; min-height: 100svh; overflow: hidden;
  display: grid; grid-template-columns: minmax(0, 1fr) clamp(430px, 34vw, 540px);
}
/* Capas de fondo (sin foto): rejilla fina + auroras */
.stage__photo {
  position: absolute; inset: 0; z-index: -3; pointer-events: none;
  background:
    radial-gradient(420px 420px at 6% 4%, rgba(var(--o-accent-rgb),.30), transparent 70%),
    radial-gradient(360px 360px at 96% 28%, rgba(56,189,248,.20), transparent 70%),
    radial-gradient(520px 520px at 42% 108%, rgba(125,211,252,.16), transparent 70%);
  animation: drift 16s ease-in-out infinite alternate;
}
.stage__shade {
  position: absolute; inset: 0; z-index: -2; pointer-events: none; opacity: .22;
  background-image:
    linear-gradient(rgba(255,255,255,.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.06) 1px, transparent 1px);
  background-size: 58px 58px;
  -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,.8), transparent 88%);
  mask-image: linear-gradient(to bottom, rgba(0,0,0,.8), transparent 88%);
}
.stage__grain {
  position: absolute; inset: 0; z-index: -1; pointer-events: none; opacity: .03; mix-blend-mode: soft-light;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 220 220' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.7'/%3E%3C/svg%3E");
}
@keyframes drift { from { transform: translate3d(-12px,-6px,0) scale(1); } to { transform: translate3d(22px,14px,0) scale(1.05); } }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

/* ── Marca ── */
.brandbar { display: flex; align-items: center; gap: 14px; animation: rise .8s var(--a-ease) both; }
.brandbar__mark {
  width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center;
  background: rgba(255,255,255,.94); box-shadow: 0 14px 30px -14px rgba(0,0,0,.7);
}
.brandbar__mark img { width: 30px; height: 30px; object-fit: contain; display: block; }
.brandbar__name { font-size: 12px; font-weight: 800; letter-spacing: .24em; text-transform: uppercase; line-height: 1.2; color: var(--a-text); }
.brandbar__name small { display: block; margin-top: 3px; font-weight: 500; letter-spacing: .2em; color: var(--a-muted); }

/* ── Hoja: vidrio sobre océano ── */
.sheet {
  position: relative; display: flex; align-items: center; justify-content: center; padding: 40px clamp(24px, 3.4vw, 52px);
  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.018)), rgba(8,22,34,.76);
  -webkit-backdrop-filter: blur(28px) saturate(135%); backdrop-filter: blur(28px) saturate(135%);
  border: 1px solid var(--a-line);
  box-shadow: 0 40px 120px rgba(0,0,0,.58), inset 0 1px 0 rgba(255,255,255,.08);
  animation: rise .8s .08s var(--a-ease) both;
}
.sheet::before {
  content: ''; position: absolute; left: 28px; right: 28px; top: 0; height: 3px; border-radius: 0 0 3px 3px;
  background: linear-gradient(90deg, var(--o-accent-bright), var(--o-accent-2));
}
.sheet__inner { width: 100%; max-width: 380px; }
.sheet__eyebrow { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; font-size: 11px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; color: var(--a-muted); }
.sheet__eyebrow b {
  display: inline-grid; place-items: center; min-width: 26px; height: 22px; padding: 0 7px; border-radius: 999px;
  background: rgba(var(--o-accent-rgb),.16); color: var(--o-accent-line); font-weight: 800; letter-spacing: .04em;
}
.sheet__title { margin: 0 0 10px; font-weight: 800; font-size: clamp(28px, 3vw, 36px); line-height: 1.05; letter-spacing: -.035em; color: #F8FBFE; text-wrap: balance; }
.sheet__lede { margin: 0 0 26px; font-size: 14px; line-height: 1.65; color: var(--a-muted); }

/* ── Campos ── */
.field { position: relative; margin-bottom: 16px; }
.field label { display: block; margin-bottom: 8px; font-size: 10.5px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: #DDE9F3; }
.input-wrap { position: relative; display: flex; align-items: center; }
.input-icon { position: absolute; right: 17px; z-index: 1; display: grid; color: #8FA6B8; pointer-events: none; transition: color .2s; }
.input-wrap input {
  width: 100%; height: 54px; padding: 0 50px 0 18px; border: 1px solid rgba(255,255,255,.10); border-radius: 18px;
  background: rgba(255,255,255,.04); font: 600 14px var(--a-sans); color: #fff; outline: none; caret-color: var(--o-accent-bright);
  transition: border-color .24s, background .24s, box-shadow .24s;
}
.input-wrap input::placeholder { color: #7E96A8; font-weight: 500; }
.input-wrap input:hover { border-color: rgba(255,255,255,.18); }
.input-wrap input:focus { background: rgba(255,255,255,.07); border-color: rgba(56,189,248,.55); box-shadow: 0 0 0 4px rgba(var(--o-accent-rgb),.16); }
.input-wrap input:focus ~ .input-icon { color: var(--o-accent-light); }
.input-wrap input:disabled { opacity: .5; cursor: not-allowed; }
.input-wrap input:-webkit-autofill, .input-wrap input:-webkit-autofill:hover, .input-wrap input:-webkit-autofill:focus {
  -webkit-text-fill-color: #fff; -webkit-box-shadow: 0 0 0 1000px #0B1E2D inset; transition: background-color 5000s ease-in-out 0s;
}
.toggle-pass { position: absolute; right: 8px; z-index: 1; display: grid; place-items: center; width: 38px; height: 38px; border: 0; border-radius: 12px; background: none; color: #8FA6B8; cursor: pointer; transition: color .2s, background .2s; }
.toggle-pass:hover { color: #fff; background: rgba(255,255,255,.07); }
.toggle-pass:focus-visible { outline: 2px solid var(--o-accent-bright); outline-offset: 0; }
.forgot { margin-top: 12px; text-align: right; }
.forgot a, .link { font-size: 12.5px; font-weight: 700; color: var(--o-accent-light); text-decoration: none; transition: color .2s; }
.forgot a:hover, .link:hover { color: #fff; text-decoration: underline; text-underline-offset: 4px; }
.link:focus-visible, .forgot a:focus-visible { outline: 2px solid var(--o-accent-bright); outline-offset: 3px; border-radius: 6px; }

/* ── Botón principal ── */
.btn-submit {
  position: relative; display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 54px; margin-top: 22px; padding: 0 24px;
  border: 1px solid rgba(255,255,255,.08); border-radius: 999px; background: var(--a-accent); color: #fff;
  font: 800 12px var(--a-sans); letter-spacing: .1em; text-transform: uppercase; cursor: pointer;
  box-shadow: 0 18px 42px rgba(var(--o-accent-rgb),.20), inset 0 1px 0 rgba(255,255,255,.15);
  transition: transform .23s ease, box-shadow .23s ease, background .23s ease;
}
.btn-submit:hover { transform: translateY(-2px); background: var(--a-accent-h); box-shadow: 0 24px 58px rgba(var(--o-accent-rgb),.26), inset 0 1px 0 rgba(255,255,255,.2); }
.btn-submit:active { transform: translateY(0) scale(.995); }
.btn-submit:focus-visible { outline: 2px solid var(--o-accent-bright); outline-offset: 3px; }
.btn-submit:disabled { background: rgba(255,255,255,.10); color: #7E96A8; box-shadow: none; cursor: not-allowed; transform: none; }
.btn-submit.is-loading { pointer-events: none; opacity: .85; }

/* ── Google ── */
.oauth-divider { display: flex; align-items: center; gap: 14px; margin: 22px 0 16px; font-size: 10px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: #7E96A8; }
.oauth-divider::before, .oauth-divider::after { content: ''; flex: 1; height: 1px; background: rgba(255,255,255,.08); }
.btn-google {
  display: flex; align-items: center; justify-content: center; gap: 11px; width: 100%; min-height: 52px; border: 1px solid rgba(255,255,255,.10); border-radius: 999px;
  background: rgba(255,255,255,.04); font: 800 12px var(--a-sans); color: #F1F7FC; text-decoration: none; transition: border-color .2s, background .2s, transform .2s;
}
.btn-google:hover { border-color: rgba(255,255,255,.2); background: rgba(255,255,255,.07); transform: translateY(-1px); }
.btn-google:focus-visible { outline: 2px solid var(--o-accent-bright); outline-offset: 3px; }

/* ── Avisos ── */
.alert-error, .alert-ok {
  display: flex; align-items: flex-start; gap: 12px; margin-bottom: 20px; padding: 13px 15px; border-radius: 16px; font-size: 13px; font-weight: 600; line-height: 1.5;
}
.alert-error { background: rgba(255,224,221,.10); border: 1px solid rgba(255,138,128,.35); color: #FFC9C3; }
.alert-ok { background: rgba(221,245,232,.10); border: 1px solid rgba(94,214,150,.35); color: #B9F0D2; }
.alert-error svg, .alert-ok svg { flex: none; margin-top: 1px; }
.alert-error ul { margin: 0; padding-left: 16px; }

.sheet__foot { margin-top: 28px; padding-top: 16px; border-top: 1px solid rgba(255,255,255,.08); display: flex; justify-content: space-between; gap: 12px; font-size: 11.5px; font-weight: 600; color: var(--a-muted); }

/* ── Hoja única centrada (recuperar / restablecer) ── */
.stage--solo { grid-template-columns: 1fr; place-items: center; padding: 32px 18px; }
.stage--solo .sheet { width: 100%; max-width: 480px; padding: 44px 40px 34px; border-radius: 28px; overflow: hidden; }
.stage--solo .brandbar { position: absolute; top: 28px; left: clamp(20px, 4vw, 48px); }
.sheet__back { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; margin: 20px 0 0; }

/* ── Mobile ── */
@media (max-width: 820px) {
  .stage { grid-template-columns: 1fr; }
  .sheet { padding: 34px 22px 28px; }
  .stage--solo { padding: 84px 14px 28px; }
  .stage--solo .sheet { border-radius: 24px; padding: 34px 22px 26px; }
}
@media (max-width: 520px) {
  .sheet__title { font-size: 28px; }
}

@media (prefers-reduced-motion: reduce) {
  .stage__photo, .brandbar, .sheet { animation: none !important; }
  .btn-submit, .btn-google, .input-wrap input { transition: none; }
}
