/* ===== Base ===== */
* { box-sizing: border-box; }
html, body { height: 100%; }
:root{
  --bg: #f6f7fb;
  --ink:#0f172a;
  --muted:#667085;
  --brand:#0f1f54;         /* azul institucional */
  --accent:#ffd54a;        /* dorado suave */
  --card:#ffffff;
  --line:#e6e8f0;
  --radius:16px;
  --shadow: 0 6px 20px rgba(15, 23, 42, .06);
  --focus: 0 0 0 3px rgba(79, 70, 229, .25);
}
@media (prefers-color-scheme: dark){
  :root{
    --bg:#0b1223;
    --ink:#e6eaff;
    --muted:#a3aed0;
    --card:#0f182d;
    --line:#1f2942;
    --shadow: 0 8px 24px rgba(0, 0, 0, .35);
    --focus: 0 0 0 3px rgba(156, 199, 255, .3);
  }
}

body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans";
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(15,31,84,.06), transparent 60%),
    radial-gradient(900px 500px at 100% 0%, rgba(255,213,74,.06), transparent 55%),
    linear-gradient(180deg, var(--bg), var(--bg));
}

/* Textura sutil de papel/dots */
.page{
  min-height: 100%;
  display: grid;
  place-items: center;
  
  background-image:
    radial-gradient(circle at 2px 2px, rgba(15,31,84,.06) 1px, transparent 1px);
  background-size: 12px 12px;
}

/* ===== Card ===== */
.card{
  width: min(440px, 92vw);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
}
.card-header{
  text-align: center;
  margin-bottom: 6px;
}
.logo{
  width: 219px; height: auto; display:block; margin: 0 auto 6px;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,.08));
}
h1{
  margin: 6px 0 0;
  font-size: 22px; font-weight: 700;
  letter-spacing: .2px;
}
.subtitle{
  margin: 6px 0 0;
  font-size: 13px; color: var(--muted);
}

/* ===== Form ===== */
.form{ display: grid; gap: 14px; margin-top: 14px; }
.field{ display: grid; gap: 6px; }
label{
  font-size: 13px; color: var(--muted);
}
input[type="text"],
input[type="password"]{
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
@media (prefers-color-scheme: dark){
  input[type="text"],
  input[type="password"]{
    background: #0c1529;
  }
}
input:focus{ box-shadow: var(--focus); border-color: transparent; }

/* Password + toggle */
.password-wrap{ position: relative; }
.toggle{
  position: absolute; top: 50%; right: 8px; transform: translateY(-50%);
  border: 0; background: transparent; cursor: pointer; padding: 6px;
  border-radius: 8px; color: #57607c;
}
.toggle:hover{ background: rgba(0,0,0,.04); }
.toggle svg{ width: 20px; height: 20px; fill: currentColor; }
.toggle .eye-off{ display:none; }
.toggle.on .eye{ display:none; }
.toggle.on .eye-off{ display:block; }

/* Actions */
.actions{
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 4px;
}
.remember{
  display: inline-flex; align-items: center; gap: 8px; font-size: 13px;
  color: var(--muted);
}
.remember input{
  width: 16px; height: 16px; border: 1px solid var(--line); border-radius: 4px;
  appearance: none; display: grid; place-items: center; background: #fff;
}
.remember input:checked{ background: linear-gradient(180deg, #ffd54a, #ffbd2b); border-color: transparent; }

.btn{
  appearance: none; border: none; cursor: pointer;
  background: linear-gradient(180deg, #ffd54a, #ffbd2b);
  color: #1f2433; font-weight: 700;
  padding: 10px 16px; border-radius: 12px;
  box-shadow: inset 0 -1px 0 rgba(0,0,0,.15);
  transition: filter .15s ease, transform .05s ease;
}
.btn:hover{ filter: brightness(1.03); }
.btn:active{ transform: translateY(1px); }

/* Mensajes de error (conservados) */
.error-auth,
.error-user{
  width: 100%;
  padding: 12px 14px;
  margin-top: 12px;
  border-radius: 12px;
  color: #fff;
  font-weight: 700;
  text-align: center;
}
.error-auth{ background: #e03131; }
.error-user{ background: #e8590c; }

/* Footer meta */
.meta{
  margin-top: 16px; text-align: center;
  color: var(--muted);
}

/* Accesibilidad */
:focus-visible{
  outline: 3px solid rgba(99,102,241,.4);
  outline-offset: 2px;
  border-radius: 10px;
}
@media (prefers-reduced-motion: reduce){
  * { transition: none !important; }
}
