body {
    background-color: rgba(163, 177, 211, 0.15);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    min-height: 100dvh;
    height: 100vh;
    height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding-bottom: env(safe-area-inset-bottom);
}

.login-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.logo-section {
    margin-bottom: 40px;
}

.main-logo {
    color: #6889DD;
    font-size: 24px;
    font-weight: 600;
    text-align: center;
}

.login-form {
    background: white;
    border: 1px solid #A3B1D3;
    border-radius: 8px;
    padding: 32px;
    width: 100%;
    box-sizing: border-box;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.form-title {
    text-align: center;
    font-size: 20px;
    font-weight: 600;
    color: #333;
    margin: 0 0 24px 0;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 14px;
    color: #333;
    margin-bottom: 6px;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
    transition: border-color 0.2s;
}

.form-group input:focus {
    outline: none;
    border-color: #6889DD;
    box-shadow: 0 0 0 2px rgba(104, 137, 221, 0.1);
}

.btn-primary {
    width: 100%;
    background-color: #6889DD;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 12px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    margin: 24px 0 16px 0;
    transition: background-color 0.2s;
}

.btn-primary:hover {
    background-color: #5575C5;
}

.btn-primary:disabled {
    background-color: #9ca3af;
    cursor: not-allowed;
}

.form-links {
    text-align: center;
    margin: 16px 0;
}

.forgot-password {
    color: #6889DD;
    text-decoration: none;
    font-size: 14px;
}

.forgot-password:hover {
    text-decoration: underline;
}

.register-link {
    color: #666;
    text-decoration: none;
    font-size: 14px;
}

.link-text {
    color: #6889DD;
    text-decoration: underline;
}

.divider {
    text-align: center;
    margin: 24px 0;
    position: relative;
    color: #666;
    font-size: 14px;
}

.divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background-color: #ddd;
    z-index: 1;
}

.divider span {
    background: white;
    padding: 0 16px;
    position: relative;
    z-index: 2;
}

.btn-google {
    width: 100%;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 12px;
    font-size: 14px;
    color: #333;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background-color 0.2s;
    box-sizing: border-box;
}

.btn-google:hover {
    background-color: #f5f5f5;
}

.btn-google i {
    color: #4285F4;
    font-size: 16px;
    line-height: 1;
    display: flex;
    align-items: center;
}

/* Bouton secondaire (outline) aligné au design du login */
.btn-outline {
    width: 100%;
    background: #fff;
    border: 1px solid #6889DD;
    color: #6889DD;
    border-radius: 4px;
    padding: 12px;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    box-sizing: border-box;
    transition: background-color 0.2s, color 0.2s;
}
.btn-outline:link,
.btn-outline:visited,
.btn-outline:hover,
.btn-outline:active {
    text-decoration: none;
}
.btn-outline:hover {
    background-color: #f3f4f6;
    text-decoration: none;
}

/* Styles pour les messages d'erreur */
.alert {
    padding: 12px;
    margin-bottom: 16px;
    border-radius: 4px;
    font-size: 14px;
}

.alert-danger {
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* Hero header for mobile */
.auth-hero { display: none; }

@media (max-width: 640px) {
  /* Conserver la charte: couleurs et rayons d’origine */
  body { background: rgba(163, 177, 211, 0.15); overflow: hidden; }
  .login-container { padding: 16px; }
  .login-form { margin-top: 8px; border-radius: 8px; padding: 20px; box-shadow: 0 2px 10px rgba(0,0,0,0.1); border: 1px solid #A3B1D3; }
  .form-title { display: block; text-align: left; font-size: 22px; margin: 0 0 16px 0; }
  .form-group { margin-bottom: 14px; }
  .form-group input { padding: 14px; font-size: 16px; }
  .btn-primary { height: 48px; font-size: 16px; border-radius: 4px; margin-top: 16px; }
  .divider { margin: 20px 0; }
  .btn-google { height: 48px; border-radius: 4px; font-weight: 600; }
  .login-form::before, .login-form::after { content: none; }
  /* Formulaire plein écran bas: largeur 100%, hauteur 2/3 de l’écran, collé en bas */
  #loginForm {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 66vh; /* 2/3 de la hauteur */
    max-height: 66vh;
    margin: 0;
    box-sizing: border-box;
    overflow-y: auto;
    z-index: 10;
    padding-bottom: max(16px, env(safe-area-inset-bottom));
  }

  #loginForm .form-title {
    margin-bottom: 2rem;
    font-size: 1.5rem;
  }
  .logo-section { display: block; text-align: center; padding: 16px 16px 8px; position: absolute; top: 13rem;}
  .main-logo { display: inline-block; }
}

@media (max-width: 640px) {
  /* Onboarding 2FA plein écran bas */
  .twofa-onboarding .login-container { padding: 16px; }
  .twofa-onboarding .login-form { position: fixed; left: 0; right: 0; bottom: 0; width: 100vw; height: 90vh; max-height: 95vh; margin: 0; box-sizing: border-box; overflow-y: auto; z-index: 10; padding: 16px; padding-bottom: max(16px, env(safe-area-inset-bottom)); }
  .twofa-onboarding .form-title { text-align: left; font-size: 22px; margin-bottom: 16px; }
  .twofa-onboarding .logo-section { display: block; text-align: center; padding: 16px 16px 8px; position: absolute; top: 1rem; }
  .twofa-onboarding .main-logo { display: inline-block; }
  #twofa-qr { max-width: 280px; max-height: 280px; }
}