/* =============================================
   AUTH PAGES — SHARED STYLESHEET
   =============================================
   Utilisé par toutes les pages : login, register,
   forgot-password, verify-reset-code, new-password,
   two-factor.
   ============================================= */

/* === BASE BODY === */
body.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    /* Default theme — bleu/violet (login, two-factor) */
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* Thème rose/rouge — reset password pages */
body.auth-page.theme-reset {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

/* Thème vert — register */
body.auth-page.theme-register {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
}

/* === STRUCTURE === */
.auth-container {
    width: 100%;
    max-width: 460px;
    padding: 15px;
}

/* Carte principale */
.auth-card {
    background: white;
    border-radius: 20px;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    animation: slideUp 0.6s ease;
}

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

/* === HEADER === */
.auth-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-align: center;
    padding: 45px 30px;
    position: relative;
}

.auth-header::after {
    content: "";
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 5px;
    background: linear-gradient(90deg, rgba(255,255,255,0.2), transparent);
}

.auth-header h1 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
}

.auth-header p {
    margin: 0;
    opacity: 0.9;
    font-size: 14px;
}

/* Header — thème reset */
.theme-reset .auth-header {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

/* Header — thème register */
.theme-register .auth-header {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
}

/* === LOGO === */
.auth-logo {
    width: 80px;
    height: 80px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.auth-logo i {
    font-size: 36px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.theme-reset .auth-logo i {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.theme-register .auth-logo i {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* === FORMULAIRE (BODY) === */
.auth-body {
    padding: 40px 30px;
}

.form-floating {
    margin-bottom: 20px;
    position: relative;
}

.form-floating > .form-control {
    border-radius: 12px;
    border: 2px solid #e9ecef;
    padding: 1rem 0.75rem;
    height: calc(3.5rem + 2px);
    transition: all 0.3s;
    font-size: 15px;
}

.form-floating > .form-control:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.25rem rgba(102, 126, 234, 0.2);
}

.theme-reset .form-floating > .form-control:focus {
    border-color: #f093fb;
    box-shadow: 0 0 0 0.2rem rgba(240, 147, 251, 0.15);
}

.theme-register .form-floating > .form-control:focus {
    border-color: #11998e;
    box-shadow: 0 0 0 0.2rem rgba(17, 153, 142, 0.15);
}

.form-floating > label {
    padding: 1rem 0.75rem;
}

/* === INPUT ICON / PASSWORD TOGGLE === */
.input-icon {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
    z-index: 4;
}

.password-toggle {
    cursor: pointer;
    user-select: none;
    transition: color 0.3s;
}

.password-toggle:hover {
    color: #667eea;
}

/* === BOUTONS — BASE COMMUNE === */
.btn-auth {
    width: 100%;
    padding: 14px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 12px;
    border: none;
    color: white;
    transition: all 0.3s;
    margin-top: 10px;
}

.btn-auth:hover:not(:disabled) {
    transform: translateY(-2px);
    color: white;
}

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

.btn-auth:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Bouton login — bleu/violet */
.btn-login,
.btn-auth.btn-primary-theme {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.btn-login:hover:not(:disabled),
.btn-auth.btn-primary-theme:hover:not(:disabled) {
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.4);
    color: white;
}

/* Bouton reset — rose/rouge */
.btn-auth.btn-reset-theme {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.btn-auth.btn-reset-theme:hover:not(:disabled) {
    box-shadow: 0 10px 25px rgba(240, 147, 251, 0.4);
    color: white;
}

/* Bouton register — vert */
.btn-auth.btn-register-theme {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
}

.btn-auth.btn-register-theme:hover:not(:disabled) {
    box-shadow: 0 10px 25px rgba(17, 153, 142, 0.4);
    color: white;
}

/* Loading state */
.loading-spinner {
    display: none;
}

.loading .loading-spinner {
    display: inline-block;
}

.loading .btn-text {
    display: none;
}

/* === ALERTES === */
.alert {
    border-radius: 12px;
    border: none;
    margin-bottom: 20px;
}

/* === CODE INPUTS (2FA + reset verify) === */
.code-inputs {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin: 30px 0;
}

.code-input {
    width: 60px;
    height: 70px;
    text-align: center;
    font-size: 32px;
    font-weight: 700;
    border: 3px solid #e9ecef;
    border-radius: 12px;
    transition: all 0.3s;
    background: #f8f9fa;
}

.code-input:focus {
    background: white;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.15);
    outline: none;
    border-color: #667eea;
}

.theme-reset .code-input:focus {
    border-color: #f093fb;
    box-shadow: 0 0 0 0.2rem rgba(240, 147, 251, 0.15);
}

.code-input.filled {
    background: white;
    border-color: #38ef7d;
}

/* === PASSWORD STRENGTH === */
.password-strength {
    height: 4px;
    background: #e9ecef;
    border-radius: 2px;
    margin-top: 8px;
    overflow: hidden;
}

.password-strength-bar {
    height: 100%;
    transition: all 0.3s;
    width: 0%;
}

.password-strength-bar.weak { background: #dc3545; width: 33%; }
.password-strength-bar.medium { background: #ffc107; width: 66%; }
.password-strength-bar.strong { background: #198754; width: 100%; }

/* === INFO BOX === */
.info-box {
    background: #f8f9fa;
    border-left: 4px solid #667eea;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.theme-reset .info-box {
    border-left-color: #f093fb;
}

/* === RESEND LINK (2FA) === */
.resend-link {
    text-align: center;
    margin-top: 20px;
}

.resend-link a {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
}

.resend-link a:hover {
    text-decoration: underline;
}

.timer {
    display: inline-block;
    font-weight: 700;
    color: #667eea;
}

/* === FOOTER (INSIDE CARD) === */
.auth-footer {
    text-align: center;
    padding: 20px 30px 30px;
    background: #f8f9fa;
}

.auth-footer a {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
}

.auth-footer a:hover {
    text-decoration: underline;
}

/* === FOOTER COPYRIGHT (UNDER CARD) === */
.auth-copyright {
    text-align: center;
    margin-top: 20px;
}

.auth-copyright p {
    color: rgba(255, 255, 255, 0.9);
    margin: 0;
}

.auth-copyright small {
    font-size: 13px;
}

/* === OCR-THEME === */
.ocr-tagline {
    font-size: 13px;
    opacity: 0.8;
}

/* === RESPONSIVE === */
@media (max-width: 480px) {
    .auth-body {
        padding: 25px;
    }

    .code-input {
        width: 48px;
        height: 58px;
        font-size: 24px;
    }
}
