/* CestSigné — styles authentification */

.auth-page {
  min-height: 100vh;
  background: linear-gradient(135deg, #0f4c81 0%, #1e6eb5 50%, #3b82f6 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.auth-card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0,0,0,.18);
  width: 100%;
  max-width: 440px;
  padding: 40px;
}

.auth-logo {
  display: flex;
  justify-content: center;
  margin-bottom: 28px;
  text-decoration: none;
}
.auth-logo img { height: 44px; width: auto; display: block; }

.auth-card h1 {
  font-size: 20px;
  font-weight: 700;
  color: #1a2332;
  text-align: center;
  margin-bottom: 6px;
}
.auth-card .auth-subtitle {
  text-align: center;
  color: #6b7280;
  font-size: 14px;
  margin-bottom: 28px;
}

/* Champs */
.auth-card .form-group label { color: #374151; font-size: 13px; font-weight: 600; margin-bottom: 5px; }
.auth-card .form-control {
  padding: 11px 14px;
  font-size: 15px;
  border: 1.5px solid #d1d5db;
  border-radius: 8px;
}
.auth-card .form-control:focus {
  border-color: #0f4c81;
  box-shadow: 0 0 0 3px rgba(15,76,129,.1);
}

/* Options (remember + forgot) */
.auth-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  font-size: 13px;
}
.auth-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  color: #374151;
}
.auth-checkbox input[type="checkbox"] { width: 16px; height: 16px; cursor: pointer; }
.auth-forgot { color: #0f4c81; font-weight: 500; }
.auth-forgot:hover { text-decoration: underline; }

/* Btn principal */
.auth-card .btn-primary {
  padding: 12px 20px;
  font-size: 15px;
  border-radius: 8px;
  background: #0f4c81;
}
.auth-card .btn-primary:hover { background: #0a3561; }

/* Séparateur */
.auth-separator {
  text-align: center;
  margin: 22px 0;
  position: relative;
  color: #9ca3af;
  font-size: 13px;
}
.auth-separator::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  width: 100%;
  height: 1px;
  background: #e5e7eb;
  z-index: 0;
}
.auth-separator span {
  position: relative;
  z-index: 1;
  background: #fff;
  padding: 0 12px;
}

/* Pied de formulaire */
.auth-footer {
  text-align: center;
  font-size: 14px;
  color: #6b7280;
  margin-top: 22px;
}
.auth-footer a { color: #0f4c81; font-weight: 600; }

/* Indicateur de force mot de passe */
.password-strength {
  margin-top: 6px;
  height: 4px;
  border-radius: 4px;
  background: #e5e7eb;
  overflow: hidden;
}
.password-strength-bar {
  height: 100%;
  border-radius: 4px;
  transition: width .3s, background .3s;
  width: 0;
}
.password-strength-text { font-size: 11px; color: #6b7280; margin-top: 3px; }

/* Champ mot de passe avec toggle */
.input-group { position: relative; }
.input-group .form-control { padding-right: 44px; }
.input-toggle {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: #9ca3af;
  font-size: 18px;
  line-height: 1;
  padding: 2px;
}
.input-toggle:hover { color: #374151; }

/* Step indicator (multi-étapes) */
.auth-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 28px;
  gap: 0;
}
.auth-step {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #9ca3af;
  font-weight: 500;
}
.auth-step.active { color: #0f4c81; }
.auth-step.done   { color: #059669; }
.auth-step-dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}
.auth-step.active .auth-step-dot { background: #0f4c81; color: #fff; }
.auth-step.done .auth-step-dot   { background: #059669; color: #fff; }
.auth-step-line {
  height: 2px;
  width: 30px;
  background: #e5e7eb;
}
.auth-step-line.done { background: #059669; }

/* ---- Captcha widget ---- */
.captcha-group { margin-top: 8px; }
.captcha-group > label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #374151;
  margin-bottom: 6px;
}

.captcha-box {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
  padding: 12px 14px;
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 14px;
  row-gap: 4px;
  align-items: center;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
  transition: border-color .2s;
}
.captcha-box.captcha-error {
  border-color: #dc2626;
  background: #fef2f2;
}

/* Checkbox custom */
.captcha-checkbox { grid-row: 1 / span 2; position: relative; }
.captcha-box .checkbox-wrapper { margin: 0; position: relative; overflow: visible; }

.captcha-box .checkbox-wrapper input[type="checkbox"] {
  opacity: 0;
  position: absolute;
  width: 0;
  height: 0;
  margin: 0;
}
.captcha-box .checkbox-wrapper label {
  margin: 0;
  display: inline-block;
  width: 36px;
  height: 36px;
  cursor: pointer;
  position: relative;
}
/* Carré */
.captcha-box .checkbox-wrapper label:before {
  content: '';
  display: block;
  width: 36px;
  height: 36px;
  border: 2px solid #9ca3af;
  border-radius: 3px;
  background: #fff;
  transition: all .3s ease;
  position: relative;
  z-index: 2;
}
.captcha-box .checkbox-wrapper label:hover:before {
  border-color: #6b7280;
  background: #f3f4f6;
}
.captcha-box .checkbox-wrapper input[type="checkbox"]:disabled + label:before {
  background: #f3f4f6;
  border-color: #d1d5db;
  cursor: not-allowed;
}
/* Coché : fond vert */
.captcha-box .checkbox-wrapper input[type="checkbox"]:checked + label:before {
  border-color: #059669;
  background: #059669;
}
/* Coche animée */
.captcha-box .checkbox-wrapper input[type="checkbox"]:checked + label:after {
  content: '';
  position: absolute;
  left: 13px;
  top: 7px;
  width: 8px;
  height: 16px;
  border: solid #fff;
  border-width: 0 3px 3px 0;
  transform: rotate(45deg);
  animation: captchaCheckmark .3s ease forwards;
  z-index: 3;
}
/* Lignes d'éclatement au clic */
.captcha-box .checkbox-wrapper::after {
  content: '';
  position: absolute;
  left: 18px;
  top: 18px;
  width: 0;
  height: 0;
  border-radius: 50%;
  background:
    linear-gradient(0deg,     transparent 49%, #d97706 49.5%, #d97706 50.5%, transparent 51%),
    linear-gradient(45deg,    transparent 49%, #d97706 49.5%, #d97706 50.5%, transparent 51%),
    linear-gradient(90deg,    transparent 49%, #d97706 49.5%, #d97706 50.5%, transparent 51%),
    linear-gradient(135deg,   transparent 49%, #d97706 49.5%, #d97706 50.5%, transparent 51%),
    linear-gradient(22.5deg,  transparent 49%, #d97706 49.5%, #d97706 50.5%, transparent 51%),
    linear-gradient(67.5deg,  transparent 49%, #d97706 49.5%, #d97706 50.5%, transparent 51%),
    linear-gradient(112.5deg, transparent 49%, #d97706 49.5%, #d97706 50.5%, transparent 51%),
    linear-gradient(157.5deg, transparent 49%, #d97706 49.5%, #d97706 50.5%, transparent 51%);
  mask: radial-gradient(circle, transparent 35%, black 40%, black 90%, transparent 95%);
  -webkit-mask: radial-gradient(circle, transparent 35%, black 40%, black 90%, transparent 95%);
  opacity: 0;
  transform: translate(-50%, -50%) scale(.1);
  pointer-events: none;
  z-index: 0;
}
.captcha-box .checkbox-wrapper:has(input[type="checkbox"]:checked)::after {
  width: 100px;
  height: 100px;
  animation: captchaBurst .6s ease forwards;
}

@keyframes captchaCheckmark {
  0%   { height: 0;   width: 0;  opacity: 0; }
  50%  { height: 16px; width: 8px; opacity: 1; }
  100% { height: 16px; width: 8px; opacity: 1; }
}
@keyframes captchaBurst {
  0%   { opacity: 1; transform: translate(-50%, -50%) scale(.1); }
  50%  { opacity: 1; transform: translate(-50%, -50%) scale(.8); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1.2); }
}

/* Texte */
.captcha-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.captcha-title {
  font-size: 14px;
  font-weight: 500;
  color: #1a2332;
}
.captcha-box.captcha-error .captcha-title { color: #dc2626; }
.captcha-box .form-text { margin: 0; font-size: 12px; }

/* Responsive */
@media (max-width: 480px) {
  .auth-card { padding: 28px 20px; }
  .auth-logo  { font-size: 22px; }
}
