/* ============================================================
   Metria — Identity (login / registro / recuperación)
   Shell autónomo, sin Bootstrap. Identidad Field Pro.
   Estila también las clases genéricas de las páginas del
   paquete Identity (form-control, btn, text-danger, etc.)
   ============================================================ */

:root {
  --bg:        #f0eeeb;
  --paper:     #faf9f7;
  --surface:   #ffffff;
  --border:    #dddad6;
  --border2:   #c8c4be;
  --text:      #1c1917;
  --text2:     #57534e;
  --text3:     #a8a29e;
  --dark:      #1c1917;
  --dark2:     #292524;
  --d-text:    #d6d3d1;
  --d-text2:   #a8a29e;
  --d-line:    rgba(255,255,255,.08);
  --accent:    #fbbf24;
  --accent-h:  #f59e0b;
  --green:     #15803d;
  --red:       #b91c1c;   --red-bg: #fef2f2;
  --r-sm: 6px; --r-md: 10px; --r-lg: 14px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body.auth-body {
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
svg { display: block; }

/* ---------- Split shell ---------- */
.auth-shell { display: grid; grid-template-columns: minmax(0, 440px) 1fr; min-height: 100vh; }

/* Panel de marca (izquierda) */
.auth-brand {
  background: var(--dark); color: var(--d-text);
  padding: 44px 44px 40px; display: flex; flex-direction: column;
  position: relative; overflow: hidden;
}
.auth-brand::after {
  content: ""; position: absolute; right: -80px; bottom: -80px;
  width: 260px; height: 260px; border-radius: 50%;
  background: radial-gradient(circle, rgba(251,191,36,.14), transparent 70%);
}
.auth-brand .brand { display: flex; align-items: center; gap: 12px; z-index: 1; }
.auth-brand .brand-mark {
  width: 36px; height: 36px; border-radius: 8px; background: var(--accent);
  color: var(--dark); font-weight: 800; font-size: 19px; letter-spacing: -1px;
  display: flex; align-items: center; justify-content: center;
}
.auth-brand .brand-name { font-size: 20px; font-weight: 700; color: #fff; letter-spacing: -.4px; }

.auth-brand .brand-copy { margin-top: auto; z-index: 1; }
.auth-brand h2 { font-size: 26px; font-weight: 700; color: #fff; letter-spacing: -.6px;
  line-height: 1.2; margin-bottom: 12px; }
.auth-brand .lead { font-size: 14.5px; color: var(--d-text2); max-width: 30em; margin-bottom: 26px; }
.auth-brand ul { list-style: none; display: flex; flex-direction: column; gap: 12px; }
.auth-brand li { display: flex; align-items: flex-start; gap: 11px; font-size: 14px; color: var(--d-text); }
.auth-brand li svg { width: 18px; height: 18px; color: var(--accent); flex-shrink: 0; margin-top: 1px; }
.auth-brand .brand-foot { margin-top: 30px; font-size: 12px; color: var(--d-text2); z-index: 1; }

/* Área del formulario (derecha) */
.auth-main {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 40px 24px;
}
.auth-card {
  width: 100%; max-width: 400px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 36px 34px;
}
.auth-logo-mobile { display: none; align-items: center; gap: 10px; justify-content: center; margin-bottom: 22px; }
.auth-logo-mobile .brand-mark {
  width: 32px; height: 32px; border-radius: 7px; background: var(--accent);
  color: var(--dark); font-weight: 800; font-size: 17px; letter-spacing: -1px;
  display: flex; align-items: center; justify-content: center;
}
.auth-logo-mobile .brand-name { font-size: 18px; font-weight: 700; letter-spacing: -.4px; }

.auth-head { margin-bottom: 24px; }
.auth-head h1 { font-size: 23px; font-weight: 700; letter-spacing: -.5px; }
.auth-head p { font-size: 14px; color: var(--text2); margin-top: 6px; }
.auth-head p a { color: var(--accent-h); font-weight: 600; }
.auth-head p a:hover { text-decoration: underline; }

.auth-foot-copy { margin-top: 24px; font-size: 12px; color: var(--text3); text-align: center; }

/* ---------- Campos ---------- */
.auth-field { margin-bottom: 16px; }
.auth-field label, .form-label,
.form-floating > label { display: block; font-size: 13px; font-weight: 600;
  color: var(--text2); margin-bottom: 6px; }

.form-control, input[type="text"], input[type="email"], input[type="password"] {
  width: 100%; font-family: inherit; font-size: 14px; color: var(--text);
  background: var(--paper); border: 1px solid var(--border2);
  border-radius: var(--r-sm); padding: 11px 13px; transition: border-color .12s, box-shadow .12s;
}
.form-control::placeholder { color: var(--text3); }
.form-control:focus, input:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(251,191,36,.18); background: var(--surface);
}

/* Bootstrap form-floating del paquete → apilado label/input normal */
.form-floating { position: static; margin-bottom: 16px; }
.form-floating > label { position: static; padding: 0; transform: none; height: auto;
  pointer-events: auto; color: var(--text2); }
.form-floating > .form-control { height: auto; padding: 11px 13px; }
.form-floating > .form-control::placeholder { color: var(--text3); }

/* Checkbox recordarme */
.auth-check, .checkbox { display: flex; align-items: center; gap: 9px; margin-bottom: 18px;
  font-size: 13.5px; color: var(--text2); }
.auth-check input, .form-check-input { width: 16px; height: 16px; accent-color: var(--accent-h);
  cursor: pointer; }
.checkbox label { display: flex; align-items: center; gap: 9px; margin: 0; font-weight: 500;
  font-size: 13.5px; color: var(--text2); cursor: pointer; }

/* ---------- Botón ---------- */
.btn, button[type="submit"] {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: inherit; font-size: 14.5px; font-weight: 600; cursor: pointer;
  padding: 12px 18px; border-radius: var(--r-sm);
  border: 1px solid var(--accent); background: var(--accent); color: var(--dark);
  transition: background .12s, border-color .12s;
}
.btn:hover, button[type="submit"]:hover { background: var(--accent-h); border-color: var(--accent-h); }
.btn-primary { background: var(--accent); color: var(--dark); border-color: var(--accent); }
.w-100, .btn-block { width: 100%; }
.btn-lg { padding: 13px 20px; font-size: 15px; }

/* Botón secundario (acciones neutrales: "Quitar", cancelar, etc.) */
.btn-outline {
  background: var(--surface); color: var(--text); border: 1px solid var(--border2);
}
.btn-outline:hover { background: var(--paper); border-color: var(--text3); }

/* "Quitar" (desvincular proveedor) — neutral que vira a rojo al interactuar */
.btn-unlink:hover, .btn-unlink:focus-visible {
  color: var(--red); border-color: color-mix(in srgb, var(--red) 45%, var(--border2));
  background: var(--red-bg);
}

/* ---------- Botones de proveedor externo (branding sobrio) ---------- */
/* Superficie blanca elevación-0; la identidad la aporta el logo a color.
   Coherente con Metria: sin rellenos plenos, borde fino, foco ámbar. */
.btn-provider {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; font-family: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
  padding: 11px 16px; border-radius: var(--r-sm);
  background: var(--surface); color: var(--text); border: 1px solid var(--border2);
  transition: background .12s, border-color .12s, box-shadow .12s;
}
.btn-provider:hover { background: var(--paper); border-color: var(--text3); }
.btn-provider:focus-visible {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(251,191,36,.18);
}
.btn-provider:active { background: var(--bg); }
.btn-provider-icon { display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px; flex-shrink: 0; }
.btn-provider-icon svg { width: 18px; height: 18px; }
.btn-provider-label { line-height: 1; }

/* Matiz de marca sutil al pasar el mouse (sin romper la sobriedad) */
.btn-provider--google:hover    { border-color: color-mix(in srgb, #4285F4 55%, var(--border2)); }
.btn-provider--microsoft:hover { border-color: color-mix(in srgb, #0067b8 55%, var(--border2)); }
.btn-provider--facebook:hover  { border-color: color-mix(in srgb, #1877F2 55%, var(--border2)); }

/* Botonera de inicios externos en el login (apilada) */
.auth-external { display: flex; flex-direction: column; gap: 10px; }

/* ---------- Links y separador ---------- */
.auth-links { margin-top: 18px; display: flex; flex-direction: column; gap: 8px; text-align: center; }
.auth-links a, .auth-alt a { color: var(--accent-h); font-weight: 600; font-size: 13.5px; }
.auth-links a:hover, .auth-alt a:hover { text-decoration: underline; }
.auth-alt { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--border);
  text-align: center; font-size: 13.5px; color: var(--text2); }

.auth-sep { display: flex; align-items: center; gap: 12px; margin: 18px 0; color: var(--text3);
  font-size: 12px; }
.auth-sep::before, .auth-sep::after { content: ""; flex: 1; height: 1px; background: var(--border); }

/* ---------- Validación ---------- */
.text-danger, .field-validation-error { color: var(--red); font-size: 12.5px; display: block; margin-top: 5px; }
.validation-summary-errors, div[asp-validation-summary] { color: var(--red); font-size: 13px; }
.validation-summary-errors ul { list-style: none; padding: 0; }
[asp-validation-summary]:not(:empty), .validation-summary-errors:not(:empty) {
  background: var(--red-bg); border: 1px solid color-mix(in srgb, var(--red) 30%, transparent);
  border-radius: var(--r-sm); padding: 10px 12px; margin-bottom: 16px;
}

/* Ocultar bloques de "external login providers" que queden del paquete */
#external-account, section > h3 { }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-brand { display: none; }
  .auth-logo-mobile { display: flex; }
  .auth-main { padding: 32px 20px; }
  .auth-card { border: 1px solid var(--border); }
}
@media (max-width: 420px) {
  .auth-card { padding: 28px 22px; border-radius: var(--r-md); }
}
