/* ============================================================
   login.css — CortyAcademia (Glassmorphism)
   ============================================================ */

:root {
  --navy: #031c38;
  --navy-light: #0a2d5a;
  --gold: #d29a2b;
  --gold-light: #e8b84a;
  --gold-dark: #b8860b;
  --glass: rgba(3, 28, 56, .70);
  --glass-border: rgba(255, 255, 255, .27);
  --gold-gradient: linear-gradient(135deg, #d29a2b 0%, #e8b84a 50%, #b8860b 100%);
  --hero-gradient: linear-gradient(135deg, #031c38 0%, #1a3a6a 50%, #d29a2b 100%);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  min-height: 100vh;
  font-family: Inter, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: #ffffff;
  background: var(--navy);
}
button, input, select { font: inherit; }

.scene {
  position: relative;
  isolation: isolate;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 38px 20px;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 12% 18%, rgba(26,58,106,.9), transparent 38%),
    radial-gradient(ellipse at 88% 80%, rgba(210,154,43,.18), transparent 30%),
    linear-gradient(135deg, #031c38 0%, #0a2d5a 58%, #031c38 100%);
}

/* Décor de fond */
.scene::before, .scene::after {
  content: "";
  position: absolute;
  z-index: -1;
  border-radius: 50%;
  pointer-events: none;
}
.scene::before {
  width: 580px; height: 580px;
  top: -310px; right: -130px;
  border: 1px solid rgba(232,184,74,.18);
  box-shadow: 0 0 0 42px rgba(255,255,255,.018), 0 0 0 95px rgba(255,255,255,.014);
}
.scene::after {
  width: 460px; height: 460px;
  bottom: -300px; left: -120px;
  border: 1px solid rgba(255,255,255,.12);
  box-shadow: 0 0 0 38px rgba(255,255,255,.02), 0 0 0 82px rgba(255,255,255,.014);
}
.aurora {
  position: absolute; z-index: -1; pointer-events: none;
  width: 360px; height: 360px; border-radius: 50%;
  filter: blur(90px); opacity: .18;
}
.aurora.blue { background: #397fc2; left: 8%; top: 10%; }
.aurora.gold { background: var(--gold); right: 9%; bottom: 4%; opacity: .12; }

/* Neige */
.snowflake {
  position: absolute;
  top: -12px;
  width: 4px; height: 4px;
  border-radius: 50%;
  background: rgba(255,255,255,.9);
  box-shadow: 0 0 8px rgba(255,255,255,.55);
  pointer-events: none;
  animation: snowfall linear infinite;
}
@keyframes snowfall {
  from { transform: translate3d(0,-5vh,0); }
  to { transform: translate3d(var(--drift),110vh,0); }
}

/* --- CARTE PRINCIPALE --- */
.login-card {
  width: min(100%, 990px);
  display: grid;
  grid-template-columns: .88fr 1.12fr;
  overflow: hidden;
  position: relative;
  border: 1px solid var(--glass-border);
  border-radius: 28px;
  background: rgba(255,255,255,.055);
  box-shadow: 0 32px 90px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.12);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

/* --- PARTIE GAUCHE (Intro) --- */
.intro {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 620px;
  padding: 36px 34px 28px;
  overflow: hidden;
  background: var(--hero-gradient);
  border-right: 1px solid rgba(255,255,255,.12);
}
.intro::after {
  content: "";
  position: absolute;
  width: 330px; height: 330px;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 50%;
  right: -205px; bottom: -125px;
  box-shadow: 0 0 0 28px rgba(255,255,255,.035), 0 0 0 60px rgba(255,255,255,.025);
}
.brand {
  position: relative; z-index: 1;
  display: flex; align-items: center; gap: 12px;
}
.brand-mark {
  display: grid; place-items: center;
  width: 47px; height: 47px; flex: 0 0 auto;
  border-radius: 15px;
  color: var(--navy);
  background: var(--gold-gradient);
  box-shadow: 0 8px 22px rgba(0,0,0,.18);
}
.brand-name { font-size: 18px; font-weight: 800; letter-spacing: -.45px; }
.brand-tag { margin-top: 3px; font-size: 10px; letter-spacing: 1.5px; text-transform: uppercase; color: rgba(255,255,255,.72); }

.intro-copy { position: relative; z-index: 1; margin: 50px 0 20px; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 12px;
  border-radius: 99px;
  border: 1px solid rgba(255,255,255,.24);
  background: rgba(3,28,56,.22);
  color: #fff3cf;
  font-size: 11px; font-weight: 700;
}
.eyebrow-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--gold-light); box-shadow: 0 0 10px var(--gold-light); }
h1 { max-width: 340px; margin: 22px 0 14px; font-size: clamp(31px, 3.6vw, 43px); line-height: 1.1; letter-spacing: -1.5px; }
h1 span { color: var(--gold-light); }
.intro-copy p { max-width: 310px; margin: 0; color: rgba(255,255,255,.78); font-size: 13px; line-height: 1.8; }
.book-art { position: relative; z-index: 1; width: min(100%, 270px); align-self: center; margin: 0 auto 20px; filter: drop-shadow(0 18px 25px rgba(0,0,0,.15)); }
.intro-footer { position: relative; z-index: 1; color: rgba(255,255,255,.64); font-size: 10px; }

/* --- PARTIE DROITE (Formulaire) --- */
.form-area {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 48px clamp(28px, 5vw, 58px);
  background: linear-gradient(145deg, rgba(3,28,56,.76), rgba(10,45,90,.61));
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
}
.form-area::before {
  content: "";
  position: absolute; inset: 0;
  pointer-events: none;
  background: linear-gradient(125deg, rgba(255,255,255,.075), transparent 38%, rgba(232,184,74,.035));
}
.form-content { position: relative; z-index: 1; }

/* --- LE CERCLE DU LOGO --- */
.form-logo-circle {
  width: 76px;
  height: 76px;
  margin: 0 auto 15px auto;
  background: #0f172a;
  border: 2px solid var(--gold-light);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: 0 8px 20px rgba(0,0,0,.4);
}
.form-logo-circle img {
  width: 60%;
  height: 60%;
  object-fit: contain;
}

/* --- TEXTES EN DESSOUS DU LOGO --- */
.form-header {
  text-align: center;
  margin-bottom: 30px;
}
.form-header h2 {
  margin: 0 0 5px 0;
  font-size: 28px;
  letter-spacing: -.8px;
  color: #ffffff;
}
.form-header p {
  margin: 0;
  color: rgba(255,255,255,.72);
  font-size: 12px;
  line-height: 1.6;
}

/* --- CHAMPS --- */
.field { margin-bottom: 19px; }
.field label { display: block; margin-bottom: 9px; color: #fff; font-size: 12px; font-weight: 700; }
.control { position: relative; }
.field-icon {
  position: absolute; top: 50%; left: 14px; transform: translateY(-50%);
  display: flex; color: var(--gold-light); pointer-events: none;
}
.control input, .control select {
  display: block;
  width: 100%; height: 51px;
  padding: 0 44px 0 43px;
  border: 1px solid rgba(255,255,255,.34);
  border-radius: 12px;
  outline: none;
  color: #fff;
  background: rgba(255,255,255,.105);
  box-shadow: inset 0 1px 2px rgba(0,0,0,.08);
  font-size: 13px;
  transition: border-color .2s, background .2s, box-shadow .2s;
}
.control input::placeholder { color: rgba(255,255,255,.66); opacity: 1; }
.control select { appearance: none; cursor: pointer; }
.control select:invalid { color: rgba(255,255,255,.75); }
.control select option { color: var(--navy); background: #fff; }
.control input:focus, .control select:focus {
  border-color: var(--gold-light);
  background: rgba(255,255,255,.16);
  box-shadow: 0 0 0 3px rgba(232,184,74,.17);
}
.chevron { position: absolute; right: 15px; top: 50%; transform: translateY(-50%); color: rgba(255,255,255,.8); pointer-events: none; display: flex; }
.toggle-password {
  position: absolute; right: 7px; top: 50%; transform: translateY(-50%);
  display: grid; place-items: center; width: 36px; height: 36px;
  border: 0; border-radius: 9px; color: #fff;
  background: transparent; cursor: pointer;
}
.toggle-password:hover { color: var(--gold-light); background: rgba(255,255,255,.09); }

/* --- OPTIONS --- */
.options { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 2px 0 23px; font-size: 11px; }
.remember { display: flex; align-items: center; gap: 8px; color: rgba(255,255,255,.82); cursor: pointer; }
.remember input { width: 15px; height: 15px; margin: 0; accent-color: var(--gold); }
a { color: var(--gold-light); font-weight: 700; text-decoration: none; }
a:hover { text-decoration: underline; }

/* --- BOUTON --- */
.submit {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; min-height: 52px;
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 12px;
  color: var(--navy);
  background: var(--gold-gradient);
  box-shadow: 0 10px 24px rgba(0,0,0,.22), inset 0 1px 0 rgba(255,255,255,.35);
  font-size: 13px; font-weight: 800;
  cursor: pointer;
  transition: transform .2s, filter .2s, box-shadow .2s;
}
.submit:hover { transform: translateY(-1px); filter: brightness(1.06); box-shadow: 0 14px 28px rgba(0,0,0,.25); }
.submit:active { transform: translateY(0); }

/* --- PIED DE PAGE --- */
.security { display: flex; justify-content: center; align-items: center; gap: 7px; margin-top: 19px; color: rgba(255,255,255,.66); font-size: 10px; }
.security svg { color: var(--gold-light); }
.help { margin: 21px 0 0; text-align: center; color: rgba(255,255,255,.62); font-size: 11px; }
.notice { display: none; margin-top: 14px; padding: 11px 12px; border-radius: 10px; color: #fff5d8; background: rgba(210,154,43,.16); border: 1px solid rgba(232,184,74,.3); font-size: 11px; line-height: 1.5; }
.notice.show { display: block; }

/* ═══════════════════════════════════════════════════════════════════════════
   TOGGLE IDENTIFIANT (Matricule / Email)
   ═══════════════════════════════════════════════════════════════════════════ */

.identifier-toggle {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
  padding: 4px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
}

.identifier-toggle-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 14px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: rgba(255, 255, 255, 0.72);
  font-size: 12.5px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.identifier-toggle-btn i {
  font-size: 13px;
  opacity: 0.85;
}

.identifier-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.identifier-toggle-btn:hover i {
  opacity: 1;
}

/* Bouton actif — accent or */
.identifier-toggle-btn.active {
  background: var(--gold-gradient);
  color: var(--navy);
  border-color: rgba(255, 255, 255, 0.22);
  box-shadow: 0 4px 14px rgba(210, 154, 43, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  font-weight: 800;
}

.identifier-toggle-btn.active i {
  opacity: 1;
  color: var(--navy);
}

.identifier-toggle-btn.active:hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
}

.identifier-toggle-btn:active {
  transform: translateY(0);
}

/* Responsive mobile */
@media (max-width: 480px) {
  .identifier-toggle-btn {
    padding: 9px 10px;
    font-size: 11.5px;
    gap: 5px;
  }
  .identifier-toggle-btn i {
    font-size: 12px;
  }
}

/* --- RESPONSIVE --- */
@media (max-width: 760px) {
  .scene { padding: 16px 12px; }
  .login-card { grid-template-columns: 1fr; max-width: 470px; border-radius: 22px; }
  .intro { min-height: auto; padding: 24px 25px 26px; }
  .intro-copy { margin: 28px 0 0; }
  h1 { font-size: 30px; margin: 16px 0 10px; }
  .intro-copy p { font-size: 12px; }
  .book-art, .intro-footer { display: none; }
  .form-area { padding: 31px 25px 28px; }
  h2 { font-size: 26px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}




/* ═══════════════════════════════════════════════════════════════════════
   TOGGLE MATRICULE / EMAIL
   ═══════════════════════════════════════════════════════════════════════ */

.identifier-toggle {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 12px;
    padding: 4px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(232, 184, 74, 0.15);
    border-radius: 10px;
}

.identifier-toggle-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 14px;
    background: transparent;
    color: rgba(255, 255, 255, 0.6);
    border: 1px solid transparent;
    border-radius: 8px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.identifier-toggle-btn i {
    font-size: 13px;
    opacity: 0.9;
}

.identifier-toggle-btn:hover {
    color: #fff;
    background: rgba(232, 184, 74, 0.08);
    border-color: rgba(232, 184, 74, 0.2);
}

.identifier-toggle-btn.active {
    background: linear-gradient(135deg, #e8b84a, #d29a2b);
    color: #0a2d5a;
    border-color: transparent;
    box-shadow: 0 2px 10px rgba(232, 184, 74, 0.35);
}

.identifier-toggle-btn.active i {
    opacity: 1;
}

.identifier-toggle-btn:focus-visible {
    outline: 2px solid #e8b84a;
    outline-offset: 2px;
}

/* Mobile */
@media (max-width: 480px) {
    .identifier-toggle-btn {
        padding: 9px 10px;
        font-size: 12px;
    }
    .identifier-toggle-btn i {
        font-size: 12px;
    }
}