/**
 * Page connexion SIMB-TCHAD — drapeau Tchad
 * Encadrements : bleu (#1E4A8C) · jaune (#FECB00) · rouge (#E31C24)
 */
:root {
  --auth-blue: #1E4A8C;
  --auth-blue-deep: #142F5C;
  --auth-blue-mid: #2A5BA3;
  --auth-yellow: #FECB00;
  --auth-yellow-deep: #B8860B;
  --auth-green: #FECB00; /* alias drapeau (ex-vert → jaune) */
  --auth-green-deep: #B8860B;
  --auth-red: #E31C24;
  --auth-bg: #0B1628;
  --auth-bg-deep: #070E1A;
  --auth-panel: rgba(12, 24, 44, 0.72);
  --auth-input: rgba(255, 255, 255, 0.06);
  --auth-input-border: rgba(255, 255, 255, 0.14);
  --auth-text: #ffffff;
  --auth-muted: rgba(255, 255, 255, 0.72);
  --auth-radius: 16px;
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
}

body.auth-tchad {
  position: relative;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background-color: var(--auth-bg-deep);
  color: var(--auth-text);
  min-height: 100vh;
  overflow-x: hidden;
}

/* —— Fond —— */
.auth-tchad__backdrop {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.auth-tchad__backdrop::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 90% 70% at 12% 8%, rgba(30, 74, 140, 0.55) 0%, transparent 55%),
    radial-gradient(ellipse 70% 55% at 95% 90%, rgba(227, 28, 36, 0.2) 0%, transparent 50%),
    radial-gradient(ellipse 55% 45% at 55% 50%, rgba(254, 203, 0, 0.12) 0%, transparent 48%),
    linear-gradient(155deg, #060B14 0%, #0B1628 40%, #102040 65%, #070E1A 100%);
}

.auth-tchad__mesh {
  position: absolute;
  inset: 0;
  opacity: 0.3;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 52px 52px;
  mask-image: radial-gradient(ellipse 85% 75% at 40% 45%, #000 20%, transparent 75%);
}

.auth-tchad__trame {
  position: absolute;
  inset: 0;
  opacity: 0.22;
  background: repeating-linear-gradient(
    -28deg,
    transparent,
    transparent 10px,
    rgba(254, 203, 0, 0.07) 10px,
    rgba(254, 203, 0, 0.07) 11px
  );
  mask-image: radial-gradient(ellipse 70% 60% at 70% 30%, #000 10%, transparent 70%);
}

.auth-tchad__orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  animation: auth-orb-float 18s ease-in-out infinite;
}

.auth-tchad__orb--blue {
  width: 520px;
  height: 520px;
  top: -12%;
  left: -8%;
  background: rgba(30, 74, 140, 0.4);
}

.auth-tchad__orb--green,
.auth-tchad__orb--gold,
.auth-tchad__orb--yellow {
  width: 380px;
  height: 380px;
  bottom: 8%;
  left: 32%;
  background: rgba(254, 203, 0, 0.2);
  animation-delay: -6s;
}

.auth-tchad__orb--red {
  width: 420px;
  height: 420px;
  top: 28%;
  right: -10%;
  background: rgba(227, 28, 36, 0.16);
  animation-delay: -12s;
}

@keyframes auth-orb-float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33%       { transform: translate(24px, -18px) scale(1.04); }
  66%       { transform: translate(-16px, 14px) scale(0.97); }
}

.auth-tchad__topbar,
.auth-tchad__main {
  position: relative;
  z-index: 1;
}

/* —— Topbar —— */
.auth-tchad__topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1.75rem;
  background: rgba(7, 14, 26, 0.78);
  backdrop-filter: blur(16px) saturate(1.15);
  -webkit-backdrop-filter: blur(16px) saturate(1.15);
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  position: relative;
}

.auth-tchad__topbar::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--auth-blue) 0 33%, var(--auth-yellow) 33% 66%, var(--auth-red) 66% 100%);
}

.auth-tchad__topbar-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
  text-align: right;
}

.auth-tchad__republic-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  min-width: 0;
  gap: 0.12rem;
  align-items: flex-end;
}

.auth-tchad__emblem {
  width: 56px;
  height: 56px;
  object-fit: contain;
  flex-shrink: 0;
  background: #fff;
  border-radius: 8px;
  padding: 0.2rem;
}

.auth-tchad__republic-label {
  font-size: 0.62rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.55);
}

.auth-tchad__republic-text strong {
  font-size: 0.95rem;
  font-weight: 800;
  color: #fff;
}

.auth-tchad__republic-text > span:last-child {
  font-size: 0.72rem;
  font-weight: 600;
  color: rgba(254, 203, 0, 0.95);
}

.auth-tchad__brand {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  text-decoration: none;
  color: var(--auth-text);
  min-width: 0;
}

.auth-tchad__flag {
  display: flex;
  width: 42px;
  height: 28px;
  flex-shrink: 0;
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.35);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.28);
}

.auth-tchad__flag span {
  flex: 1;
}

.auth-tchad__flag span:nth-child(1) { background: var(--auth-blue); }
.auth-tchad__flag span:nth-child(2) { background: var(--auth-yellow); }
.auth-tchad__flag span:nth-child(3) { background: var(--auth-red); }

.auth-tchad__brand-seal {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: 0 0 0 2px var(--auth-blue), 0 0 0 3px rgba(255,255,255,0.25);
  background: var(--auth-yellow);
}

.auth-tchad__brand-seal img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.auth-tchad__brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.auth-tchad__brand-text strong {
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.auth-tchad__brand-red {
  color: #ff6b70;
}

.auth-tchad__brand-text span {
  font-size: 0.62rem;
  color: rgba(254, 203, 0, 0.95);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-weight: 600;
}

.auth-tchad__topnav {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.auth-tchad__topnav a {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--auth-muted);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.4rem 0.75rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.auth-tchad__topnav a:hover {
  color: #fff;
  background: rgba(254, 203, 0, 0.12);
  border-color: rgba(254, 203, 0, 0.4);
}

.auth-tchad__topnav a i {
  color: var(--auth-yellow);
}

.auth-tchad__lang {
  display: flex;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  overflow: hidden;
}

.auth-tchad__lang span {
  padding: 0.3rem 0.55rem;
  font-size: 0.7rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.4);
}

.auth-tchad__lang span.is-active {
  color: var(--auth-blue-deep);
  background: var(--auth-yellow);
}

.auth-tchad__eyebrow {
  display: inline-block;
  margin: 0 0 0.65rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--auth-yellow);
}

.auth-tchad__welcome h1 {
  margin: 0 0 0.75rem;
  font-size: clamp(1.55rem, 2.4vw, 2.1rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: #fff;
}

.auth-tchad__welcome h1 span {
  color: var(--auth-yellow);
}

.auth-tchad__welcome > p:last-of-type {
  margin: 0;
  max-width: 34rem;
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--auth-muted);
}

.auth-tchad__main {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 2rem;
  align-items: center;
  min-height: calc(100vh - 68px);
  padding: 1.75rem 2rem 2.25rem;
  max-width: 1180px;
  margin: 0 auto;
}

.auth-tchad__left {
  display: flex;
  flex-direction: column;
  gap: 1.35rem;
  min-width: 0;
}

.auth-tchad__slider {
  position: relative;
  flex: 1;
  min-height: 340px;
  max-height: 480px;
  border-radius: var(--auth-radius);
  overflow: hidden;
  background: rgba(8, 14, 28, 0.55);
  box-shadow:
    0 28px 64px rgba(0, 0, 0, 0.4),
    0 0 0 1px rgba(255, 255, 255, 0.08);
}

.auth-tchad__slider::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--auth-radius);
  padding: 2px;
  background: linear-gradient(
    135deg,
    rgba(30, 74, 140, 0.75) 0%,
    rgba(254, 203, 0, 0.55) 50%,
    rgba(227, 28, 36, 0.55) 100%
  );
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  z-index: 4;
}

.auth-tchad__slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.9s ease-in-out;
  pointer-events: none;
}

.auth-tchad__slide.is-active {
  opacity: 1;
  pointer-events: auto;
}

.auth-tchad__slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.auth-tchad__slide-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(7, 14, 26, 0.92) 0%,
    rgba(20, 47, 92, 0.45) 42%,
    rgba(0, 0, 0, 0.08) 72%,
    transparent 100%
  );
  pointer-events: none;
}

.auth-tchad__slide-content {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 1.25rem 1.65rem 2.6rem;
  z-index: 2;
}

.auth-tchad__slide-content h3 {
  margin: 0 0 0.35rem;
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
}

.auth-tchad__slide-content p {
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.78);
}

.auth-tchad__tricolor {
  display: flex;
  height: 3px;
  width: 64px;
  margin-top: 0.85rem;
  border-radius: 2px;
  overflow: hidden;
}

.auth-tchad__tricolor span { flex: 1; }
.auth-tchad__tricolor span:nth-child(1) { background: var(--auth-blue); }
.auth-tchad__tricolor span:nth-child(2) { background: var(--auth-yellow); }
.auth-tchad__tricolor span:nth-child(3) { background: var(--auth-red); }

.auth-tchad__dots {
  position: absolute;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 0.4rem;
  z-index: 5;
}

.auth-tchad__dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.55);
  background: transparent;
  padding: 0;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, width 0.2s ease;
}

.auth-tchad__dot.is-active {
  width: 22px;
  border-radius: 999px;
  background: var(--auth-yellow);
  border-color: var(--auth-yellow);
}

.auth-tchad__dot:hover {
  border-color: var(--auth-yellow);
}

.auth-tchad__right {
  display: flex;
  justify-content: center;
  align-items: center;
  min-width: 0;
}

.auth-tchad__card {
  width: 100%;
  max-width: 400px;
  padding: 1.65rem 1.55rem 1.35rem;
  border-radius: 18px;
  background:
    linear-gradient(165deg, rgba(255,255,255,0.08) 0%, rgba(255,255,255,0.03) 100%),
    var(--auth-panel);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow:
    0 24px 56px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(18px) saturate(1.15);
  -webkit-backdrop-filter: blur(18px) saturate(1.15);
  position: relative;
  overflow: hidden;
}

.auth-tchad__card::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--auth-blue), var(--auth-yellow), var(--auth-red));
}

.auth-tchad__card-head {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 1.35rem;
}

.auth-tchad__card-seal {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--auth-yellow);
  box-shadow: 0 0 0 2px var(--auth-blue), 0 0 0 4px rgba(255,255,255,0.2), 0 8px 18px rgba(0,0,0,0.3);
}

.auth-tchad__card-seal img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.auth-tchad__form-title {
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  text-transform: none;
  color: #fff;
  margin: 0 0 0.2rem;
  padding: 0;
  border: none;
}

.auth-tchad__form-sub {
  margin: 0;
  font-size: 0.78rem;
  color: var(--auth-muted);
}

.auth-tchad__field {
  margin-bottom: 1.1rem;
}

.auth-tchad__field label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.65);
  margin-bottom: 0.4rem;
}

.auth-tchad__input-row {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--auth-input-border);
  border-radius: 12px;
  background: var(--auth-input);
  overflow: hidden;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.auth-tchad__input-row:focus-within {
  border-color: rgba(254, 203, 0, 0.7);
  box-shadow: 0 0 0 3px rgba(254, 203, 0, 0.18);
}

.auth-tchad__input-row.is-invalid {
  border-color: rgba(227, 28, 36, 0.7);
  box-shadow: 0 0 0 3px rgba(227, 28, 36, 0.15);
}

.auth-tchad__input-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  flex-shrink: 0;
  background: rgba(254, 203, 0, 0.18);
  color: var(--auth-yellow);
  font-size: 1.15rem;
}

.auth-tchad__input-row .form-control {
  flex: 1;
  border: none;
  background: transparent;
  color: #fff;
  padding: 0.78rem 0.8rem;
  font-size: 0.9rem;
  box-shadow: none;
}

.auth-tchad__input-row .form-control::placeholder {
  color: rgba(255, 255, 255, 0.35);
}

.auth-tchad__input-row .form-control:focus {
  box-shadow: none;
  outline: none;
  background: transparent;
  color: #fff;
}

.auth-tchad__toggle-pwd {
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.45);
  padding: 0 0.75rem;
  cursor: pointer;
  font-size: 1.1rem;
}

.auth-tchad__toggle-pwd:hover {
  color: var(--auth-yellow);
}

.auth-tchad__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  font-size: 0.8rem;
}

.auth-tchad__meta .form-check-label {
  color: var(--auth-muted);
}

.auth-tchad__meta .form-check-input {
  background-color: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.25);
}

.auth-tchad__meta .form-check-input:checked {
  background-color: var(--auth-yellow);
  border-color: var(--auth-yellow);
}

.auth-tchad__link {
  color: rgba(254, 203, 0, 0.95);
  text-decoration: none;
  font-size: 0.78rem;
  font-weight: 600;
}

.auth-tchad__link:hover {
  color: #fff;
  text-decoration: underline;
}

.auth-tchad__submit {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.9rem 1.25rem;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--auth-blue-mid) 0%, var(--auth-blue) 55%, var(--auth-blue-deep) 100%);
  color: #fff;
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(30, 74, 140, 0.4);
  transition: transform 0.12s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.auth-tchad__submit i {
  color: var(--auth-yellow);
  font-size: 1.15rem;
}

.auth-tchad__submit:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(30, 74, 140, 0.5);
}

.auth-tchad__submit:active {
  transform: translateY(0);
}

.auth-tchad__alert {
  margin-bottom: 1rem;
  padding: 0.75rem 0.9rem;
  border-radius: 10px;
  font-size: 0.82rem;
}

.auth-tchad__alert--danger,
.auth-tchad__alert--error {
  background: rgba(227, 28, 36, 0.15);
  border: 1px solid rgba(227, 28, 36, 0.4);
  color: #ffb4b7;
}

.auth-tchad__alert--info {
  background: rgba(30, 74, 140, 0.2);
  border: 1px solid rgba(30, 74, 140, 0.45);
  color: #c7d7f0;
}

.auth-tchad__invalid {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.75rem;
  color: #ff8a8e;
}

.auth-tchad__footer,
.auth-tchad__footer-note {
  margin-top: 1.15rem;
  text-align: center;
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.45);
}

.auth-tchad__footer strong,
.auth-tchad__footer-note strong {
  color: rgba(254, 203, 0, 0.85);
  font-weight: 700;
}

@media (max-width: 991.98px) {
  .auth-tchad__main {
    grid-template-columns: 1fr;
    padding: 1.25rem 1.15rem 2rem;
    gap: 1.5rem;
  }

  .auth-tchad__slider {
    min-height: 240px;
    max-height: 300px;
  }

  .auth-tchad__card {
    max-width: 100%;
  }
}

@media (max-width: 575.98px) {
  .auth-tchad__topbar {
    padding: 0.75rem 1rem;
    gap: 0.5rem;
  }

  .auth-tchad__emblem {
    width: 44px;
    height: 44px;
  }

  .auth-tchad__republic-text strong {
    font-size: 0.78rem;
  }

  .auth-tchad__republic-label {
    display: none;
  }

  .auth-tchad__republic-text > span:last-child {
    font-size: 0.62rem;
    max-width: 42vw;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .auth-tchad__flag {
    width: 34px;
    height: 22px;
  }

  .auth-tchad__brand-text span {
    display: none;
  }

  .auth-tchad__welcome h1 {
    font-size: 1.4rem;
  }
}
