/* ═══════════════════════════════════════════════════════════════════════════
   AFRODECIBELS — auth.css
   Pages Connexion & Inscription — Design premium split-screen
   ═══════════════════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;800;900&family=Playfair+Display:wght@700;900&display=swap');

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

:root {
  --orange:      #F47920;
  --orange2:     #FF9A3C;
  --orange-dark: #c85e00;
  --brown:       #4a2000;
  --brown2:      #6b3300;
  --bg:          #fdf6ee;
  --border:      #e8c9a8;
  --text:        #1a0e00;
  --muted:       #9a7055;
}

html, body {
  height: 100%;
  font-family: 'Nunito', sans-serif;
  background: var(--bg);
  color: var(--text);
}

/* ── LAYOUT SPLIT-SCREEN ───────────────────────────────────────────────────── */
.auth-page {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 100vh;
}

/* ── PANNEAU GAUCHE ────────────────────────────────────────────────────────── */
.auth-panel-left {
  position: relative;
  overflow: hidden;
  background: var(--brown);
}

.auth-panel-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 20%, rgba(244,121,32,.35) 0%, transparent 55%),
    radial-gradient(ellipse at 80% 80%, rgba(200,94,0,.25) 0%, transparent 55%),
    linear-gradient(145deg, #3a1800 0%, #4a2000 40%, #5c2800 70%, #3a1800 100%);
}

/* Texture de points décorative */
.auth-panel-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255,255,255,.05) 1px, transparent 1px);
  background-size: 24px 24px;
}

.auth-panel-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 40px 48px;
}

/* Logo marque */
.auth-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  margin-bottom: auto;
}

.auth-brand-icon {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--orange), var(--orange-dark));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  box-shadow: 0 6px 24px rgba(244,121,32,.45);
  flex-shrink: 0;
}

.auth-brand-name {
  display: block;
  font-size: 22px;
  font-weight: 900;
  color: white;
  line-height: 1.1;
  letter-spacing: -.02em;
}

.auth-brand-tagline {
  display: block;
  font-size: 11px;
  color: rgba(255,255,255,.55);
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  margin-top: 2px;
}

/* Headline */
.auth-headline {
  margin: 48px 0 32px;
}

.auth-headline h1 {
  font-family: 'Playfair Display', serif;
  font-size: 36px;
  font-weight: 900;
  color: white;
  line-height: 1.15;
  margin-bottom: 14px;
}

.auth-headline h1 em {
  color: var(--orange2);
  font-style: normal;
}

.auth-headline p {
  font-size: 14px;
  color: rgba(255,255,255,.6);
  line-height: 1.7;
  font-weight: 600;
}

/* Features list */
.auth-features {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 40px;
}

.auth-feature {
  display: flex;
  align-items: center;
  gap: 14px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 14px;
  padding: 14px 16px;
  backdrop-filter: blur(4px);
}

.af-icon {
  font-size: 22px;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  background: rgba(244,121,32,.2);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-feature strong {
  display: block;
  font-size: 13px;
  font-weight: 800;
  color: white;
  margin-bottom: 2px;
}

.auth-feature span {
  font-size: 11.5px;
  color: rgba(255,255,255,.5);
  font-weight: 600;
}

/* Équaliseur animé */
.auth-equalizer {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 36px;
  margin-top: auto;
}

.aeq-bar {
  width: 5px;
  border-radius: 3px;
  background: linear-gradient(to top, var(--orange), var(--orange2));
  animation: aeq 1.2s ease-in-out infinite alternate;
  opacity: .7;
}

.aeq-bar:nth-child(odd)  { animation-duration: 0.9s; }
.aeq-bar:nth-child(3n)   { animation-duration: 1.5s; }
.aeq-bar:nth-child(4n)   { animation-duration: 0.7s; }

@keyframes aeq {
  from { height: 6px; }
  to   { height: 32px; }
}

/* ── PANNEAU DROIT ─────────────────────────────────────────────────────────── */
.auth-panel-right {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 32px;
  background: white;
  overflow-y: auto;
}

.auth-form-wrap {
  width: 100%;
  max-width: 420px;
}

/* Logo mobile */
.auth-logo-mobile {
  display: none;
  align-items: center;
  gap: 8px;
  font-size: 20px;
  font-weight: 900;
  color: var(--brown);
  text-decoration: none;
  margin-bottom: 28px;
}

/* ── CARD FORMULAIRE ───────────────────────────────────────────────────────── */
.auth-card {
  width: 100%;
}

.auth-title {
  font-family: 'Playfair Display', serif;
  font-size: 30px;
  font-weight: 900;
  color: var(--brown);
  margin-bottom: 6px;
  letter-spacing: -.02em;
}

.auth-sub {
  font-size: 14px;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 28px;
}

/* ── GROUPES TYPE SELECTOR ─────────────────────────────────────────────────── */
.auth-type-selector {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 22px;
}

.type-option {
  position: relative;
}

.type-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.type-option label {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 12px 8px;
  border: 2px solid var(--border);
  border-radius: 14px;
  cursor: pointer;
  transition: all .15s;
  background: var(--bg);
  text-align: center;
}

.type-option label:hover {
  border-color: var(--orange);
  background: rgba(244,121,32,.04);
}

.type-option input:checked + label {
  border-color: var(--orange);
  background: rgba(244,121,32,.08);
  box-shadow: 0 0 0 3px rgba(244,121,32,.15);
}

.type-icon {
  font-size: 22px;
}

.type-name {
  font-size: 12px;
  font-weight: 800;
  color: var(--brown);
}

.type-desc {
  font-size: 10px;
  color: var(--muted);
  font-weight: 600;
}

/* ── CHAMPS DE FORMULAIRE ──────────────────────────────────────────────────── */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.auth-form .form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.auth-form label {
  font-size: 13px;
  font-weight: 800;
  color: var(--brown);
  display: flex;
  align-items: center;
  gap: 6px;
}

.auth-form label .lbl-icon {
  font-size: 14px;
}

.auth-form input,
.auth-form select {
  width: 100%;
  padding: 13px 16px;
  border: 2px solid var(--border);
  border-radius: 12px;
  font-family: 'Nunito', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  background: #fdf8f4;
  transition: all .2s;
  outline: none;
  appearance: none;
}

.auth-form input:focus,
.auth-form select:focus {
  border-color: var(--orange);
  background: white;
  box-shadow: 0 0 0 4px rgba(244,121,32,.1);
}

.auth-form input::placeholder {
  color: #c8a88a;
  font-weight: 600;
}

/* Input avec icône */
.input-wrapper {
  position: relative;
}

.input-wrapper .input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 15px;
  pointer-events: none;
  color: var(--muted);
}

.input-wrapper input {
  padding-left: 42px;
}

/* Toggle mot de passe */
.input-wrapper .pwd-toggle {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  font-size: 15px;
  color: var(--muted);
  padding: 4px;
}

/* Barre de force mot de passe */
.pwd-strength {
  display: flex;
  gap: 4px;
  margin-top: 6px;
}

.pwd-bar {
  flex: 1;
  height: 3px;
  border-radius: 2px;
  background: var(--border);
  transition: background .3s;
}

.pwd-bar.active-weak   { background: #c84b2f; }
.pwd-bar.active-medium { background: #c8a000; }
.pwd-bar.active-strong { background: #2a8a5c; }

/* ── BOUTON SUBMIT ─────────────────────────────────────────────────────────── */
.auth-submit {
  width: 100%;
  padding: 15px;
  background: linear-gradient(135deg, var(--orange) 0%, var(--orange-dark) 100%);
  color: white;
  border: none;
  border-radius: 14px;
  font-family: 'Nunito', sans-serif;
  font-size: 15px;
  font-weight: 900;
  cursor: pointer;
  transition: all .2s;
  box-shadow: 0 6px 24px rgba(244,121,32,.4);
  letter-spacing: .02em;
  margin-top: 4px;
  position: relative;
  overflow: hidden;
}

.auth-submit::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,.12) 0%, transparent 50%);
}

.auth-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(244,121,32,.5);
}

.auth-submit:active {
  transform: translateY(0);
}

/* ── DIVIDER ───────────────────────────────────────────────────────────────── */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ── SWITCH LINK ───────────────────────────────────────────────────────────── */
.auth-switch {
  text-align: center;
  font-size: 13.5px;
  color: var(--muted);
  font-weight: 700;
  margin-top: 20px;
}

.auth-switch a {
  color: var(--orange);
  font-weight: 800;
  text-decoration: none;
  transition: color .15s;
}

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

/* ── ALERTES ───────────────────────────────────────────────────────────────── */
.auth-flash {
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.auth-flash::before { font-size: 16px; }

.auth-flash-success {
  background: #d4f4e2;
  color: #1a6b3a;
  border: 1.5px solid #a8e6c0;
}
.auth-flash-success::before { content: '✅'; }

.auth-flash-error {
  background: #fde8e0;
  color: #a83020;
  border: 1.5px solid #f5b8a8;
}
.auth-flash-error::before { content: '❌'; }

.alert-error {
  background: #fde8e0;
  color: #a83020;
  border: 1.5px solid #f5b8a8;
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 16px;
}

.alert-error p { margin: 2px 0; }

/* ── CGU ───────────────────────────────────────────────────────────────────── */
.auth-cgu {
  font-size: 11.5px;
  color: var(--muted);
  text-align: center;
  line-height: 1.7;
  margin-top: 12px;
}

.auth-cgu a {
  color: var(--orange);
  font-weight: 700;
  text-decoration: none;
}

/* ═══════════════════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════════════════ */

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

  .auth-panel-left {
    display: none;
  }

  .auth-panel-right {
    min-height: 100vh;
    padding: 32px 24px;
  }

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

  .auth-title { font-size: 26px; }
}

/* Mobile ≤ 480px */
@media (max-width: 480px) {
  .auth-panel-right { padding: 24px 16px; }
  .auth-type-selector { grid-template-columns: 1fr 1fr; }
  .auth-title { font-size: 24px; }
  .auth-submit { font-size: 14px; padding: 14px; }
}

/* Type account label */
.auth-type-label {
  font-size: 13px;
  font-weight: 800;
  color: var(--brown);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   AUTH — DARK MODE
   ═══════════════════════════════════════════════════════════════════════════ */
[data-theme="dark"] .auth-page { background: #0f0d0b; }
[data-theme="dark"] .auth-panel-left .auth-panel-bg {
  background:
    radial-gradient(ellipse at 20% 20%, rgba(255,154,60,.3) 0%, transparent 55%),
    radial-gradient(ellipse at 80% 80%, rgba(200,94,0,.2) 0%, transparent 55%),
    linear-gradient(145deg, #0a0806 0%, #1a0a00 40%, #2a1200 70%, #0a0806 100%);
}
[data-theme="dark"] .auth-panel-right { background: #0f0d0b; }
[data-theme="dark"] .auth-logo-mobile { color: #FFD4A0; }
[data-theme="dark"] .auth-title { color: #FFD4A0; }
[data-theme="dark"] .auth-sub { color: rgba(255,255,255,.4); }
[data-theme="dark"] .auth-form input,
[data-theme="dark"] .auth-form select {
  background: #1e1a15;
  border-color: rgba(255,255,255,.1);
  color: rgba(255,255,255,.85);
}
[data-theme="dark"] .auth-form input:focus,
[data-theme="dark"] .auth-form select:focus {
  background: #252018;
  border-color: #FF9A3C;
}
[data-theme="dark"] .auth-form input::placeholder { color: rgba(255,255,255,.25); }
[data-theme="dark"] .auth-form label { color: #FFD4A0; }
[data-theme="dark"] .type-option label {
  background: #1e1a15;
  border-color: rgba(255,255,255,.1);
}
[data-theme="dark"] .type-option label:hover {
  border-color: #FF9A3C;
  background: rgba(255,154,60,.08);
}
[data-theme="dark"] .type-option input:checked + label {
  border-color: #FF9A3C;
  background: rgba(255,154,60,.12);
}
[data-theme="dark"] .type-name { color: #FFD4A0; }
[data-theme="dark"] .type-desc { color: rgba(255,255,255,.35); }
[data-theme="dark"] .auth-divider { color: rgba(255,255,255,.3); }
[data-theme="dark"] .auth-divider::before,
[data-theme="dark"] .auth-divider::after { background: rgba(255,255,255,.1); }
[data-theme="dark"] .auth-switch { color: rgba(255,255,255,.4); }
[data-theme="dark"] .auth-switch a { color: #FF9A3C; }
[data-theme="dark"] .auth-cgu { color: rgba(255,255,255,.3); }
[data-theme="dark"] .auth-cgu a { color: #FF9A3C; }
[data-theme="dark"] .alert-error {
  background: #2b0f0a;
  color: #f87171;
  border-color: #4a1a10;
}
[data-theme="dark"] .pwd-bar { background: rgba(255,255,255,.1); }
[data-theme="dark"] .auth-type-label { color: #FFD4A0; }
