/* ============================================================
   G_panoram · login.css
   Diseño "dashboard corporativo" oscuro, dos paneles.
   Temas claro/oscuro con variables CSS; [data-theme] en <html>.
   ============================================================ */

/* ---------- Tema oscuro (default) ---------- */
:root,
:root[data-theme="dark"] {
  /* ----- Paleta de referencia (match con Codebase Memory UI) ----- */
  --bg-base: #0B0F12;        /* fondo general (negro casi puro, tinte teal) */
  --bg-panel: #122528;       /* panel izquierdo (form) y cards */
  --accent-emerald: #1E9E77; /* acento principal: links, hover, focus, resaltados */
  --gray-mid: #55585B;       /* texto secundario, bordes neutros, botón en reposo */
  --teal-muted: #6E8F94;     /* texto tenue/inactivo: subtítulos, placeholders, labels */

  /* ----- Variables semánticas (mapeadas a la paleta) ----- */
  --bg-page: var(--bg-base);
  --bg-form: var(--bg-panel);
  --bg-decor: var(--bg-base);            /* panel derecho */
  --text: #eef2fb;                       /* texto principal (claro, fuera de paleta) */
  --text-muted: var(--teal-muted);
  --text-faint: var(--teal-muted);
  --border: var(--gray-mid);
  --input-bg: var(--bg-base);
  /* borde de input = esmeralda tenue, para que no se lea como error */
  --input-border: color-mix(in srgb, var(--accent-emerald) 40%, transparent);
  --accent-link: var(--accent-emerald);  /* enlaces / palabra resaltada */
  --focus-ring: color-mix(in srgb, var(--accent-emerald) 30%, transparent);
  --btn-bg: var(--gray-mid);             /* "Iniciar sesión" en reposo */
  --btn-bg-hover: var(--accent-emerald); /* -> esmeralda en hover/focus */
  --btn-text: #f4f7ff;
  --outline-border: var(--gray-mid);
  --outline-text: #cdd6ea;
  --danger-bg: #351a20;
  --danger-border: #7a2c39;
  --danger-text: #ffb4bd;
}

/* ---------- Tema claro ---------- */
:root[data-theme="light"] {
  /* Fondos claros y textos oscuros NO cambian: solo el tono de acento. */
  --bg-page: #eef2f9;
  --bg-form: #ffffff;
  --bg-decor: #dde5f3;
  --text: #131a2a;
  --text-muted: #5a6379;
  --text-faint: #8b93a6;
  --border: #dce2ee;
  --input-bg: #f5f8fd;
  --input-border: #d3dbe9;
  --accent-link: var(--accent-emerald);  /* acento esmeralda (antes azul) */
  --focus-ring: color-mix(in srgb, var(--accent-emerald) 25%, transparent);
  --btn-bg: var(--gray-mid);              /* botón en reposo (neutro) */
  --btn-bg-hover: var(--accent-emerald);  /* -> esmeralda en hover/focus */
  --btn-text: #ffffff;
  --outline-border: #b7c1d6;
  --outline-text: #3a445c;
  --danger-bg: #fdeaec;
  --danger-border: #f3b6be;
  --danger-text: #b42334;
}

* { box-sizing: border-box; }

html, body { height: 100%; margin: 0; }

body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  background: var(--bg-page);
  -webkit-font-smoothing: antialiased;
}

/* ---------- Layout ---------- */
.layout {
  display: flex;
  min-height: 100vh;
}

.panel { display: flex; flex-direction: column; }

/* Panel izquierdo: formulario (~35%). */
.panel--form {
  flex: 0 0 35%;
  min-width: 380px;
  max-width: 560px;
  background: var(--bg-form);
  padding: 28px 52px;
}

/* Panel derecho: decorativo (~65%). */
.panel--decor {
  flex: 1 1 auto;
  background: var(--bg-decor);
  position: relative;
  overflow: hidden;
}

/* ---------- Topbar (logo texto + toggle) ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand { font-size: 20px; letter-spacing: 0.2px; color: var(--text); }
.brand__thin { font-weight: 400; }
.brand__bold { font-weight: 800; }

.theme-toggle {
  width: 38px;
  height: 38px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font-size: 17px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
}
.theme-toggle:hover { background: rgba(127, 145, 180, 0.12); }
.theme-toggle__icon { display: none; }
:root[data-theme="dark"] .theme-toggle__icon--sun { display: inline; }
:root[data-theme="light"] .theme-toggle__icon--moon { display: inline; }

/* ---------- Formulario (centrado verticalmente) ---------- */
.form-wrap {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 380px;
  width: 100%;
  margin: 0 auto;
  padding: 24px 0;
}

.title {
  font-size: 28px;
  font-weight: 700;
  margin: 0 0 8px;
}

.subtitle {
  color: var(--text-faint);
  margin: 0 0 30px;
  font-size: 14px;
}

.alert {
  background: var(--danger-bg);
  border: 1px solid var(--danger-border);
  color: var(--danger-text);
  border-radius: 8px;
  padding: 11px 13px;
  font-size: 14px;
  margin-bottom: 20px;
}

.field { margin-bottom: 20px; }

.field__labelrow {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.field__label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.field__link {
  font-size: 13px;
  color: var(--accent-link);
  text-decoration: none;
}
.field__link:hover { text-decoration: underline; }

.field__input {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  border-radius: 8px;
  border: 1px solid var(--input-border);
  background: var(--input-bg);
  color: var(--text);
  font-size: 15px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.field__input::placeholder { color: var(--text-faint); }
.field__input:focus {
  border-color: var(--accent-link);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

/* ---------- Campo con "ojito" para mostrar/ocultar contraseña ---------- */
.field__inputwrap { position: relative; }

/* Deja espacio a la derecha para que el texto no quede bajo el botón. */
.field__input--haspw { padding-right: 46px; }

.pw-toggle {
  position: absolute;
  top: 0;
  right: 0;
  height: 46px;              /* igual que .field__input */
  width: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--text-faint);
  cursor: pointer;
  transition: color 0.15s ease;
}
.pw-toggle:hover { color: var(--text-muted); }
.pw-toggle:focus-visible {
  outline: 2px solid var(--accent-link);
  outline-offset: -2px;
  border-radius: 8px;
}

.pw-toggle__icon { width: 20px; height: 20px; display: none; }
/* Por defecto (contraseña oculta) se ve el ojo abierto. */
.pw-toggle__icon--show { display: inline; }
/* Cuando está "presionado" (contraseña visible) se ve el ojo tachado. */
.pw-toggle[aria-pressed="true"] .pw-toggle__icon--show { display: none; }
.pw-toggle[aria-pressed="true"] .pw-toggle__icon--hide { display: inline; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
}

/* Primario: azul-gris medio, flat (sin sombra ni gradiente). */
.btn--primary {
  width: 100%;
  height: 48px;
  margin-top: 6px;
  background: var(--btn-bg);
  color: var(--btn-text);
}
.btn--primary:hover { background: var(--btn-bg-hover); }

/* Separador "o" entre login normal y login social. */
.divider {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 20px 0;
  color: var(--text-faint);
  font-size: 13px;
}
.divider::before,
.divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* Botón "Iniciar sesión con Google": estilo outline con logo a la izquierda. */
.btn--google {
  width: 100%;
  height: 48px;
  gap: 10px;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  color: var(--text);
}
.btn--google:hover { background: rgba(127, 145, 180, 0.1); }

/* En modo claro el fondo del botón se confunde con el panel blanco:
   damos fondo blanco puro y un borde más marcado para que se note la forma. */
:root[data-theme="light"] .btn--google {
  background: #ffffff;
  border-color: #c2ccdd;
  box-shadow: 0 1px 2px rgba(19, 26, 42, 0.06);
}
:root[data-theme="light"] .btn--google:hover {
  background: #f5f8fd;
  border-color: #aab6cc;
}

.btn__google-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* Secundario: solo borde (outline), decorativo. */
.btn--outline {
  height: 42px;
  padding: 0 22px;
  background: transparent;
  border: 1px solid var(--outline-border);
  color: var(--outline-text);
}
.btn--outline:hover { background: rgba(127, 145, 180, 0.1); }

/* ---------- Panel decorativo ---------- */
.decor-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.9;
  pointer-events: none;
}

.decor-content {
  position: relative;   /* sobre la imagen de fondo */
  margin-top: auto;     /* empuja el bloque a la parte inferior */
  max-width: 560px;
  padding: 56px;
  text-align: left;
}

.decor-headline {
  font-size: 34px;
  font-weight: 700;
  line-height: 1.25;
  margin: 0 0 16px;
  color: #ffffff;
}
:root[data-theme="light"] .decor-headline { color: var(--text); }

.decor-headline__accent { color: var(--accent-link); }

.decor-desc {
  color: #b8c1d6;
  font-size: 15px;
  line-height: 1.6;
  margin: 0 0 26px;
  max-width: 460px;
}
:root[data-theme="light"] .decor-desc { color: var(--text-muted); }

/* ---------- Responsive: oculta el panel decorativo en pantallas chicas ---------- */
@media (max-width: 880px) {
  .panel--decor { display: none; }
  .panel--form {
    flex: 1 1 auto;
    max-width: 100%;
    min-width: 0;
  }
}
