/* ===== PCSM-CI — Connexion ===== */
:root {
  --orange: #F77F00;
  --orange-light: #FF9E2C;
  --orange-dark: #D96B00;
  --orange-rgb: 247, 127, 0;
  --green: #009E60;
  --green-light: #00B86E;
  --green-dark: #007A4D;
  --green-darker: #005C3A;
  --green-rgb: 0, 158, 96;
  --gray-900: #1A2421;
  --gray-600: #4A5753;
  --gray-400: #6B7A75;
  --gray-300: #94A39E;
  --gray-100: #E2E8E6;
  --gray-50: #F4F7F6;
  --white: #FFFFFF;
  --error-bg: #FEF2F2;
  --error-border: #FECACA;
  --error-text: #991B1B;
  --font-body: 'DM Sans', system-ui, sans-serif;
  --font-display: 'Outfit', system-ui, sans-serif;
  --radius: 12px;
  --radius-lg: 14px;
  --transition: 0.22s ease;
  --login-touch: 3rem;
}

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

html {
  height: 100%;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body.login-page {
  min-height: 100%;
  min-height: 100dvh;
  font-family: var(--font-body);
  color: var(--gray-900);
  background: #F4F7FB;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* --- Layout --- */
.login-layout {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}

/* ===== PANNEAU GAUCHE ===== */
.login-info {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 2rem;
  padding: 2rem 1.75rem;
  overflow: hidden;
  /* Couleurs explicites (pas via variable) */
  background-color: #005C3A;
  background-image: linear-gradient(145deg, #007A4D 0%, #005C3A 45%, #1A2421 100%);
  color: #FFFFFF;
}

.login-info::before {
  content: '';
  position: absolute;
  top: -80px;
  right: -80px;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: rgba(247, 127, 0, 0.18);
  pointer-events: none;
}

.login-info::after {
  content: '';
  position: absolute;
  bottom: -60px;
  left: -40px;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  pointer-events: none;
}

.login-info > * {
  position: relative;
  z-index: 1;
}

.login-info__brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.login-info__logo {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: contain;
  background: #FFFFFF;
  padding: 3px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.login-info__name {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: #FFFFFF;
  letter-spacing: 0.03em;
}

.login-info__content {
  flex: 1;
}

.login-info__title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 6vw, 3rem);
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 1rem;
  color: #FFFFFF;
}

.login-info__title-accent {
  display: block;
  width: 3.5rem;
  height: 4px;
  margin-bottom: 1.25rem;
  border-radius: 4px;
  background: linear-gradient(90deg, #F77F00, #FF9E2C);
}

.login-info__desc {
  font-size: clamp(0.92rem, 2.8vw, 1.05rem);
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.9);
  max-width: 30rem;
}

.login-info__desc strong {
  color: #FFFFFF;
  font-weight: 600;
}

.login-info__features {
  list-style: none;
  margin-top: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.login-info__features li {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: clamp(0.88rem, 2.5vw, 0.98rem);
  color: rgba(255, 255, 255, 0.95);
}

.login-info__features i {
  flex-shrink: 0;
  width: 1.5rem;
  height: 1.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 0.6rem;
  background: rgba(247, 127, 0, 0.9);
  color: #FFFFFF;
}

.login-info__footer {
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.6);
  line-height: 1.55;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  padding-top: 1.25rem;
}

.login-info__footer p + p {
  margin-top: 0.2rem;
}

/* ===== PANNEAU DROIT ===== */
.login-form-panel {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem;
  background: #F4F7FB;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.login-form-wrap {
  width: min(100%, 400px);
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 0;
}

.login-form-header {
  margin-bottom: 1.75rem;
  padding-bottom: 0;
  border-bottom: none;
}

.login-form-header__badge {
  display: none;
}

.login-form-header h2 {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 4.5vw, 1.75rem);
  font-weight: 700;
  color: #1A2421;
  margin-bottom: 0.4rem;
}

.login-form-header p {
  font-size: clamp(0.88rem, 3vw, 0.95rem);
  color: #64748B;
  line-height: 1.5;
}

/* --- Alerte --- */
.login-alert {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  margin-bottom: 1.25rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius);
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--error-text);
  background: var(--error-bg);
  border: 1px solid var(--error-border);
}

.login-alert i { flex-shrink: 0; margin-top: 0.1rem; }

/* --- Champs --- */
.login-form__field {
  margin-bottom: 0.85rem;
}

.login-form__field > label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.login-input {
  position: relative;
  width: 100%;
}

.login-input__icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  font-size: 0.9rem;
  color: #94A3B8;
  pointer-events: none;
  line-height: 1;
}

.login-input input {
  display: block;
  width: 100%;
  min-height: var(--login-touch);
  padding: 0.75rem 2.85rem 0.75rem 2.75rem;
  border: none;
  border-radius: 10px;
  font-family: var(--font-body);
  font-size: max(16px, 0.95rem);
  color: #1A2421;
  background: #EEF2F7;
  transition: background var(--transition), box-shadow var(--transition);
  -webkit-appearance: none;
  appearance: none;
}

.login-input input::placeholder {
  color: #94A3B8;
}

.login-input input:focus {
  outline: none;
  border: none;
  background: #E8EEF6;
  box-shadow: 0 0 0 2px rgba(0, 122, 77, 0.2);
}

.login-input input:focus + .login-input__toggle,
.login-input:focus-within .login-input__icon {
  color: #64748B;
}

.login-input--error input {
  background: #FEF2F2;
  box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.15);
}

.login-input__toggle {
  position: absolute;
  right: 0.4rem;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border: none;
  border-radius: 8px;
  color: #94A39E;
  background: transparent;
  cursor: pointer;
  touch-action: manipulation;
}

.login-input__toggle:hover {
  color: #4A5753;
  background: #F1F5F4;
}

.login-input__toggle:focus-visible {
  outline: 2px solid #F77F00;
  outline-offset: 2px;
}

/* --- Options --- */
.login-form__options {
  display: flex;
  align-items: center;
  margin: 0.25rem 0 1.35rem;
}

.login-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.88rem;
  color: #4A5753;
  cursor: pointer;
  user-select: none;
}

.login-checkbox input {
  width: 1.05rem;
  height: 1.05rem;
  accent-color: #007A4D;
  cursor: pointer;
}

/* --- Bouton --- */
.login-form__submit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  width: 100%;
  min-height: var(--login-touch);
  padding: 0.9rem 1.5rem;
  border: none;
  border-radius: 10px;
  font-family: var(--font-display);
  font-size: clamp(0.92rem, 3.2vw, 1rem);
  font-weight: 600;
  letter-spacing: 0.01em;
  text-transform: none;
  color: #FFFFFF;
  background: #007A4D;
  box-shadow: none;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: background var(--transition), opacity var(--transition);
}

.login-form__submit:hover:not(:disabled) {
  background: #005C3A;
  transform: none;
  box-shadow: none;
}

.login-form__submit:active:not(:disabled) { transform: translateY(0); }
.login-form__submit:disabled { opacity: 0.75; cursor: wait; }

.login-form__submit.is-loading i {
  animation: login-spin 0.8s linear infinite;
}

@keyframes login-spin { to { transform: rotate(360deg); } }

/* --- Pied --- */
.login-form-footer {
  margin-top: 1.75rem;
  padding-top: 0;
  border-top: none;
  text-align: center;
  font-size: 0.9rem;
  color: #64748B;
}

.login-form-footer a {
  font-weight: 700;
  color: #007A4D;
  text-decoration: none;
}

.login-form-footer a:hover {
  color: #009E60;
  text-decoration: underline;
}

/* ===== RESPONSIVE ===== */
@media (min-width: 768px) {
  .login-layout {
    flex-direction: row;
  }

  .login-info,
  .login-form-panel {
    flex: 1;
    width: 50%;
    min-height: 100dvh;
  }

  .login-info {
    padding: 2.75rem 3rem;
  }

  .login-form-panel {
    padding: 2rem;
  }

  .login-form-wrap {
    width: min(100%, 440px);
  }
}

@media (min-width: 1024px) {
  .login-info { padding: 3.5rem 4rem; }
}

@media (max-width: 767px) {
  .login-info {
    gap: 1.25rem;
    padding: 1.5rem 1.25rem;
  }

  .login-info__title { font-size: 1.75rem; }
  .login-info__features { margin-top: 1rem; gap: 0.6rem; }
  .login-info__footer { display: none; }
}

@media (max-width: 359px) {
  .login-form__options {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-height: 520px) and (orientation: landscape) {
  .login-layout { flex-direction: row; }

  .login-info,
  .login-form-panel {
    min-height: 100dvh;
    overflow-y: auto;
  }

  .login-info { padding: 1rem; gap: 0.75rem; }
  .login-info__title { font-size: 1.35rem; }
  .login-info__title-accent { margin-bottom: 0.75rem; }
  .login-info__features,
  .login-info__footer { display: none; }

  .login-form-panel { padding: 0.75rem; align-items: flex-start; }
  .login-form-wrap { padding: 1.15rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  .login-form__submit:hover:not(:disabled) { transform: none; }
}
