/* =====================================================================
   AUTH — login y páginas de error (403/404/500). Páginas SIN shell.
   Port de dtc_theme_v2/css/pages/auth.css al markup plano de Flask.
   Requiere tokens.css + base.css.
   ===================================================================== */

body.auth-body {
  overflow: auto;
  background: var(--dtc-bg);
}

/* ---- Layout dividido (login): branding + formulario ---- */
.auth-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 100dvh;
}

.auth-brand {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: linear-gradient(145deg, #0f172a 0%, #1e3a8a 55%, #1d4ed8 100%);
  color: #fff;
  padding: 48px 56px;
}

.auth-brand::before {
  content: "";
  position: absolute;
  inset: -50%;
  pointer-events: none;
  background-image:
    radial-gradient(circle at 20% 80%, rgba(255, 255, 255, .07) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(255, 255, 255, .07) 0%, transparent 50%);
}

.auth-brand > * {
  position: relative;
  z-index: 1;
}

.ab-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 19px;
  font-weight: 800;
  letter-spacing: .01em;
}

.ab-logo .mark {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  background: rgba(255, 255, 255, .14);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .18);
}

.ab-head {
  margin-top: 54px;
  font-size: clamp(26px, 3vw, 38px);
  font-weight: 800;
  line-height: 1.18;
  letter-spacing: -.02em;
}

.ab-head span {
  color: #bfdbfe;
}

.ab-desc {
  margin-top: 14px;
  font-size: 15px;
  line-height: 1.7;
  color: rgba(255, 255, 255, .85);
  max-width: 420px;
}

.ab-ill {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px 0;
  min-height: 220px;
}

.ab-ill svg {
  width: 100%;
  max-width: 430px;
  height: auto;
  filter: drop-shadow(0 24px 48px rgba(0, 0, 0, .3));
}

.ab-feats {
  display: flex;
  gap: 22px;
  flex-wrap: wrap;
}

.ab-feat {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 650;
  color: rgba(255, 255, 255, .85);
}

.ab-feat svg {
  color: #93c5fd;
}

.ab-foot {
  margin-top: 26px;
  font-size: 11.5px;
  color: rgba(255, 255, 255, .55);
}

/* Logo del sitio (logo.png, igual que el sidebar). Azul sobre claro; en los
   fondos oscuros (marca, auth-center) se invierte a blanco. */
.auth-logo-img {
  height: 52px;
  width: auto;
  display: block;
}

.auth-brand .auth-logo-img {
  height: 84px;
}

.auth-brand .auth-logo-img,
.auth-center .auth-logo-img {
  filter: brightness(0) invert(1);
}

.auth-side {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--dtc-bg-grad);
  padding: 40px 28px;
  overflow-y: auto;
}

/* ---- Layout centrado (errores) ---- */
.auth-center {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  overflow-y: auto;
  background: linear-gradient(145deg, #0f172a 0%, #1e3a8a 55%, #1d4ed8 100%);
}

.auth-center .ac-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-bottom: 26px;
  color: #fff;
  font-size: 17px;
  font-weight: 800;
}

.auth-center .auth-foot {
  color: rgba(255, 255, 255, .55);
}

/* ---- Tarjeta de formulario ---- */
.auth-card {
  width: 100%;
  max-width: 430px;
  background: var(--dtc-surface);
  border: 1px solid var(--dtc-border-soft);
  border-radius: 18px;
  box-shadow: 0 16px 50px rgba(15, 23, 42, .16);
  padding: 36px;
}

.auth-mobile-logo {
  display: none;
}

.auth-card h1,
.auth-card h2 {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -.02em;
}

.auth-card .sub {
  font-size: 13.5px;
  color: var(--dtc-muted);
  margin-top: 5px;
  line-height: 1.5;
}

.auth-card .field {
  margin-top: 18px;
}

.auth-card .field label {
  display: block;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--dtc-muted);
  margin-bottom: 6px;
}

.auth-card input[type="text"],
.auth-card input[type="email"],
.auth-card input[type="password"] {
  width: 100%;
  padding: 11px 13px;
  font-size: 14px;
  color: var(--dtc-text);
  background: var(--dtc-surface2);
  border: 1.5px solid var(--dtc-border);
  border-radius: 11px;
  transition: border-color var(--dtc-tr), box-shadow var(--dtc-tr), background var(--dtc-tr);
}

.auth-card input[type="text"]:focus,
.auth-card input[type="email"]:focus,
.auth-card input[type="password"]:focus {
  outline: none;
  background: var(--dtc-surface);
  border-color: var(--dtc-primary);
  box-shadow: 0 0 0 4px var(--dtc-primary-soft);
}

.auth-card input::placeholder {
  color: var(--dtc-faint);
}

.auth-card .description {
  font-size: 12px;
  color: var(--dtc-faint);
  margin-top: 5px;
  line-height: 1.5;
}

.auth-card .check {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--dtc-muted);
  cursor: pointer;
}

.auth-card input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--dtc-primary);
  cursor: pointer;
}

.auth-card .actions {
  margin-top: 22px;
}

.auth-card button[type="submit"],
.auth-card .btn-submit {
  width: 100%;
  padding: 12px 18px;
  font-size: 14.5px;
  font-weight: 700;
  color: #fff;
  border: 0;
  background: linear-gradient(135deg, var(--dtc-primary) 0%, var(--dtc-primary-strong) 100%);
  border-radius: 11px;
  box-shadow: 0 4px 14px rgba(37, 99, 235, .35);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform var(--dtc-tr), box-shadow var(--dtc-tr), opacity var(--dtc-tr);
}

.auth-card button[type="submit"]:hover,
.auth-card .btn-submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(37, 99, 235, .45);
}

.auth-card button[type="submit"]:active,
.auth-card .btn-submit:active {
  transform: translateY(0);
}

.auth-card a {
  color: var(--dtc-primary);
  font-weight: 650;
}

.auth-card a:hover {
  text-decoration: underline;
}

.af-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.af-link {
  font-size: 13px;
  font-weight: 650;
  color: var(--dtc-primary);
}

.af-link:hover {
  text-decoration: underline;
}

/* Mensajes (error / ok / aviso) */
.auth-card .msg {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  margin-top: 18px;
  padding: 11px 13px;
  border-radius: 11px;
  font-size: 13px;
  line-height: 1.5;
  border: 1px solid transparent;
}

.auth-card .msg svg {
  flex: none;
  margin-top: 1px;
}

.auth-card .msg--error {
  background: var(--dtc-danger-soft);
  border-color: var(--dtc-danger-border);
  color: var(--dtc-danger-text);
}

.auth-card .msg--status {
  background: var(--dtc-success-soft);
  border-color: var(--dtc-success-border);
  color: var(--dtc-success-text);
}

.auth-card .msg--warning {
  background: var(--dtc-warning-soft);
  border-color: var(--dtc-warning-border);
  color: var(--dtc-warning-text);
}

.auth-note {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--dtc-border-soft);
  font-size: 11.5px;
  color: var(--dtc-faint);
  line-height: 1.6;
}

.auth-note b {
  color: var(--dtc-muted);
}

.auth-foot {
  margin-top: 22px;
  font-size: 11.5px;
  color: var(--dtc-faint);
  text-align: center;
}

/* ---- Página de error (403/404/500) ---- */
.err-card {
  width: 100%;
  max-width: 520px;
  background: var(--dtc-surface);
  border: 1px solid var(--dtc-border-soft);
  border-radius: 18px;
  box-shadow: 0 16px 50px rgba(15, 23, 42, .16);
  padding: 42px 38px;
  text-align: center;
}

.err-code {
  font-size: 64px;
  font-weight: 800;
  letter-spacing: -.04em;
  line-height: 1;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.err-card .ico {
  width: 74px;
  height: 74px;
  border-radius: 20px;
  margin: 0 auto 18px;
  background: var(--dtc-primary-soft);
  color: var(--dtc-primary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.err-card h1 {
  font-size: 21px;
  font-weight: 800;
  margin-top: 12px;
}

.err-card .sub {
  font-size: 13.5px;
  color: var(--dtc-muted);
  margin-top: 8px;
  line-height: 1.6;
}

.err-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 24px;
  flex-wrap: wrap;
}

.err-actions .btn-pri {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  font-size: 13.5px;
  font-weight: 700;
  color: #fff;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--dtc-primary) 0%, var(--dtc-primary-strong) 100%);
  box-shadow: 0 4px 14px rgba(37, 99, 235, .35);
}

.err-actions .btn-sec {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--dtc-text);
  border: 1.5px solid var(--dtc-border);
  border-radius: 10px;
  background: var(--dtc-surface);
}

.err-actions .btn-sec:hover {
  border-color: var(--dtc-primary);
  color: var(--dtc-primary);
}

/* ---- Responsive ---- */
@media (max-width: 900px) {
  .auth-split {
    grid-template-columns: 1fr;
  }

  .auth-brand {
    display: none;
  }

  .auth-mobile-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    margin-bottom: 22px;
    font-size: 16px;
    font-weight: 800;
    color: var(--dtc-text);
  }
}

@media (max-width: 480px) {
  .auth-card,
  .err-card {
    padding: 26px 20px;
    border-radius: 14px;
  }
}
