/* Team sign-in page (/auth/) – identical on every CDE platform.
   Brand panel + form panel. Accent colour from sector.css (one palette per platform);
   dark mode follows the shared cde_theme cookie (cde-theme.js). */
@font-face { font-family: "NotoKufiArabic"; src: url("../fonts/NotoKufiArabic-VariableFont_wght.ttf") format("truetype"); font-weight: 100 900; font-display: swap; }

:root {
  --lg-font: "Manrope", "NotoKufiArabic", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --lg-mint: #07E5BB;
  --lg-navy: #0B2239;
  --lg-navy-2: #12395C;
  --lg-bg: #F5F7FA;
  --lg-surface: #FFFFFF;
  --lg-field: #FFFFFF;
  --lg-line: #DCE3EC;
  --lg-ink: #0F1E31;
  --lg-text: #4A5768;
  --lg-muted: #7A8797;
  --lg-accent: var(--primary, #0E9F8A);
  --lg-accent-dark: var(--primary-dark, #0B7C6C);
  --lg-ease: cubic-bezier(.22, 1, .36, 1);
}
html[data-theme="dark"] {
  --lg-bg: #08111C;
  --lg-surface: #0E1A28;
  --lg-field: #0A1521;
  --lg-line: rgba(255, 255, 255, .12);
  --lg-ink: #EEF3F8;
  --lg-text: #B4C1CF;
  --lg-muted: #8796A8;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body.lg { min-height: 100vh; background: var(--lg-bg); color: var(--lg-text); font-family: var(--lg-font); line-height: 1.6; -webkit-font-smoothing: antialiased; }
body.lg.lang-ar { line-height: 1.75; }
a { color: inherit; }
.lg-flip { display: inline-block; }
[dir="rtl"] .lg-flip { transform: scaleX(-1); }

/* ---------- Layout ---------- */
.lg-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(380px, 44%) 1fr; }

/* ---------- Brand panel ---------- */
.lg-brand {
  position: relative; overflow: hidden; isolation: isolate; color: #fff;
  display: flex; flex-direction: column; justify-content: space-between; gap: 2rem;
  padding: clamp(1.6rem, 3.2vw, 2.8rem);
  background:
    radial-gradient(120% 80% at 0% 0%, color-mix(in srgb, var(--lg-accent) 34%, transparent) 0%, transparent 55%),
    radial-gradient(90% 70% at 100% 100%, rgba(7, 229, 187, .20) 0%, transparent 60%),
    linear-gradient(160deg, var(--lg-navy) 0%, var(--lg-navy-2) 100%);
}
.lg-brand::before {                     /* dot grid */
  content: ""; position: absolute; inset: 0; z-index: -1; opacity: .35;
  background-image: radial-gradient(rgba(255, 255, 255, .28) 1px, transparent 1.4px); background-size: 22px 22px;
  mask-image: linear-gradient(180deg, #000 0%, transparent 85%); -webkit-mask-image: linear-gradient(180deg, #000 0%, transparent 85%);
}
.lg-brand-glow { position: absolute; z-index: -1; width: 420px; height: 420px; inset-inline-end: -160px; top: 30%; border-radius: 50%;
  background: color-mix(in srgb, var(--lg-accent) 55%, transparent); filter: blur(110px); opacity: .45; }
.lg-brand-rings { position: absolute; z-index: -1; inset-inline-end: -180px; bottom: -180px; width: 560px; height: 560px; }
.lg-brand-rings span { position: absolute; inset: 0; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .10); }
.lg-brand-rings span:nth-child(2) { inset: 70px; border-color: rgba(255, 255, 255, .08); }
.lg-brand-rings span:nth-child(3) { inset: 140px; border-color: rgba(7, 229, 187, .18); }

.lg-brand-logo { display: inline-flex; align-items: center; gap: .85rem; text-decoration: none; }
.lg-brand-logo img { width: 54px; height: 54px; object-fit: contain; }
.lg-brand-logo span { display: flex; flex-direction: column; line-height: 1.2; }
.lg-brand-logo b { font-size: 1.15rem; font-weight: 800; letter-spacing: .02em; }
.lg-brand-logo small { font-size: .8rem; color: rgba(255, 255, 255, .7); font-weight: 600; }

.lg-brand-body { max-width: 460px; animation: lgUp .8s var(--lg-ease) both; }
.lg-eyebrow { display: inline-flex; align-items: center; gap: .45rem; padding: .35rem .8rem; border-radius: 999px; font-size: .8rem; font-weight: 700;
  background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .16); color: rgba(255, 255, 255, .9); }
.lg-eyebrow i { color: var(--lg-mint); }
.lg-brand h2 { margin: 1rem 0 .5rem; font-size: clamp(1.7rem, 2.6vw, 2.35rem); line-height: 1.25; font-weight: 800; letter-spacing: -.015em; }
.lg-sector { margin: 0 0 1.6rem; color: rgba(255, 255, 255, .72); font-weight: 600; }
.lg-feats { list-style: none; margin: 0; padding: 0; display: grid; gap: .85rem; }
.lg-feats li { display: flex; align-items: center; gap: .85rem; font-weight: 600; color: rgba(255, 255, 255, .9); }
.lg-feats span { flex: 0 0 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; font-size: 1.1rem;
  background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .14); color: var(--lg-mint); }

.lg-brand-foot { display: flex; align-items: center; gap: .75rem; font-size: .8rem; color: rgba(255, 255, 255, .72); font-weight: 600; max-width: 420px; }
.lg-brand-foot img { width: 40px; height: 40px; object-fit: contain; flex: 0 0 40px; background: #fff; border-radius: 50%; padding: 3px; }

/* ---------- Form panel ---------- */
.lg-panel { display: flex; flex-direction: column; min-width: 0; padding: clamp(1rem, 2.4vw, 1.8rem) clamp(1rem, 4vw, 3rem); }
.lg-top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.lg-back { display: inline-flex; align-items: center; gap: .5rem; font-size: .88rem; font-weight: 700; color: var(--lg-text); text-decoration: none; padding: .45rem .2rem; }
.lg-back:hover { color: var(--lg-ink); }
.lg-tools { display: flex; align-items: center; gap: .6rem; }
.lg-lang { display: inline-flex; padding: 4px; border-radius: 999px; background: var(--lg-surface); border: 1px solid var(--lg-line); }
.lg-lang a { padding: .28rem .75rem; border-radius: 999px; font-size: .78rem; font-weight: 800; color: var(--lg-muted); text-decoration: none; transition: background .25s, color .25s; }
.lg-lang a:hover { color: var(--lg-ink); }
.lg-lang a[aria-current] { background: var(--lg-navy); color: #fff; }
html[data-theme="dark"] .lg-lang a[aria-current] { background: var(--lg-mint); color: #062A24; }
.lg-theme { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; cursor: pointer; background: var(--lg-surface); color: var(--lg-ink);
  border: 1px solid var(--lg-line); transition: border-color .2s, transform .2s; }
.lg-theme:hover { border-color: var(--lg-accent); transform: translateY(-1px); }

.lg-card { width: min(440px, 100%); margin: auto; padding: 2rem 0 1.2rem; animation: lgUp .7s var(--lg-ease) both; }
@keyframes lgUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
.lg-head { display: flex; align-items: center; gap: 1rem; margin-bottom: .6rem; }
.lg-icon { flex: 0 0 54px; height: 54px; display: grid; place-items: center; border-radius: 16px; font-size: 1.45rem; color: #fff;
  background: linear-gradient(140deg, var(--lg-accent), var(--lg-accent-dark)); box-shadow: 0 14px 28px -14px var(--primary-shadow, rgba(14, 159, 138, .6)); }
.lg-kicker { margin: 0; font-size: .85rem; font-weight: 700; color: var(--lg-accent); }
.lg-card h1 { margin: 0; font-size: clamp(1.6rem, 2.4vw, 1.95rem); line-height: 1.2; font-weight: 800; color: var(--lg-ink); letter-spacing: -.015em; }
.lg-sub { margin: .2rem 0 1.6rem; font-size: .92rem; color: var(--lg-text); }

.lg-form { display: grid; gap: 1.05rem; }
.lg-field { min-width: 0; }
.lg-field > label { display: block; margin-bottom: .4rem; font-size: .86rem; font-weight: 700; color: var(--lg-ink); }
.lg-input { position: relative; display: flex; align-items: center; height: 52px; border-radius: 14px; background: var(--lg-field); border: 1.5px solid var(--lg-line);
  transition: border-color .2s, box-shadow .2s, background-color .2s; }
.lg-input:hover { border-color: color-mix(in srgb, var(--lg-line) 50%, var(--lg-muted)); }
.lg-input:focus-within { border-color: var(--lg-accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--lg-accent) 16%, transparent); }
.lg-input > i { padding-inline: 1rem .2rem; font-size: 1.05rem; color: var(--lg-muted); flex: 0 0 auto; transition: color .2s; }
.lg-input:focus-within > i { color: var(--lg-accent); }
.lg-input input { flex: 1; width: 100%; min-width: 0; height: 100%; padding: 0 .85rem; border: 0; outline: 0; background: transparent; color: var(--lg-ink); font: inherit; font-size: .98rem; font-weight: 600; }
.lg-input input::placeholder { color: var(--lg-muted); font-weight: 500; opacity: .8; }
.lg-input input:-webkit-autofill { -webkit-text-fill-color: var(--lg-ink); box-shadow: 0 0 0 40px var(--lg-field) inset; }
.lg-suffix { flex: 0 0 auto; align-self: stretch; display: grid; place-items: center; padding: 0 1rem; font-size: .82rem; font-weight: 700; color: var(--lg-text);
  background: color-mix(in srgb, var(--lg-line) 35%, transparent); border-inline-start: 1px solid var(--lg-line); border-radius: 0 12px 12px 0; white-space: nowrap; }
[dir="rtl"] .lg-suffix { border-radius: 12px 0 0 12px; }
.lg-eye { flex: 0 0 auto; width: 48px; align-self: stretch; display: grid; place-items: center; border: 0; background: transparent; color: var(--lg-muted); cursor: pointer; border-radius: 0 12px 12px 0; font-size: 1.05rem; }
[dir="rtl"] .lg-eye { border-radius: 12px 0 0 12px; }
.lg-eye:hover { color: var(--lg-accent); }
.lg-eye:focus-visible { outline: 2px solid var(--lg-accent); outline-offset: -4px; }
.lg-caps[hidden] { display: none; }
.lg-caps { display: flex; align-items: center; gap: .45rem; margin: .45rem 0 0; font-size: .8rem; font-weight: 700; color: #B54708; }

/* Captcha: image + refresh + answer on one line */
.lg-captcha { display: grid; grid-template-columns: auto auto 1fr; align-items: center; gap: .6rem; }
.lg-captcha-img { display: block; height: 52px; border-radius: 14px; overflow: hidden; border: 1.5px solid var(--lg-line); background: #EEF2F6; }
.lg-captcha-img img { display: block; height: 100%; width: auto; }
.lg-refresh { width: 44px; height: 52px; border-radius: 14px; display: grid; place-items: center; cursor: pointer; font-size: 1.15rem;
  background: var(--lg-field); color: var(--lg-text); border: 1.5px solid var(--lg-line); transition: color .2s, border-color .2s; }
.lg-refresh:hover { color: var(--lg-accent); border-color: var(--lg-accent); }
.lg-refresh.is-spinning i { animation: lgSpin .6s linear infinite; display: inline-block; }
@keyframes lgSpin { to { transform: rotate(360deg); } }
.lg-captcha-input { height: 52px; width: 100%; min-width: 0; padding: 0 1rem; border-radius: 14px; border: 1.5px solid var(--lg-line); background: var(--lg-field);
  color: var(--lg-ink); font: inherit; font-size: 1.05rem; font-weight: 800; letter-spacing: .08em; text-align: center; outline: 0; transition: border-color .2s, box-shadow .2s; }
.lg-captcha-input:focus { border-color: var(--lg-accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--lg-accent) 16%, transparent); }
.lg-captcha-input::placeholder { letter-spacing: 0; font-weight: 600; color: var(--lg-muted); }

.lg-submit { margin-top: .35rem; height: 54px; display: inline-flex; align-items: center; justify-content: center; gap: .6rem; border: 0; border-radius: 14px; cursor: pointer;
  font: inherit; font-size: 1rem; font-weight: 800; color: #fff; background: linear-gradient(135deg, var(--lg-accent), var(--lg-accent-dark));
  box-shadow: 0 16px 30px -16px var(--primary-shadow, rgba(14, 159, 138, .6)); transition: transform .2s var(--lg-ease), box-shadow .2s, filter .2s; }
.lg-submit:hover { transform: translateY(-1px); filter: brightness(1.05); }
.lg-submit:focus-visible { outline: 3px solid color-mix(in srgb, var(--lg-accent) 40%, transparent); outline-offset: 3px; }
.lg-submit.is-busy { pointer-events: none; opacity: .85; }
.lg-submit.is-busy i { animation: lgSpin .9s linear infinite; }
.lg-submit.is-busy i::before { content: "\F130"; }   /* bi-arrow-repeat */

.lg-alerts { display: grid; gap: .4rem; }
.lg-alert { display: flex; align-items: flex-start; gap: .55rem; margin: 0; padding: .75rem .9rem; border-radius: 12px; font-size: .88rem; font-weight: 600;
  background: #FEF3F2; color: #B42318; border: 1px solid #FECDCA; animation: lgShake .4s ease both; }
.lg-alert i { margin-top: .15rem; }
html[data-theme="dark"] .lg-alert { background: rgba(240, 68, 56, .12); color: #FDA29B; border-color: rgba(240, 68, 56, .3); }
@keyframes lgShake { 0%, 100% { transform: none; } 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }

.lg-note { display: flex; gap: .6rem; margin: 1.4rem 0 0; padding: .85rem 1rem; border-radius: 14px; font-size: .84rem; line-height: 1.6;
  background: color-mix(in srgb, var(--lg-line) 28%, transparent); border: 1px dashed var(--lg-line); }
.lg-note i { color: var(--lg-accent); margin-top: .2rem; }

.lg-foot { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; font-size: .8rem; font-weight: 600; color: var(--lg-muted); padding-top: .5rem; }
.lg-foot a { display: inline-flex; align-items: center; gap: .4rem; text-decoration: none; color: var(--lg-text); }
.lg-foot a:hover { color: var(--lg-ink); }
.lg-secure { display: inline-flex; align-items: center; gap: .4rem; }
.lg-secure i { color: #1E8E4E; }

/* ---------- Responsive ---------- */
@media (max-width: 991.98px) {
  .lg-shell { grid-template-columns: 1fr; }
  .lg-brand { gap: 1rem; padding: 1.2rem 1.2rem 1.4rem; }
  .lg-brand-body h2 { font-size: 1.35rem; margin: .7rem 0 .2rem; }
  .lg-sector { margin-bottom: 0; }
  .lg-feats, .lg-brand-foot, .lg-brand-rings { display: none; }
  .lg-card { padding-top: 1.4rem; }
}
@media (max-width: 480px) {
  .lg-back span, .lg-back { font-size: .8rem; }
  .lg-captcha { grid-template-columns: auto auto; }
  .lg-captcha-input { grid-column: 1 / -1; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
body.lg.lang-fr, body.lg.lang-en { line-height: 1.65; letter-spacing: -.005em; }
body.lg.lang-fr h1, body.lg.lang-en h1, body.lg.lang-fr h2, body.lg.lang-en h2 { letter-spacing: -.03em; }
