/* Fidelis • Login Page */

:root {
  --input-height: 48px;
  --spacing: 24px;
}

html,
body {
  height: 100%;
  margin: 0;
}

body {
  display: grid;
  place-items: center;
  background: 
    radial-gradient(1000px 600px at 110% -20%, var(--bg-tint), transparent 60%),
    radial-gradient(900px 500px at -10% 120%, var(--card-tint), transparent 60%),
    var(--bg);
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, sans-serif;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Container principal */
.login-container {
  width: 100%;
  max-width: 440px;
  padding: 20px;
}

/* Card */
.login-card {
  padding: 48px 40px;
  background: linear-gradient(180deg, var(--card), var(--card-tint));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

@media (max-width: 480px) {
  .login-card {
    padding: 32px 24px;
  }
}

/* Header */
.login-header {
  text-align: center;
  margin-bottom: 40px;
}

.login-logo {
  width: 80px;
  height: 80px;
  margin: 0 auto 24px;
  display: block;
  border-radius: 20px;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.15);
}

.login-title {
  margin: 0 0 8px;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 0.2px;
  color: var(--text);
}

.login-subtitle {
  margin: 0;
  font-size: 15px;
  color: var(--muted);
  font-weight: 500;
}

/* Form */
.login-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

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

.form-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.2px;
}

/* Input overrides */
.login-form .input {
  height: var(--input-height);
  padding: 0 16px;
  font-size: 15px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fff;
  transition: all 0.2s ease;
}

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

.login-form .input:hover {
  border-color: var(--primary);
}

.login-form .input:focus-visible {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Password wrapper */
.password-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.password-wrapper .input {
  padding-right: 52px;
}

.password-toggle {
  position: absolute;
  right: 8px;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  transition: all 0.2s ease;
}

.password-toggle:hover {
  border-color: var(--primary);
  background: rgba(37, 99, 235, 0.05);
}

.password-toggle:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.eye-icon {
  width: 20px;
  height: 20px;
  fill: #64748b;
  transition: fill 0.2s ease;
}

.password-toggle:hover .eye-icon {
  fill: var(--primary);
}

/* Error message */
.form-error {
  display: none;
  padding: 12px 16px;
  border-radius: 10px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
  font-size: 14px;
  font-weight: 500;
  margin-top: -8px;
}

.form-error:not(:empty) {
  display: block;
}

/* Button */
.btn-primary {
  width: 100%;
  height: 52px;
  margin-top: 8px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.3px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--primary), var(--primary-600));
  border: none;
  color: #fff;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
}

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

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* Footer links */
.login-footer {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin-top: 24px;
  font-size: 14px;
}

.link {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s ease;
}

.link:hover {
  color: var(--primary-600);
  text-decoration: underline;
}

.separator {
  color: var(--muted);
}

/* Brand */
.login-brand {
  text-align: center;
  margin-top: 24px;
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
}

/* Loading state */
.btn-primary.loading {
  position: relative;
  color: transparent;
}

.btn-primary.loading::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  top: 50%;
  left: 50%;
  margin-left: -10px;
  margin-top: -10px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* Responsive */
@media (max-width: 480px) {
  .login-title {
    font-size: 24px;
  }
  
  .login-subtitle {
    font-size: 14px;
  }
  
  .login-footer {
    flex-direction: column;
    gap: 8px;
  }
  
  .separator {
    display: none;
  }
}

/* AJOUTEZ TOUT CE BLOC À LA FIN DU FICHIER */

/* ==============================
   MODALE MOT DE PASSE OUBLIÉ
   ============================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: fadeIn 0.2s ease-out;
}

.modal-overlay.hidden {
  display: none;
}

.modal {
  position: relative;
  width: 100%;
  max-width: 440px;
  padding: 48px 40px;
  animation: slideIn 0.3s ease-out;
}

.modal .login-title {
    font-size: 24px;
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  color: var(--muted);
  display: grid;
  place-items: center;
  border-radius: 99px;
  transition: background-color 0.2s, color 0.2s;
}

.modal-close:hover {
  background-color: var(--bg-tint);
  color: var(--text);
}

.modal-close svg {
    width: 20px;
    height: 20px;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideIn {
  from { 
    opacity: 0;
    transform: translateY(20px); 
  }
  to { 
    opacity: 1;
    transform: translateY(0); 
  }
}