:root {
  color-scheme: light;
  --color-bg: #e6ebf5;
  --color-card: rgba(255, 255, 255, 0.85);
  --color-border: rgba(255, 255, 255, 0.65);
  --color-text: #121826;
  --color-muted: #5f6473;
  --color-primary: #2563eb;
  --color-primary-dark: #1d4ed8;
  --color-danger: #dc2626;
  --color-success: #059669;
  --shadow-lg: 0 30px 60px rgba(15, 23, 42, 0.25);
  --amazonie: #02b074;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: radial-gradient(circle at 20% 20%, rgba(2, 176, 116, 0.08), transparent 40%),
    radial-gradient(circle at 60% 0%, rgba(37, 99, 235, 0.15), transparent 40%),
    var(--color-bg);
  color: var(--color-text);
  padding: 32px;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url('../images/accueil.jpg');
  background-size: cover;
  background-position: center;
  filter: blur(6px) saturate(1.1);
  opacity: 0.2;
  pointer-events: none;
  z-index: 0;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}

label {
  font-weight: 600;
  font-size: 0.95rem;
}

input {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(18, 24, 38, 0.08);
  background: rgba(255, 255, 255, 0.9);
  font-size: 1rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

input:focus {
  outline: none;
  border-color: rgba(2, 176, 116, 0.8);
  box-shadow: 0 0 0 4px rgba(2, 176, 116, 0.15);
}

button {
  border: none;
  border-radius: 16px;
  padding: 16px 18px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

button:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.btn-primary {
  color: #fff;
  background: linear-gradient(135deg, var(--amazonie), #04c384);
  width: 100%;
  box-shadow: 0 18px 30px rgba(2, 176, 116, 0.25);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 24px 32px rgba(2, 176, 116, 0.35);
}

.auth-feedback {
  border-radius: 12px;
  padding: 14px;
  font-size: 0.95rem;
  margin-top: 16px;
  display: none;
}

.auth-feedback.is-visible {
  display: block;
}

.auth-feedback.error {
  background: rgba(220, 38, 38, 0.08);
  border: 1px solid rgba(220, 38, 38, 0.35);
  color: var(--color-danger);
}

.auth-feedback.success {
  background: rgba(5, 150, 105, 0.1);
  border: 1px solid rgba(5, 150, 105, 0.3);
  color: var(--color-success);
}

.is-hidden {
  display: none;
}

.auth-stack {
  display: block;
}

.auth-stack.is-hidden,
.is-hidden {
  display: none;
}

.auth-inline {
  display: flex;
  justify-content: flex-end;
  margin-top: 12px;
}

.auth-link {
  background: none;
  padding: 0;
  border: none;
  border-radius: 0;
  box-shadow: none;
  width: auto;
  color: var(--amazonie);
  font-weight: 600;
  font-size: 0.95rem;
}

.auth-link:hover {
  text-decoration: underline;
}

.reset-header h2 {
  margin: 0 0 6px;
  font-size: 1.35rem;
}

.reset-help {
  margin: 0 0 20px;
  color: var(--color-muted);
  font-size: 0.95rem;
}

.code-input {
  text-align: center;
  letter-spacing: 0;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.auth-meta {
  text-align: center;
  margin-top: 24px;
  color: var(--color-muted);
}

.auth-meta a {
  color: var(--amazonie);
  text-decoration: none;
  font-weight: 600;
}

.auth-meta a:hover {
  text-decoration: underline;
}

@media (max-width: 540px) {
  body {
    padding: 16px;
  }
}

body.auth-login-page {
  min-height: 100vh;
  min-height: 100dvh;
  display: block;
  padding: 0;
  overflow-x: hidden;
  overflow-y: auto;
  background: #dfe8ea;
  color: #294452;
}

body.auth-login-page::before {
  display: none;
}

.login-viewport {
  position: relative;
  isolation: isolate;
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 76px 28px 58px;
  overflow: hidden;
}

.login-viewport::before,
.login-viewport::after {
  content: '';
  position: absolute;
  pointer-events: none;
}

.login-viewport::before {
  inset: -18px;
  z-index: -3;
  background-image:
    linear-gradient(120deg, rgba(236, 243, 244, 0.95) 0%, rgba(236, 243, 244, 0.76) 46%, rgba(77, 105, 119, 0.58) 100%),
    url('../images/accueil.jpg');
  background-size: cover;
  background-position: center;
  filter: grayscale(1) contrast(1.04);
  transform: scale(1.02);
}

.login-viewport::after {
  inset: 0;
  z-index: -2;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.58)),
    linear-gradient(90deg, rgba(255, 255, 255, 0.88) 0%, rgba(255, 255, 255, 0.54) 48%, rgba(41, 68, 82, 0.28) 100%);
}

.login-brand {
  position: fixed;
  top: 30px;
  left: 34px;
  z-index: 2;
}

.login-brand img {
  width: 152px;
  height: auto;
  display: block;
  filter: drop-shadow(0 12px 22px rgba(41, 68, 82, 0.16));
}

.login-panel {
  position: relative;
  z-index: 1;
  width: min(430px, calc(100vw - 40px));
  max-height: calc(100dvh - 120px);
  overflow: auto;
  padding: 30px;
  border: 1px solid rgba(77, 105, 119, 0.2);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 28px 70px rgba(41, 68, 82, 0.22), 0 1px 0 rgba(255, 255, 255, 0.72) inset;
  backdrop-filter: blur(18px);
}

.login-panel-header {
  position: relative;
  margin-bottom: 26px;
}

.login-mode-badge {
  position: absolute;
  top: 0;
  right: 0;
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 9px;
  border: 1px solid rgba(47, 128, 96, 0.24);
  border-radius: 999px;
  background: rgba(47, 128, 96, 0.08);
  color: #2f8060;
  font-size: 11px;
  font-weight: 650;
  line-height: 1;
}

.login-eyebrow {
  margin: 0 0 10px;
  color: #6a7d86;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.12em;
  line-height: 1.2;
  text-transform: uppercase;
}

.login-panel h1 {
  margin: 0 0 8px;
  color: #233d4a;
  font-size: clamp(34px, 5vw, 48px);
  font-weight: 760;
  letter-spacing: 0;
  line-height: 0.96;
}

.login-intro {
  max-width: 320px;
  margin: 0;
  color: #607681;
  font-size: 14px;
  font-weight: 450;
  line-height: 1.45;
}

body.auth-login-page label {
  color: #294452;
  font-size: 13px;
  font-weight: 650;
}

body.auth-login-page input {
  min-height: 46px;
  border-color: rgba(77, 105, 119, 0.22);
  border-radius: 8px;
  background: rgba(250, 252, 252, 0.92);
  color: #203845;
  font-size: 14px;
}

body.auth-login-page input::placeholder {
  color: #8da0a8;
}

body.auth-login-page input:focus {
  border-color: rgba(47, 128, 96, 0.5);
  box-shadow: 0 0 0 4px rgba(47, 128, 96, 0.12);
}

body.auth-login-page.is-local-login input[readonly] {
  background: rgba(255, 255, 255, 0.78);
  color: #4d6977;
  cursor: default;
}

body.auth-login-page button {
  border-radius: 8px;
}

body.auth-login-page .btn-primary {
  background: linear-gradient(135deg, #3b9273, #2f8060);
  box-shadow: 0 16px 30px rgba(47, 128, 96, 0.24);
  font-weight: 720;
}

body.auth-login-page .btn-primary:hover:not(:disabled) {
  box-shadow: 0 20px 34px rgba(47, 128, 96, 0.3);
}

body.auth-login-page .auth-inline {
  margin-top: 13px;
}

body.auth-login-page .auth-link {
  color: #4d6977;
  font-size: 13px;
  font-weight: 650;
}

body.auth-login-page .auth-feedback {
  margin-top: 14px;
  border-radius: 8px;
  font-size: 13px;
}

body.auth-login-page .reset-header h2 {
  color: #233d4a;
  font-size: 24px;
  font-weight: 720;
}

body.auth-login-page .reset-help,
body.auth-login-page .auth-meta {
  color: #607681;
}

body.auth-login-page .auth-meta a {
  color: #2f8060;
}

.login-auth-meta {
  margin-top: 22px;
  font-size: 13px;
}

.login-system-strip {
  position: fixed;
  right: 30px;
  bottom: 24px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: rgba(41, 68, 82, 0.74);
  font-size: 11px;
  font-weight: 680;
  letter-spacing: 0.08em;
  line-height: 1;
  text-transform: uppercase;
}

.login-system-strip span + span {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.login-system-strip span + span::before {
  content: '';
  width: 4px;
  height: 4px;
  border-radius: 999px;
  background: currentColor;
  opacity: 0.5;
}

@media (max-width: 720px) {
  .login-viewport {
    place-items: start center;
    padding: 94px 20px 44px;
  }

  .login-brand {
    top: 24px;
    left: 22px;
  }

  .login-brand img {
    width: 132px;
  }

  .login-panel {
    width: 100%;
    max-height: none;
    padding: 24px;
  }

  .login-mode-badge {
    position: static;
    margin-bottom: 14px;
  }

  .login-system-strip {
    position: static;
    justify-self: center;
    margin-top: 22px;
    text-align: center;
  }
}

body.auth-login-page {
  overflow: hidden;
  background: #f4f7f7;
}

body.auth-login-page .login-viewport {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(430px, 49vw) minmax(0, 1fr);
  place-items: stretch;
  padding: 0;
  background: #f7fafa;
}

body.auth-login-page .login-viewport::before,
body.auth-login-page .login-viewport::after {
  display: none;
}

.login-left-panel {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 42px clamp(36px, 7vw, 128px);
  background:
    linear-gradient(90deg, rgba(250, 247, 241, 0.98) 0%, rgba(246, 241, 232, 0.96) 72%, rgba(237, 231, 221, 0.86) 100%);
  overflow-y: auto;
}

.login-left-panel::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 48%, rgba(77, 105, 119, 0.105), rgba(77, 105, 119, 0) 36%),
    radial-gradient(circle at 16% 16%, rgba(47, 128, 96, 0.07), rgba(47, 128, 96, 0) 30%),
    radial-gradient(circle at 82% 84%, rgba(190, 168, 128, 0.18), rgba(190, 168, 128, 0) 36%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.58), rgba(233, 224, 209, 0.48)),
    repeating-linear-gradient(135deg, rgba(92, 78, 58, 0.045) 0 1px, transparent 1px 8px);
  opacity: 0.9;
}

.login-left-inner {
  width: min(100%, 620px);
  display: grid;
  place-items: center;
  position: relative;
  z-index: 1;
}

body.auth-login-page .login-brand {
  position: absolute;
  top: 30px;
  left: 32px;
  z-index: 2;
  margin-bottom: 0;
}

body.auth-login-page .login-brand img {
  width: 150px;
}

.login-welcome {
  display: none;
  margin-bottom: 30px;
}

.login-welcome-eyebrow {
  margin: 0 0 12px;
  color: #2f8060;
  font-size: 13px;
  font-weight: 760;
  letter-spacing: 0.06em;
  line-height: 1.2;
  text-transform: uppercase;
}

.login-welcome h1 {
  max-width: 560px;
  margin: 0 0 14px;
  color: #23404d;
  font-size: clamp(30px, 3vw, 46px);
  font-weight: 680;
  letter-spacing: 0;
  line-height: 1.08;
}

.login-welcome p {
  max-width: 520px;
  margin: 0;
  color: #5d727c;
  font-size: 16px;
  font-weight: 450;
  line-height: 1.55;
}

body.auth-login-page .login-panel {
  width: min(100%, 500px);
  margin-inline: auto;
  max-height: none;
  overflow: visible;
  padding: 28px;
  border: 1px solid rgba(77, 105, 119, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 20px 46px rgba(77, 105, 119, 0.14);
  backdrop-filter: blur(12px);
}

.login-panel-welcome {
  margin-bottom: 22px;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(77, 105, 119, 0.14);
}

.login-panel-welcome .login-welcome-eyebrow {
  margin-bottom: 8px;
}

.login-panel-welcome h1 {
  max-width: 390px;
  margin: 0 0 10px;
  color: #23404d;
  font-size: clamp(25px, 2vw, 32px);
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.12;
}

.login-panel-welcome p:last-child {
  max-width: 400px;
  margin: 0;
  color: #5d727c;
  font-size: 14px;
  font-weight: 450;
  line-height: 1.45;
}

body.auth-login-page .login-panel h2 {
  margin: 0 0 8px;
  color: #233d4a;
  font-size: 25px;
  font-weight: 720;
  letter-spacing: 0;
  line-height: 1.04;
}

body.auth-login-page .login-panel-header {
  margin-bottom: 20px;
}

.login-audience-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin: -4px 0 20px;
  padding: 4px;
  border: 1px solid rgba(77, 105, 119, 0.18);
  border-radius: 6px;
  background: #eef2f3;
}

.login-audience-switch button {
  min-height: 38px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #58707b;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.login-audience-switch button.is-active {
  background: #ffffff;
  color: #23404d;
  box-shadow: 0 1px 4px rgba(35, 64, 77, 0.12);
}

.login-card-slider {
  position: relative;
  width: 100%;
  overflow: hidden;
}

.login-card-track {
  display: flex;
  align-items: flex-start;
  width: 100%;
  transform: translateX(0);
  transition: transform 320ms cubic-bezier(0.2, 0.72, 0.2, 1);
  will-change: transform;
}

.login-card-slider.is-recovery .login-card-track {
  transform: translateX(-100%);
}

.login-card-slider.is-verification .login-card-track {
  transform: translateX(-200%);
}

.login-card-screen {
  flex: 0 0 100%;
  min-width: 100%;
  transition: opacity 220ms ease, transform 320ms cubic-bezier(0.2, 0.72, 0.2, 1);
}

.login-card-screen--login {
  opacity: 1;
  transform: translateX(0);
}

.login-card-screen--recovery,
.login-card-screen--verification {
  opacity: 0;
  transform: translateX(14px);
  pointer-events: none;
}

.login-card-slider.is-recovery .login-card-screen--login {
  opacity: 0;
  transform: translateX(-14px);
  pointer-events: none;
}

.login-card-slider.is-recovery .login-card-screen--recovery {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
}

.login-card-slider.is-verification .login-card-screen--login,
.login-card-slider.is-verification .login-card-screen--recovery {
  opacity: 0;
  transform: translateX(-14px);
  pointer-events: none;
}

.login-card-slider.is-verification .login-card-screen--verification {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
}

body.auth-login-page .auth-inline-between {
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.auth-muted-line {
  min-width: 0;
  color: #607681;
  font-size: 12px;
  font-weight: 560;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.auth-login-page .login-intro {
  max-width: 310px;
  font-size: 13px;
  line-height: 1.4;
}

body.auth-login-page .form-group {
  margin-bottom: 16px;
}

@media (prefers-reduced-motion: reduce) {
  .login-card-track,
  .login-card-screen {
    transition: none;
  }
}

.login-carousel {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
  background: #d9e1df;
}

.login-carousel-track,
.login-carousel-slide,
.login-carousel-slide img {
  position: absolute;
  inset: 0;
}

.login-carousel-slide {
  margin: 0;
  opacity: 0;
  transform: scale(1.02);
  transition: opacity 900ms ease, transform 5200ms ease;
}

.login-carousel-slide.is-active {
  opacity: 1;
  transform: scale(1);
}

.login-carousel-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.login-carousel::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(247, 250, 250, 0.16) 0%, rgba(21, 36, 44, 0.08) 40%, rgba(21, 36, 44, 0.34) 100%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.1), rgba(21, 36, 44, 0.24));
  pointer-events: none;
}

.login-carousel-content {
  position: absolute;
  right: clamp(28px, 5vw, 74px);
  bottom: clamp(60px, 9vh, 96px);
  z-index: 2;
  max-width: 390px;
  color: #ffffff;
  text-align: right;
  text-shadow: 0 12px 30px rgba(21, 36, 44, 0.35);
}

.login-carousel-content p {
  margin: 0 0 12px;
  font-size: 12px;
  font-weight: 760;
  letter-spacing: 0.16em;
  line-height: 1.2;
  text-transform: uppercase;
}

.login-carousel-content h2 {
  margin: 0;
  font-size: clamp(28px, 3vw, 46px);
  font-weight: 760;
  letter-spacing: 0;
  line-height: 1.06;
}

.login-carousel-dots {
  position: absolute;
  right: clamp(28px, 5vw, 74px);
  bottom: 34px;
  z-index: 2;
  display: inline-flex;
  gap: 8px;
}

.login-carousel-dots span {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.55);
  box-shadow: 0 4px 10px rgba(21, 36, 44, 0.16);
  transition: width 240ms ease, background 240ms ease;
}

.login-carousel-dots span.is-active {
  width: 24px;
  background: #ffffff;
}

@media (max-width: 980px) {
  body.auth-login-page {
    overflow-y: auto;
  }

  body.auth-login-page .login-viewport {
    grid-template-columns: 1fr;
    min-width: 0;
  }

  .login-left-panel {
    width: 100%;
    min-width: 0;
    min-height: auto;
    padding: 100px 22px 34px;
    order: 1;
  }

  .login-left-inner {
    width: min(100%, 520px);
    min-width: 0;
  }

  body.auth-login-page .login-brand {
    top: 22px;
    left: 22px;
    margin-bottom: 0;
  }

  .login-welcome {
    margin-bottom: 22px;
  }

  .login-welcome h1 {
    font-size: clamp(28px, 8vw, 38px);
  }

  body.auth-login-page .login-panel {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    padding: 24px;
  }

  .login-card-slider,
  .login-card-track,
  .login-card-screen {
    min-width: 0;
    max-width: 100%;
  }

  .login-panel-welcome h1 {
    font-size: clamp(25px, 7vw, 32px);
  }

  .login-carousel {
    min-height: 38vh;
    order: 2;
  }

  .login-carousel-content {
    left: 22px;
    right: 22px;
    bottom: 52px;
    max-width: none;
    text-align: left;
  }

  .login-carousel-dots {
    left: 22px;
    right: auto;
    bottom: 24px;
  }
}
