/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #03030C;
  --bg-2: #07071A;
  --bg-3: #0D0D22;
  --surface: rgba(255,255,255,.06);
  --surface-h: rgba(255,255,255,.10);
  --border: rgba(255,255,255,.10);
  --border-h: rgba(255,255,255,.22);
  --indigo: #6366F1;
  --violet: #8B5CF6;
  --cyan: #22D3EE;
  --green: #34D399;
  --amber: #FBBF24;
  --red: #F87171;
  --t1: #FFFFFF;
  --t2: rgba(255,255,255,.80);
  --t3: rgba(255,255,255,.55);
  --t4: rgba(255,255,255,.30);
  --grad: linear-gradient(135deg,#6366F1 0%,#8B5CF6 55%,#22D3EE 100%);
  --grad-t: linear-gradient(135deg,#A5B4FC 0%,#C4B5FD 50%,#67E8F9 100%);
  /* Legacy aliases */
  --blue: #6366F1;
  --purple: #6366F1;
  --blue-dark: #4F46E5;
  --blue-light: rgba(99,102,241,.12);
  --brand-gradient: var(--grad);
  --slate-900: #FFFFFF;
  --slate-700: rgba(255,255,255,.72);
  --slate-500: rgba(255,255,255,.42);
  --slate-300: rgba(255,255,255,.38);
  --slate-200: rgba(255,255,255,.22);
  --slate-100: rgba(255,255,255,.10);
  --slate-50: rgba(255,255,255,.06);
  --white: #ffffff;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.3);
  --shadow: 0 4px 16px rgba(0,0,0,.4);
  --shadow-lg: 0 8px 32px rgba(0,0,0,.4);
  --shadow-xl: 0 16px 48px rgba(0,0,0,.5);
}

html { font-size: 16px; -webkit-font-smoothing: antialiased; }
body { font-family: 'Inter', -apple-system, sans-serif; color: var(--t1); background: var(--bg-2); line-height: 1.6; }

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

.auth-left {
  background: var(--bg);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
}
.auth-left::before {
  content: '';
  position: absolute;
  top: -40%; right: -30%;
  width: 700px; height: 700px;
  background: radial-gradient(circle, rgba(99,102,241,.15) 0%, transparent 70%);
  pointer-events: none;
}
.auth-left::after {
  content: '';
  position: absolute;
  bottom: -20%; left: -20%;
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(139,92,246,.1) 0%, transparent 70%);
  pointer-events: none;
}
.auth-left-inner { position: relative; z-index: 1; padding: 60px 56px; width: 100%; }

/* Brand */
.brand { display: flex; align-items: center; gap: 14px; margin-bottom: 56px; }
.brand-logo { display: flex; align-items: center; gap: 12px; }
.brand-name { font-size: 1.5rem; font-weight: 800; color: var(--t1); letter-spacing: -0.02em; }
.brand-logo .brand-icon { width: 46px; height: 46px; border-radius: 13px; font-size: 1.4rem; }
.brand-badge {
  background: rgba(99,102,241,.15);
  border: 1px solid rgba(165,180,252,.2);
  color: #A5B4FC;
  font-size: 0.7rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.08em;
  padding: 4px 10px; border-radius: 100px;
}

/* Hero text */
.hero-text { margin-bottom: 48px; }
.hero-text h1 { font-size: 2.4rem; font-weight: 800; color: var(--t1); line-height: 1.2; letter-spacing: -0.03em; margin-bottom: 16px; }
.gradient-text { background: var(--grad-t); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.hero-text p { color: var(--t3); font-size: 1.05rem; line-height: 1.7; }

/* Features */
.features-list { display: flex; flex-direction: column; gap: 20px; margin-bottom: 48px; }
.feature-item { display: flex; align-items: flex-start; gap: 16px; }
.feature-icon {
  width: 42px; height: 42px;
  background: rgba(99,102,241,.12);
  border: 1px solid rgba(99,102,241,.25);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.feature-icon svg { stroke: #A5B4FC; }
.feature-item strong { display: block; color: var(--t1); font-size: 0.95rem; font-weight: 600; margin-bottom: 2px; }
.feature-item span { color: var(--t3); font-size: 0.85rem; }

/* Testimonial */
.testimonial {
  background: var(--surface);
  border: 1px solid var(--border-h);
  border-radius: 16px; padding: 24px 28px;
}
.testimonial p { color: var(--t2); font-size: 0.95rem; font-style: italic; line-height: 1.6; margin-bottom: 16px; }
.testimonial-author { display: flex; align-items: center; gap: 12px; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--grad); display: flex; align-items: center; justify-content: center; font-size: 0.75rem; font-weight: 700; color: #fff; flex-shrink: 0; }
.testimonial-author strong { display: block; color: var(--t1); font-size: 0.9rem; }
.testimonial-author span { color: var(--t3); font-size: 0.8rem; }

/* Login stats */
.login-stats { display: flex; gap: 32px; margin-top: 48px; }
.stat strong { display: block; font-size: 1.6rem; font-weight: 800; color: var(--t1); }
.stat span { color: var(--t3); font-size: 0.8rem; }

/* Right panel */
.auth-right {
  background: var(--bg-2);
  display: flex; align-items: center; justify-content: center;
  padding: 40px;
}
.auth-form-container { width: 100%; max-width: 440px; }
.form-header { margin-bottom: 32px; }
.form-header h2 { font-size: 1.75rem; font-weight: 800; color: var(--t1); letter-spacing: -0.02em; margin-bottom: 6px; }
.form-header p { color: var(--t3); font-size: 0.95rem; }

/* Google button */
.btn-google {
  width: 100%; display: flex; align-items: center; justify-content: center; gap: 12px;
  padding: 13px 20px;
  background: var(--surface);
  border: 1.5px solid var(--border-h);
  border-radius: var(--radius);
  font-family: 'Inter', sans-serif; font-size: 0.95rem; font-weight: 600;
  color: var(--t2); cursor: pointer; transition: all .15s ease;
}
.btn-google:hover { background: var(--surface-h); border-color: rgba(255,255,255,.22); color: var(--t1); }

/* Divider */
.divider {
  display: flex; align-items: center; gap: 16px; margin: 24px 0;
  color: var(--t4); font-size: 0.85rem;
}
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }

/* Form groups */
.form-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

label {
  font-size: 0.875rem; font-weight: 600; color: var(--t3);
  display: flex; justify-content: space-between; align-items: center;
}
label .label-link { font-weight: 400; }

input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
input[type="url"],
input[type="number"],
input[type="date"],
select,
textarea {
  padding: 11px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  color: var(--t1);
  background: var(--surface);
  transition: border-color .15s, box-shadow .15s;
  outline: none;
  width: 100%;
}
input:focus, select:focus, textarea:focus {
  border-color: rgba(99,102,241,.6);
  box-shadow: 0 0 0 3px rgba(99,102,241,.12);
  background: rgba(99,102,241,.04);
}
input::placeholder { color: var(--t4); }
input.error { border-color: var(--red); }
input.error:focus { box-shadow: 0 0 0 3px rgba(248,113,113,.1); }
textarea { resize: vertical; min-height: 80px; }
select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236366F1' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px;
}
select option { background: #08081E; color: #fff; }

.field-hint { font-size: 0.775rem; color: var(--t4); margin-top: 2px; }
.required { color: var(--red); }

/* Password input */
.input-password { position: relative; }
.input-password input { padding-right: 44px; }
.toggle-pass {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer; color: var(--t4);
  padding: 4px; display: flex; align-items: center;
}
.toggle-pass:hover { color: var(--t2); }

/* Password strength */
.password-strength { margin: -8px 0 16px; display: flex; align-items: center; gap: 10px; }
.strength-bar { flex: 1; height: 4px; background: var(--border); border-radius: 100px; overflow: hidden; }
.strength-fill { height: 100%; border-radius: 100px; transition: width .3s, background .3s; width: 0; }
#strengthLabel { font-size: 0.775rem; color: var(--t3); white-space: nowrap; min-width: 60px; }

/* Checkbox */
.form-check { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 20px; }
.form-check input[type="checkbox"] { width: 17px; height: 17px; margin-top: 2px; accent-color: var(--indigo); cursor: pointer; flex-shrink: 0; }
.form-check label { font-size: 0.85rem; color: var(--t3); font-weight: 400; cursor: pointer; }

/* Buttons */
.btn-primary {
  width: 100%; padding: 13px 20px;
  background: var(--grad);
  color: #fff; border: none;
  border-radius: var(--radius);
  font-family: 'Inter', sans-serif; font-size: 0.95rem; font-weight: 600;
  cursor: pointer; transition: all .18s ease;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  box-shadow: 0 4px 20px rgba(99,102,241,.35);
}
.btn-primary:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 8px 32px rgba(99,102,241,.5); }
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-primary.btn-success { background: linear-gradient(135deg,#059669,#34D399); box-shadow: 0 4px 16px rgba(5,150,105,.3); }
.btn-primary.btn-success:hover:not(:disabled) { box-shadow: 0 8px 24px rgba(5,150,105,.4); }

.btn-secondary {
  padding: 11px 20px;
  background: var(--surface);
  color: var(--t2);
  border: 1.5px solid var(--border-h);
  border-radius: var(--radius);
  font-family: 'Inter', sans-serif; font-size: 0.9rem; font-weight: 600;
  cursor: pointer; transition: all .15s;
  display: flex; align-items: center; gap: 8px;
}
.btn-secondary:hover { background: var(--surface-h); border-color: rgba(255,255,255,.22); color: var(--t1); }

.btn-skip { background: none; border: none; color: var(--t4); font-size: 0.85rem; cursor: pointer; padding: 8px 12px; font-family: 'Inter', sans-serif; }
.btn-skip:hover { color: var(--t3); }

/* Loader */
.spin { animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.hidden { display: none !important; }

/* Error */
.form-error {
  background: rgba(248,113,113,.1);
  border: 1px solid rgba(248,113,113,.25);
  color: #FCA5A5;
  padding: 12px 16px; border-radius: var(--radius-sm);
  font-size: 0.875rem; margin-bottom: 16px;
}

/* Footer */
.form-footer { text-align: center; margin-top: 20px; font-size: 0.875rem; color: var(--t4); }
.link { color: #A5B4FC; text-decoration: none; font-weight: 500; }
.link:hover { text-decoration: underline; color: #C4B5FD; }

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
  .auth-page { grid-template-columns: 1fr; }
  .auth-left { display: none; }
  .auth-right { padding: 32px 20px; }
}

/* ===== SIDEBAR ACCORDÉON ===== */
.nav-group-btn {
  width: 100%; display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; background: none; border: none; border-radius: 8px;
  color: var(--t4); font-size: .82rem; font-weight: 600;
  cursor: pointer; font-family: inherit; text-align: left; transition: all .15s;
}
.nav-group-btn:hover { background: var(--surface-h); color: var(--t2); }
.nav-group-btn.open { color: var(--t1); background: var(--surface); }
.nav-group-icon { width: 18px; height: 18px; flex-shrink: 0; }
.nav-group-chevron { margin-left: auto; flex-shrink: 0; transition: transform .22s; }
.nav-group-btn.open .nav-group-chevron { transform: rotate(90deg); }

.nav-sub { overflow: hidden; max-height: 0; transition: max-height .28s ease; }
.nav-sub.open { max-height: 600px; }

.nav-sub-item {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 12px 7px 36px;
  color: var(--t4); font-size: .79rem; font-weight: 500;
  text-decoration: none; border-radius: 6px; transition: all .12s;
  position: relative; border-left: 2px solid transparent;
}
.nav-sub-item:hover { color: var(--t2); background: var(--surface); }
.nav-sub-item.active {
  color: #818CF8; background: rgba(99,102,241,.1); font-weight: 600;
  border-left: 2px solid var(--indigo); padding-left: 34px;
}
.nav-sub-item .si { flex-shrink: 0; stroke: currentColor; opacity: .6; }
.nav-sub-item.active .si { opacity: 1; stroke: #A5B4FC; }

.ws-ia-btn { color: #A5B4FC !important; }
.ws-ia-btn:hover, .ws-ia-btn.open { background: rgba(165,180,252,.08) !important; color: #C4B5FD !important; }
.ws-ia-badge {
  font-size: .62rem; background: rgba(165,180,252,.15);
  color: #A5B4FC; border-radius: 4px; padding: 1px 4px; margin-left: 2px;
}
.nav-sub-item.ws-ia-sub { color: rgba(255,255,255,.3); }
.nav-sub-item.ws-ia-sub:hover { color: #C4B5FD; background: rgba(165,180,252,.06); }
.nav-sub-item.ws-ia-sub.active { color: #A5B4FC; background: rgba(165,180,252,.1); }
