/* ======================================================
   CAMPUSLAB — AUTH DESIGN ENTERPRISE
   Fichier : auth.css
   Pages   : login · reset-password · change-password
   ====================================================== */

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

/* ── Tokens ── */
:root {
  --brand:        #6777ef;
  --brand-dark:   #4f61d6;
  --brand-deeper: #3a4cbf;
  --teal:         #10cdb0;
  --teal-dark:    #0eb09a;
  --text:         #0f172a;
  --text-sub:     #475569;
  --text-muted:   #94a3b8;
  --border:       #e2e8f0;
  --surface:      #ffffff;
  --bg:           #f8fafc;
  --danger:       #ef4444;
  --success:      #22c55e;
  --warning:      #f59e0b;
  --radius:       10px;
  --ease:         cubic-bezier(.4,0,.2,1);
}

/* ── Layout root ── */
body.auth-page {
  font-family: 'Nunito', 'Segoe UI', system-ui, -apple-system, sans-serif;
  min-height: 100vh;
  display: flex;
  background: var(--surface);
  overflow-x: hidden;
  /* reset Stisla body overrides */
  background-color: var(--surface) !important;
  color: var(--text) !important;
  font-size: 15px !important;
}

/* ══════════════════════════════════════
   PANNEAU GAUCHE — Branding
══════════════════════════════════════ */
.auth-panel-left {
  flex: 0 0 42%;
  min-height: 100vh;
  background: linear-gradient(155deg, var(--brand) 0%, #5865d8 45%, #3d55c8 75%, var(--brand-deeper) 100%);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 48px 52px;
  position: relative;
  overflow: hidden;
}

/* Radial overlays */
.auth-panel-left::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 15% 85%, rgba(16,205,176,.22) 0%, transparent 45%),
    radial-gradient(circle at 85% 15%, rgba(255,255,255,.08) 0%, transparent 45%);
  pointer-events: none;
}

/* Grid pattern */
.auth-panel-left::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
}

/* Logo */
.auth-left-logo {
  position: relative;
  z-index: 1;
}

.auth-left-logo img {
  max-width: 200px;
  height: auto;
  filter: brightness(0) invert(1);
  opacity: .95;
}

/* Corps central */
.auth-left-body {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 60px 0 40px;
}

/* Tag pill animé */
.auth-left-tag {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: rgba(255,255,255,.15);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 999px;
  padding: 5px 14px;
  font-size: .75rem;
  font-weight: 700;
  color: rgba(255,255,255,.9);
  letter-spacing: .06em;
  text-transform: uppercase;
  margin-bottom: 24px;
  width: fit-content;
}

.auth-left-tag::before {
  content: '';
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--teal);
  animation: tag-pulse 2s ease infinite;
}

@keyframes tag-pulse {
  0%,100% { transform: scale(1); opacity: 1; }
  50%      { transform: scale(1.4); opacity: .6; }
}

.auth-left-headline {
  font-size: clamp(1.7rem, 3vw, 2.2rem);
  font-weight: 800;
  line-height: 1.2;
  color: #fff;
  letter-spacing: -.03em;
  margin-bottom: 16px;
}

.auth-left-headline span { color: var(--teal); }

.auth-left-sub {
  font-size: .97rem;
  color: rgba(255,255,255,.72);
  line-height: 1.65;
  max-width: 340px;
  margin-bottom: 40px;
}

/* Feature bullets */
.auth-features {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.auth-features li {
  display: flex;
  align-items: center;
  gap: 13px;
  font-size: .9rem;
  color: rgba(255,255,255,.82);
  font-weight: 600;
}

.auth-features li .feat-icon {
  flex-shrink: 0;
  width: 36px; height: 36px;
  border-radius: 9px;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.18);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .9rem;
  color: var(--teal);
}

/* Footer gauche */
.auth-left-footer {
  position: relative;
  z-index: 1;
  font-size: .78rem;
  color: rgba(255,255,255,.42);
}

/* ══════════════════════════════════════
   PANNEAU DROIT — Formulaire
══════════════════════════════════════ */
.auth-panel-right {
  flex: 1;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 40px;
  background: var(--surface);
  position: relative;
}

/* Ligne de séparation gauche */
.auth-panel-right::before {
  content: '';
  position: absolute;
  left: 0; top: 10%; bottom: 10%;
  width: 1px;
  background: linear-gradient(to bottom, transparent, var(--border), transparent);
}

.auth-form-box {
  width: 100%;
  max-width: 400px;
  animation: auth-in .4s var(--ease) both;
}

@keyframes auth-in {
  from { opacity:0; transform: translateY(16px); }
  to   { opacity:1; transform: translateY(0); }
}

/* Eyebrow + titre */
.auth-form-eyebrow {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--brand);
  margin-bottom: 10px;
}

.auth-form-title {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -.03em;
  line-height: 1.2;
  margin-bottom: 6px;
}

.auth-form-desc {
  font-size: .9rem;
  color: var(--text-sub);
  line-height: 1.6;
  margin-bottom: 32px;
}

/* ── Champs ── */
.auth-field {
  margin-bottom: 20px;
}

.auth-field-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 7px;
}

.auth-field label,
.auth-field .auth-field-header label {
  display: block;
  font-size: .8125rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 7px;
}

.auth-field .auth-field-header label { margin-bottom: 0; }

.auth-link {
  font-size: .8rem;
  font-weight: 600;
  color: var(--brand);
  text-decoration: none;
  transition: color .2s;
}
.auth-link:hover { color: var(--brand-dark); text-decoration: underline; }

/* Input wrapper */
.auth-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.auth-pre-icon {
  position: absolute;
  left: 14px;
  color: var(--text-muted);
  font-size: .85rem;
  pointer-events: none;
  z-index: 2;
  transition: color .2s;
}

.auth-input {
  width: 100%;
  height: 46px;
  padding: 0 14px 0 42px;
  font-family: 'Nunito', 'Segoe UI', system-ui, sans-serif;
  font-size: .9rem;
  color: var(--text);
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  outline: none;
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease), background .2s;
}

.auth-input::placeholder { color: var(--text-muted); }
.auth-input:hover { border-color: #cbd5e1; }
.auth-input:focus {
  border-color: var(--brand);
  background: var(--surface);
  box-shadow: 0 0 0 4px rgba(103,119,239,.13);
}

.auth-input-wrap:focus-within .auth-pre-icon { color: var(--brand); }

/* Toggle oeil */
.auth-eye {
  position: absolute;
  right: 13px;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 5px 7px;
  border-radius: 6px;
  font-size: .85rem;
  transition: color .2s, background .2s;
  z-index: 2;
  line-height: 1;
}

.auth-eye:hover { color: var(--brand); background: rgba(103,119,239,.08); }
.auth-input.has-eye { padding-right: 42px; }

/* ── Checkbox ── */
.auth-check-row {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 24px;
}

.auth-check-row input[type="checkbox"] {
  width: 17px; height: 17px;
  accent-color: var(--brand);
  cursor: pointer;
  flex-shrink: 0;
}

.auth-check-row label {
  font-size: .855rem;
  font-weight: 600;
  color: var(--text-sub);
  cursor: pointer;
  user-select: none;
}

/* ── Bouton ── */
.auth-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 48px;
  font-family: 'Nunito', 'Segoe UI', system-ui, sans-serif;
  font-size: .9375rem;
  font-weight: 700;
  color: #fff !important;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%);
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: transform .18s var(--ease), box-shadow .18s var(--ease);
  letter-spacing: .01em;
  position: relative;
  overflow: hidden;
}

.auth-btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--teal) 0%, var(--brand) 100%);
  opacity: 0;
  transition: opacity .3s var(--ease);
}

.auth-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(103,119,239,.38);
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%) !important;
  color: #fff !important;
}

.auth-btn:hover::after { opacity: 1; }
.auth-btn:active { transform: translateY(0); box-shadow: none; }
.auth-btn > * { position: relative; z-index: 1; }

.auth-btn:disabled {
  opacity: .58;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

/* Spinner */
.auth-spin {
  display: none;
  width: 18px; height: 18px;
  border: 2.5px solid rgba(255,255,255,.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .65s linear infinite;
}

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

.auth-btn.loading .auth-spin  { display: inline-block; }
.auth-btn.loading .auth-lbl   { display: none; }
.auth-btn.loading .auth-arrow { display: none; }

/* ── Indicateur de force ── */
.auth-strength { margin-top: 11px; }

.auth-strength-bars {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 5px;
  margin-bottom: 9px;
}

.auth-strength-bars span {
  height: 4px;
  border-radius: 2px;
  background: var(--border);
  transition: background .35s var(--ease);
}

.auth-strength-bars span.active-1 { background: var(--danger); }
.auth-strength-bars span.active-2 { background: var(--warning); }
.auth-strength-bars span.active-3 { background: #84cc16; }
.auth-strength-bars span.active-4 { background: var(--success); }

.auth-rules {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px 14px;
}

.auth-rules li {
  font-size: .73rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 5px;
  transition: color .25s;
}

.auth-rules li i {
  width: 13px;
  font-size: .65rem;
  flex-shrink: 0;
}

.auth-rules li.ok { color: var(--success); }

/* ── Match password ── */
.auth-match {
  font-size: .775rem;
  margin-top: 7px;
  min-height: 16px;
  font-weight: 600;
  display: none;
}
.auth-match.ok  { display: block; color: var(--success); }
.auth-match.err { display: block; color: var(--danger); }

/* ── Responsive mobile ── */
@media (max-width: 860px) {
  body.auth-page { flex-direction: column; }

  .auth-panel-left {
    flex: none;
    min-height: auto;
    padding: 28px 24px 32px;
  }

  .auth-left-body { padding: 28px 0 20px; }
  .auth-left-headline { font-size: 1.5rem; }
  .auth-features { display: none; }

  .auth-panel-right { min-height: auto; padding: 36px 24px 48px; }
  .auth-panel-right::before { display: none; }
  .auth-form-box { max-width: 100%; }
  .auth-rules { grid-template-columns: 1fr; }
}

/* ── SweetAlert ── */
.swal-overlay { background: rgba(15,23,42,.55); backdrop-filter: blur(3px); }
.swal-modal {
  border-radius: 14px !important;
  font-family: 'Nunito', inherit !important;
  box-shadow: 0 20px 60px rgba(0,0,0,.12) !important;
}
.swal-title  { font-weight: 800 !important; font-size: 1.2rem !important; color: var(--text) !important; }
.swal-text   { color: var(--text-sub) !important; font-size: .9rem !important; }
.swal-button {
  border-radius: 8px !important;
  font-family: 'Nunito', inherit !important;
  font-weight: 700 !important;
  padding: 10px 24px !important;
}
.swal-button--confirm { background: var(--brand) !important; }
.swal-button--cancel  { background: var(--bg) !important; color: var(--text) !important; }
.swal-content__input  {
  border-radius: 10px !important;
  border: 1.5px solid var(--border) !important;
  padding: 12px 14px !important;
  font-size: 1.3rem !important;
  letter-spacing: .2em !important;
  text-align: center !important;
  font-family: 'Nunito', inherit !important;
}
.swal-content__input:focus {
  border-color: var(--brand) !important;
  box-shadow: 0 0 0 4px rgba(103,119,239,.13) !important;
  outline: none !important;
}
