/* Autenticación — login, recuperación de contraseña e indicador de sesión.
   Reutiliza los tokens y el layout .connect de app.css para mantener la línea gráfica. */

/* ───────── Pantalla de login ───────── */
.auth-panel { gap: 18px; }
.auth-panel .connect-title { margin-top: 12px; }
.auth-panel .connect-lede { font-size: 17px; }
.auth-panel .banner { margin: 0; width: 100%; max-width: 400px; }

.auth-form { display: grid; gap: 16px; width: 100%; max-width: 400px; margin-top: 4px; }
.auth-field { display: grid; gap: 6px; font-size: 14px; font-weight: 600; color: var(--ink-2); }
.auth-field input {
  height: 48px; width: 100%; padding: 0 14px;
  border: 1px solid var(--line-strong); border-radius: var(--r-inner); background: var(--surface);
  font-size: 16px; font-weight: 400; color: var(--ink); /* 16px evita el zoom automático en iOS */
  transition: border-color .15s, box-shadow .15s;
}
.auth-field input:hover { border-color: var(--faint); }
.auth-field input:focus { outline: none; border-color: var(--secondary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--secondary) 16%, transparent); }

.auth-submit { width: 100%; justify-content: center; margin-top: 4px; }
.auth-submit:disabled { opacity: .75; cursor: progress; }

.auth-link {
  justify-self: start; border: 0; background: none; padding: 2px 0; cursor: pointer;
  color: var(--secondary); font-size: 14px; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: color-mix(in srgb, var(--secondary) 35%, transparent);
}
.auth-link:hover { text-decoration-color: currentColor; }

.banner--ok { background: var(--up-bg); border-color: #BFE0CC; color: #155A39; }
.spinner--light { width: 16px; height: 16px; border-color: rgba(255, 255, 255, .35); border-top-color: #fff; }

/* ───────── Indicador de sesión (barra superior) ───────── */
.session-chip {
  display: inline-flex; align-items: center; gap: 4px; min-width: 0;
  height: 38px; padding: 0 4px 0 14px; margin-left: 4px;
  border: 1px solid var(--line); border-radius: var(--r-pill); background: var(--surface);
}
.session-email { font-size: 13px; color: var(--muted); max-width: 22ch; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.session-signout {
  display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px;
  border: 0; border-radius: var(--r-pill); background: var(--surface-2); color: var(--ink-2);
  font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.session-signout:hover { background: color-mix(in srgb, var(--primary) 9%, #fff); color: var(--primary); }
.session-signout:disabled { opacity: .6; cursor: progress; }

/* Pantallas sin barra superior (p. ej. "Conectar con Meta"): indicador flotante */
#session-float { position: fixed; top: 16px; right: var(--gutter); z-index: 30; }
#session-float .session-chip { box-shadow: var(--shadow); margin: 0; }
body:has(#app .topbar) #session-float,
body:has(#app .auth-screen) #session-float { display: none; }

/* ───────── Responsive ───────── */
@media (max-width: 1100px) {
  .session-email { max-width: 16ch; }
}
@media (max-width: 900px) {
  .auth-panel { align-items: stretch; max-width: 520px; width: 100%; margin: 0 auto; }
  .auth-panel .banner, .auth-form { max-width: none; }
}
@media (max-width: 640px) {
  .session-chip { flex: 1 1 100%; justify-content: space-between; margin-left: 0; }
  .session-email { max-width: none; flex: 1; }
  #session-float { top: auto; bottom: 16px; left: var(--gutter); right: var(--gutter); }
  #session-float .session-chip { width: 100%; }
  body:has(#session-float) .connect { padding-bottom: 72px; }
}

@media print {
  .session-chip, #session-float { display: none !important; }
}
