/* Clefkey — base.css */
/* Tokens clair / sombre : voir css/theme.css (chargé avant ce fichier). */

/* ── Reset ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  background: var(--bg-secondary);
}

body {
  font-family: 'Poppins', 'Inter', -apple-system, sans-serif;
  background: var(--bg-secondary);
  color: var(--text-primary);
  min-height: 100vh;
  min-height: 100dvh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }

.compat-banner {
  position: fixed;
  left: 1rem;
  right: 1rem;
  bottom: 1rem;
  z-index: 400;
  max-width: 560px;
  margin: 0 auto;
  padding: 1rem 1.15rem;
  background: var(--bg-secondary);
  border: 1px solid var(--error);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  color: var(--text-primary);
}

.compat-banner p {
  margin: 0;
  font-size: 0.9rem;
}

.compat-banner-hint {
  margin-top: 0.45rem !important;
  color: var(--text-secondary);
  font-size: 0.8rem !important;
}

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-light); }

/* ── Screens ───────────────────────────────────────────── */
.screen { display: none; min-height: 100vh; }
.screen.active { display: flex; animation: fadeIn 0.35s ease; }

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ── Auth ──────────────────────────────────────────────── */
#screen-auth {
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  padding-top: var(--safe-top);
  padding-bottom: var(--safe-bottom);
  box-sizing: border-box;
}

.auth-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.auth-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.5;
  animation: float 8s ease-in-out infinite;
}

.auth-orb-1 {
  width: 400px; height: 400px;
  background: var(--auth-orb-1);
  top: -10%; left: -5%;
}

.auth-orb-2 {
  width: 300px; height: 300px;
  background: var(--auth-orb-2);
  bottom: -5%; right: -5%;
  animation-delay: -3s;
}

.auth-orb-3 {
  width: 200px; height: 200px;
  background: var(--auth-orb-3);
  top: 50%; left: 60%;
  animation-delay: -5s;
}

@keyframes float {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(20px, -20px); }
}

.auth-container {
  width: 100%;
  max-width: 860px;
  padding: 1.5rem;
  position: relative;
  z-index: 1;
}

.auth-card {
  display: grid;
  grid-template-columns: minmax(220px, 0.9fr) minmax(0, 1.4fr);
  gap: 2rem;
  align-items: center;
  background: color-mix(in srgb, var(--bg-secondary) 92%, transparent);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 2rem 2.25rem;
  box-shadow: var(--shadow);
}

.auth-card-side {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1.5rem;
  height: 100%;
  padding-right: 0.5rem;
  border-right: 1px solid var(--border);
}

.auth-card-main {
  min-width: 0;
}

.auth-logo { text-align: left; margin-bottom: 0; display: flex; align-items: center; gap: 0.65rem; }

.auth-logo-mark {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
}

.auth-logo .auth-brand {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.55rem, 2.4vw, 1.85rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  background: none;
  -webkit-background-clip: unset;
  -webkit-text-fill-color: unset;
}

.auth-logo .lp-brand-dot {
  color: var(--accent);
}

.logo-shield {
  width: 56px; height: 56px;
  margin: 0 0 0.75rem;
  color: var(--accent-light);
  background: var(--accent-subtle);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
}

.logo-shield svg,
.logo-shield .lucide,
.logo-shield .brand-mark { width: 100%; height: 100%; object-fit: contain; }

.brand-mark {
  display: block;
  object-fit: contain;
}

.subtitle { color: var(--text-secondary); font-size: 0.875rem; margin-top: 0.35rem; }

.auth-tabs {
  display: flex;
  background: var(--bg-primary);
  border-radius: var(--radius-sm);
  padding: 4px;
  margin-bottom: 1.5rem;
  border: 1px solid var(--border);
}

.tab {
  flex: 1;
  padding: 0.6rem;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  border-radius: var(--radius-xs);
  transition: var(--transition);
  font-family: inherit;
}

.tab.active {
  background: var(--accent);
  color: white;
  box-shadow: 0 2px 8px var(--accent-glow);
}

.auth-form { display: flex; flex-direction: column; gap: 0.85rem; }

#form-login.auth-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem 1rem;
}

#form-login .btn-full,
#form-login .auth-forgot {
  grid-column: 1 / -1;
}

#form-register.auth-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem 1rem;
}

#form-register .form-group--span,
#form-register .form-group:has(#register-password),
#form-register .form-group:has(#register-password-confirm),
#form-register .btn-full {
  grid-column: 1 / -1;
}

/* ── Loading ───────────────────────────────────────────── */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: var(--loading-overlay);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 300;
  gap: 1rem;
}

.loading-overlay.hidden { display: none; }

.spinner {
  width: 44px; height: 44px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.loading-text { color: var(--text-secondary); font-size: 0.875rem; }

/* ── Forms ─────────────────────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: 0.4rem; }

