/* ═══════════════════════════════════════════════════════════════
   LOGIN PAGE — Portail LRE Gouvernement Français
═══════════════════════════════════════════════════════════════ */

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

:root {
  --gov-blue:        #003189;
  --gov-blue-dark:   #00217a;
  --gov-blue-mid:    #1563c3;
  --gov-blue-light:  #e8f0fb;
  --gov-blue-xlight: #f2f6fd;
  --gov-red:         #e1000f;
  --gray-50:  #f6f6f6;
  --gray-100: #ebebeb;
  --gray-200: #d8d8d8;
  --gray-300: #c0c0c0;
  --gray-400: #939393;
  --gray-600: #5c5c5c;
  --gray-700: #3d3d3d;
  --gray-800: #282828;
  --gray-900: #141414;
  --white:    #ffffff;
  --success:  #1f8d49;
  --error:    #ce0500;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  color: var(--gray-800);
  background: var(--gray-50);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { text-decoration: none; color: inherit; }
button { font-family: inherit; cursor: pointer; }
input, button { outline: none; }

/* ─── FLAG ─── */
.tricolor-flag {
  display: flex;
  width: 28px; height: 20px;
  border-radius: 3px;
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: 0 1px 4px rgba(0,0,0,.18);
}
.tricolor-flag--xs { width: 20px; height: 14px; }
.flag-blue  { flex: 1; background: #002395; }
.flag-white { flex: 1; background: #ffffff; }
.flag-red   { flex: 1; background: #ED2939; }

/* ═══════════════════════════════════════════════════════════════
   TOPBAR
═══════════════════════════════════════════════════════════════ */
.login-topbar {
  background: var(--white);
  border-bottom: 1px solid var(--gray-100);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 0 rgba(0,49,137,.05);
}
.login-topbar__inner {
  max-width: 1300px;
  margin: 0 auto;
  padding: 0 24px;
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.login-topbar__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  transition: opacity .2s;
}
.login-topbar__brand:hover { opacity: .85; }
.topbar-marianne {
  height: 30px;
  width: auto;
  object-fit: contain;
  flex-shrink: 0;
}
.login-topbar__text { display: flex; flex-direction: column; }
.rf-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--gov-blue);
  text-transform: uppercase;
  letter-spacing: .06em;
  line-height: 1.2;
}
.topbar-divider {
  width: 1px; height: 24px;
  background: var(--gray-200);
}
.portal-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-700);
}
.login-topbar__right {
  display: flex;
  align-items: center;
  gap: 20px;
}
.topbar-link {
  font-size: 13px;
  color: var(--gray-500);
  transition: color .2s;
}
.topbar-link:hover { color: var(--gov-blue); }

/* ═══════════════════════════════════════════════════════════════
   MAIN LAYOUT
═══════════════════════════════════════════════════════════════ */
.login-main {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: calc(100vh - 54px - 52px);
}

/* ═══════════════════════════════════════════════════════════════
   LEFT PANEL
═══════════════════════════════════════════════════════════════ */
.login-panel--left {
  background: linear-gradient(145deg, #001357 0%, #003189 45%, #1563c3 100%);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 48px;
}
.panel-bg {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 15% 80%, rgba(255,255,255,.06) 0%, transparent 50%),
    radial-gradient(circle at 85% 20%, rgba(255,255,255,.08) 0%, transparent 50%),
    repeating-linear-gradient(45deg, transparent, transparent 60px, rgba(255,255,255,.012) 60px, rgba(255,255,255,.012) 61px);
  pointer-events: none;
}
.panel-content {
  position: relative;
  z-index: 2;
  max-width: 440px;
  width: 100%;
}
.panel-logo {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 52px;
}
.panel-marianne {
  height: 52px;
  width: auto;
  object-fit: contain;
  opacity: .85;
}
.panel-rf {
  font-size: 12px;
  font-weight: 700;
  color: rgba(255,255,255,.7);
  text-transform: uppercase;
  letter-spacing: .1em;
  line-height: 1.3;
}
.panel-portal {
  font-size: 18px;
  font-weight: 800;
  color: var(--white);
  line-height: 1.2;
}
.panel-headline h2 {
  font-size: clamp(26px, 3vw, 36px);
  font-weight: 800;
  color: var(--white);
  line-height: 1.18;
  margin-bottom: 16px;
}
.panel-headline p {
  font-size: 15px;
  color: rgba(255,255,255,.72);
  line-height: 1.65;
  margin-bottom: 44px;
}
.panel-features {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: 40px;
}
.panel-feature {
  display: flex;
  align-items: center;
  gap: 16px;
}
.panel-feature__icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  background: rgba(255,255,255,.12);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  flex-shrink: 0;
}
.panel-feature div strong {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--white);
  margin-bottom: 2px;
}
.panel-feature div span {
  font-size: 12px;
  color: rgba(255,255,255,.55);
}
.panel-certifs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.certif-badge {
  padding: 4px 12px;
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  color: rgba(255,255,255,.8);
  letter-spacing: .06em;
}
/* Déco circles */
.panel-deco {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}
.panel-deco--1 {
  width: 320px; height: 320px;
  border: 1px solid rgba(255,255,255,.06);
  bottom: -120px; right: -80px;
}
.panel-deco--2 {
  width: 200px; height: 200px;
  border: 1px solid rgba(255,255,255,.08);
  top: 40px; right: 20px;
}
.panel-deco--3 {
  width: 80px; height: 80px;
  background: rgba(255,255,255,.04);
  top: 30%; left: -20px;
  animation: floatDeco 7s ease-in-out infinite;
}
@keyframes floatDeco {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-16px); }
}

/* ═══════════════════════════════════════════════════════════════
   RIGHT PANEL
═══════════════════════════════════════════════════════════════ */
.login-panel--right {
  background: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 40px;
}
.login-form-wrapper {
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* ─── TABS ─── */
.login-tabs {
  display: flex;
  gap: 4px;
  background: var(--gray-50);
  border: 1px solid var(--gray-100);
  border-radius: 12px;
  padding: 4px;
  margin-bottom: 28px;
}
.login-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border: none;
  background: transparent;
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-500);
  border-radius: 9px;
  transition: background .25s, color .25s, box-shadow .25s;
  cursor: pointer;
}
.login-tab:hover { color: var(--gray-800); }
.login-tab--active {
  background: var(--white);
  color: var(--gov-blue);
  box-shadow: 0 1px 4px rgba(0,49,137,.1), 0 2px 8px rgba(0,0,0,.06);
}
.fc-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 7px;
  background: linear-gradient(135deg, #003189, #1563c3);
  color: white;
  font-size: 10px;
  font-weight: 800;
  border-radius: 4px;
  letter-spacing: .04em;
}
.fc-dot--sm { font-size: 9px; padding: 2px 5px; }

/* ─── FC PANEL ─── */
.fc-section { display: flex; flex-direction: column; gap: 20px; }
.fc-header { margin-bottom: 4px; }
.fc-logo-main {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.fc-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  background: linear-gradient(135deg, #003189, #1563c3);
  color: white;
  font-size: 14px;
  font-weight: 900;
  border-radius: 6px;
  letter-spacing: .04em;
}
.fc-name {
  font-size: 18px;
  font-weight: 700;
  color: var(--gray-900);
}
.fc-desc {
  font-size: 14px;
  color: var(--gray-600);
  line-height: 1.6;
}
.fc-providers { display: flex; flex-direction: column; gap: 10px; }
.fc-providers__label {
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-400);
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: 4px;
}
.fc-provider-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--white);
  border: 1px solid var(--gray-100);
  border-radius: 12px;
  width: 100%;
  text-align: left;
  transition: border-color .2s, box-shadow .2s, transform .2s var(--ease-out), background .2s;
  cursor: pointer;
}
.fc-provider-btn:hover {
  border-color: var(--gov-blue);
  box-shadow: 0 2px 12px rgba(0,49,137,.10);
  transform: translateY(-1px);
  background: var(--gov-blue-xlight);
}
.fc-provider-btn:active { transform: translateY(0); }
.fc-provider-icon { flex-shrink: 0; }
.fc-provider-info { flex: 1; }
.fc-provider-info strong {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-900);
  line-height: 1.3;
}
.fc-provider-info span {
  font-size: 12px;
  color: var(--gray-500);
}
.fc-provider-arrow {
  color: var(--gray-300);
  flex-shrink: 0;
  transition: color .2s, transform .2s;
}
.fc-provider-btn:hover .fc-provider-arrow {
  color: var(--gov-blue);
  transform: translateX(3px);
}
.fc-info-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 12px 16px;
  background: var(--gov-blue-xlight);
  border: 1px solid var(--gov-blue-light);
  border-radius: 8px;
  font-size: 12px;
  color: var(--gray-600);
  line-height: 1.5;
}
.fc-info-note svg { color: var(--gov-blue); flex-shrink: 0; margin-top: 2px; }
.fc-info-note a { color: var(--gov-blue); font-weight: 500; text-decoration: underline; text-underline-offset: 2px; }

/* ─── FORM HEADER ─── */
.form-header {
  margin-bottom: 28px;
}
.form-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--gray-900);
  margin-bottom: 8px;
  line-height: 1.2;
}
.form-subtitle {
  font-size: 14px;
  color: var(--gray-500);
  line-height: 1.6;
}

/* ─── FORM ─── */
.login-form { display: flex; flex-direction: column; gap: 20px; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-700);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.form-label__forgot {
  font-size: 12px;
  font-weight: 500;
  color: var(--gov-blue);
  transition: opacity .2s;
}
.form-label__forgot:hover { opacity: .75; text-decoration: underline; }
.form-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.form-input-icon {
  position: absolute;
  left: 14px;
  color: var(--gray-300);
  pointer-events: none;
  transition: color .2s;
  flex-shrink: 0;
}
.form-input {
  width: 100%;
  padding: 12px 44px 12px 42px;
  border: 1.5px solid var(--gray-200);
  border-radius: 10px;
  font-size: 14px;
  color: var(--gray-900);
  background: var(--white);
  transition: border-color .2s, box-shadow .2s;
  appearance: none;
}
.form-input::placeholder { color: var(--gray-300); }
.form-input:focus {
  outline: none;
  border-color: var(--gov-blue);
  box-shadow: 0 0 0 3px rgba(21,99,195,.15);
}
.form-input:focus ~ .form-input-icon,
.form-input-wrap:focus-within .form-input-icon {
  color: var(--gov-blue);
}
.form-input.input--error { border-color: var(--error); }
.form-input.input--error:focus { box-shadow: 0 0 0 3px rgba(206,5,0,.12); }
.form-input.input--valid { border-color: var(--success); }
.toggle-pw {
  position: absolute;
  right: 12px;
  padding: 4px;
  background: none;
  border: none;
  color: var(--gray-300);
  cursor: pointer;
  transition: color .2s;
  display: flex;
  align-items: center;
}
.toggle-pw:hover { color: var(--gov-blue); }
.form-error {
  font-size: 12px;
  color: var(--error);
  display: none;
  align-items: center;
  gap: 5px;
}
.form-error.visible { display: flex; }
.form-group--inline { flex-direction: row; align-items: center; }
.checkbox-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--gray-600);
  cursor: pointer;
  user-select: none;
}
.checkbox-label input[type="checkbox"] { display: none; }
.checkbox-custom {
  width: 18px; height: 18px;
  border: 1.5px solid var(--gray-200);
  border-radius: 5px;
  background: var(--white);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color .2s, background .2s;
  position: relative;
}
.checkbox-label input:checked + .checkbox-custom {
  background: var(--gov-blue);
  border-color: var(--gov-blue);
}
.checkbox-label input:checked + .checkbox-custom::after {
  content: '';
  width: 10px; height: 6px;
  border-left: 2px solid white;
  border-bottom: 2px solid white;
  transform: rotate(-45deg) translateY(-1px);
  display: block;
}

/* ─── SUBMIT BUTTON ─── */
.btn-submit {
  width: 100%;
  padding: 14px 24px;
  background: linear-gradient(135deg, var(--gov-blue-mid) 0%, var(--gov-blue) 100%);
  color: var(--white);
  font-size: 15px;
  font-weight: 700;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 4px 16px rgba(0,49,137,.28);
  transition: transform .2s var(--ease-out), box-shadow .2s, opacity .2s;
  position: relative;
  overflow: hidden;
}
.btn-submit::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,.1);
  opacity: 0;
  transition: opacity .2s;
}
.btn-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,49,137,.35);
}
.btn-submit:hover::before { opacity: 1; }
.btn-submit:active { transform: translateY(0); }
.btn-submit.loading .btn-submit__text,
.btn-submit.loading svg:not(.spinner) { display: none; }
.btn-submit__loader { display: none; }
.btn-submit.loading .btn-submit__loader { display: flex; }
@keyframes spin { to { transform: rotate(360deg); } }
.spinner { animation: spin .8s linear infinite; }

/* ─── DIVIDER ─── */
.form-divider {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--gray-300);
  font-size: 12px;
  font-weight: 500;
}
.form-divider::before, .form-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--gray-100);
}

/* ─── FC SECONDARY BUTTON ─── */
.btn-fc-secondary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px;
  background: var(--gov-blue-xlight);
  border: 1.5px solid var(--gov-blue-light);
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  color: var(--gov-blue);
  transition: background .2s, border-color .2s, transform .2s;
}
.btn-fc-secondary:hover {
  background: var(--gov-blue-light);
  border-color: var(--gov-blue);
  transform: translateY(-1px);
  color: var(--gov-blue);
}

/* ─── CREATE ACCOUNT ─── */
.form-create-account {
  text-align: center;
  font-size: 13px;
  color: var(--gray-500);
}
.form-create-account a {
  color: var(--gov-blue);
  font-weight: 600;
  transition: opacity .2s;
}
.form-create-account a:hover { opacity: .75; text-decoration: underline; }

/* ─── ORANGE BUTTON ─── */
.btn-orange {
  width: 100%;
  margin-top: 16px;
  padding: 12px 20px;
  background: #ff7900;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background .2s, transform .1s;
}
.btn-orange:hover { background: #e66a00; }
.btn-orange:active { transform: scale(.98); }

/* ─── SECURITY NOTICE ─── */
.security-notice {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: var(--gray-50);
  border: 1px solid var(--gray-100);
  border-radius: 8px;
  font-size: 11.5px;
  color: var(--gray-500);
  margin-top: 24px;
}
.security-notice svg { color: var(--success); flex-shrink: 0; }

/* ─── BACK LINK ─── */
.back-link {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 20px;
  font-size: 13px;
  color: var(--gray-400);
  font-weight: 500;
  transition: color .2s;
  width: fit-content;
}
.back-link:hover { color: var(--gov-blue); }

/* ─── TAB PANELS ─── */
.tab-panel { display: none; animation: fadeIn .3s var(--ease-out); }
.tab-panel--active { display: block; }
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ═══════════════════════════════════════════════════════════════
   FOOTER
═══════════════════════════════════════════════════════════════ */
.login-footer {
  background: var(--white);
  border-top: 1px solid var(--gray-100);
  padding: 14px 0;
}
.login-footer__inner {
  max-width: 1300px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.login-footer__left {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--gray-400);
}
.login-footer__links {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}
.login-footer__links a {
  font-size: 12px;
  color: var(--gray-400);
  transition: color .2s;
}
.login-footer__links a:hover { color: var(--gov-blue); }

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════════════════════════ */
@media (max-width: 900px) {
  .login-main { grid-template-columns: 1fr; }
  .login-panel--left { display: none; }
  .login-panel--right { padding: 40px 24px; min-height: calc(100vh - 106px); }
  .login-form-wrapper { max-width: 100%; }
}
@media (max-width: 480px) {
  .login-tabs { flex-direction: column; }
  .login-footer__inner { flex-direction: column; align-items: flex-start; }
  .login-footer__links { gap: 12px; }
}

/* ─── FOCUS VISIBLE ─── */
*:focus-visible {
  outline: 2px solid var(--gov-blue);
  outline-offset: 3px;
  border-radius: 4px;
}

.hidden {
  display: none !important;
}

