/* =============================================================
   ACIM SMS — Styles communs aux pages d'authentification
   (login, mot de passe oublié, reset, register, MFA)
   ============================================================= */

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body {
  height: 100%;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* ====== LAYOUT SPLIT ====== */
.auth-container {
  display: flex;
  min-height: 100vh;
  width: 100vw;
}

/* ====== PANNEAU GAUCHE : BRANDING ====== */
.auth-brand {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 40px;
  background: linear-gradient(135deg, #FEF7F7 0%, #FDECEA 50%, #FDF0EF 100%);
  position: relative;
  overflow: hidden;
}

.auth-brand .brand-content {
  position: relative;
  z-index: 1;
}

.auth-brand .brand-logo {
  width: 120px;
  height: 120px;
  border-radius: 20px;
  object-fit: contain;
  background: #fff;
  padding: 10px;
  box-shadow: 0 6px 24px rgba(194, 33, 40, 0.12);
  margin-bottom: 30px;
}

.auth-brand h1 {
  font-size: 2.2rem;
  font-weight: 700;
  margin-bottom: 12px;
  letter-spacing: -0.5px;
  color: #C22128;
}

.auth-brand p {
  font-size: 1.05rem;
  color: #6E7687;
  max-width: 400px;
  line-height: 1.6;
  margin-bottom: 30px;
}

.brand-features {
  display: flex;
  flex-direction: column;
  gap: 14px;
  text-align: left;
}

.brand-features .feature {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.95rem;
  color: #4A4A4A;
}

.brand-features .feature i {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(194, 33, 40, 0.08);
  color: #C22128;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}

/* Icône décorative (MFA shield, etc.) */
.auth-brand .brand-shield {
  margin-top: 30px;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: rgba(194, 33, 40, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  color: #C22128;
}


/* ====== PANNEAU DROIT : FORMULAIRE ====== */
.auth-form-panel {
  width: 480px;
  min-width: 400px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 50px 40px;
  background: #fff;
  box-shadow: -2px 0 16px rgba(0,0,0,0.04);
}

.auth-form-panel.auth-form-wide {
  width: 540px;
  min-width: 440px;
  padding: 40px 36px;
  overflow-y: auto;
}

.auth-form-wrapper {
  width: 100%;
  max-width: 360px;
}

.auth-form-panel.auth-form-wide .auth-form-wrapper {
  max-width: 440px;
}


/* ====== TITRES ====== */
.auth-form-wrapper h2 {
  font-size: 1.6rem;
  font-weight: 700;
  color: #2D2D3A;
  margin-bottom: 6px;
}

.auth-form-wrapper h2 i {
  color: #C22128;
  margin-right: 8px;
}

.auth-form-wrapper .subtitle {
  color: #6c757d;
  font-size: 0.9rem;
  margin-bottom: 30px;
}


/* ====== FORMULAIRE ====== */
.auth-form-wrapper .form-group {
  margin-bottom: 20px;
}

.auth-form-wrapper label {
  font-weight: 600;
  font-size: 0.85rem;
  color: #495057;
  margin-bottom: 6px;
  display: block;
}

.auth-form-wrapper label i {
  color: #C22128;
  margin-right: 4px;
}

.auth-form-wrapper .form-control {
  height: 48px;
  border-radius: 10px;
  border: 1.5px solid #dee2e6;
  padding: 10px 16px;
  font-size: 0.95rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.auth-form-wrapper .form-control:focus {
  border-color: #C22128;
  box-shadow: 0 0 0 3px rgba(194, 33, 40, 0.12);
}

/* Icônes dans les inputs */
.input-icon-wrapper { position: relative; }

.input-icon-wrapper .input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #adb5bd;
  font-size: 1rem;
}

.input-icon-wrapper .form-control {
  padding-left: 42px;
}

.input-icon-wrapper .togglePassword {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #adb5bd;
  cursor: pointer;
  padding: 4px 8px;
  z-index: 2;
}

.input-icon-wrapper .togglePassword:hover {
  color: #495057;
}


/* ====== OTP INPUT (MFA) ====== */
.otp-input {
  text-align: center;
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: 12px;
  height: 60px !important;
  border-radius: 12px;
  border: 2px solid #dee2e6;
}

.otp-input:focus {
  border-color: #C22128;
  box-shadow: 0 0 0 3px rgba(194, 33, 40, 0.12);
}


/* ====== EMAIL HINT (MFA) ====== */
.auth-email-hint {
  background: #FEF7F7;
  border: 1px solid rgba(194, 33, 40, 0.1);
  border-radius: 8px;
  padding: 10px 16px;
  margin-bottom: 24px;
  font-size: 0.85rem;
  color: #495057;
  text-align: center;
}

.auth-email-hint i {
  color: #C22128;
  margin-right: 6px;
}

.auth-email-hint strong {
  color: #C22128;
}


/* ====== BOUTONS ====== */
.btn-auth {
  height: 48px;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 600;
  background: linear-gradient(135deg, #C22128, #9B1A20);
  border: none;
  color: #fff;
  transition: transform 0.15s, box-shadow 0.15s;
  letter-spacing: 0.3px;
}

.btn-auth:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(194, 33, 40, 0.4);
  color: #fff;
}

.btn-auth:active {
  transform: translateY(0);
}


/* ====== LIENS ====== */
.auth-link {
  text-align: center;
  margin-top: 16px;
}

.auth-link a {
  color: #C22128;
  font-weight: 600;
  font-size: 0.88rem;
  text-decoration: none;
}

.auth-link a:hover {
  text-decoration: underline;
  color: #9B1A20;
}

.auth-link-muted a {
  color: #6c757d;
  font-weight: 400;
}

.auth-link-muted a:hover {
  color: #C22128;
}

/* Resend section (MFA) */
.resend-section {
  text-align: center;
  margin-top: 20px;
}

.resend-section .resend-text {
  color: #6c757d;
  font-size: 0.85rem;
  margin-bottom: 8px;
}

.resend-section .btn-resend {
  background: none;
  border: none;
  color: #C22128;
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  text-decoration: underline;
}

.resend-section .btn-resend:hover {
  color: #9B1A20;
}

/* Timer (MFA) */
.timer-info {
  text-align: center;
  margin-top: 12px;
  font-size: 0.78rem;
  color: #adb5bd;
}

.timer-info i { margin-right: 4px; }


/* ====== FOOTER ====== */
.auth-footer {
  margin-top: 40px;
  text-align: center;
  color: #adb5bd;
  font-size: 0.8rem;
}


/* ====== ALERTES ====== */
.alert-auth {
  border-radius: 10px;
  font-size: 0.88rem;
  padding: 12px 16px;
  margin-bottom: 20px;
}


/* ====== SELECT2 (Register) ====== */
.auth-form-wrapper .select2-container .select2-selection--single {
  height: 44px !important;
  border-radius: 10px !important;
  border: 1.5px solid #dee2e6 !important;
  padding: 6px 14px;
}

.auth-form-wrapper .select2-container .select2-selection__rendered {
  line-height: 30px !important;
}

.auth-form-wrapper .select2-container .select2-selection__arrow {
  height: 42px !important;
}


/* ====== LOADING ====== */
#loading {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: #fff;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}


/* ====== RESPONSIVE ====== */
@media (max-width: 992px) {
  .auth-brand { display: none; }
  .auth-form-panel,
  .auth-form-panel.auth-form-wide {
    width: 100%;
    min-width: auto;
  }
}

@media (max-width: 576px) {
  .auth-form-panel { padding: 30px 24px; }
  .auth-form-wrapper h2 { font-size: 1.3rem; }
  .otp-input { font-size: 1.5rem; letter-spacing: 8px; height: 50px !important; }
}
