/* ============================================================
   AUTH PAGES STYLES (Sign-In, Sign-Up, Forgot Password)
   ============================================================ */

.auth-main {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding-top: var(--h-height); /* Avoid overlap with fixed header */
    overflow-x: hidden;
    background-color: var(--bg-dark);
}

/* --- FONDS ET ORBES --- */
.auth-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden;
}

.auth-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.4;
    animation: authOrbFloat 20s infinite ease-in-out alternate;
}

.orb-1 {
    width: 600px;
    height: 600px;
    background: var(--uvci-purple);
    top: -150px;
    left: -150px;
}

.orb-2 {
    width: 500px;
    height: 500px;
    background: var(--uvci-green);
    bottom: -100px;
    right: -100px;
    animation-delay: -5s;
}

.orb-3 {
    width: 400px;
    height: 400px;
    background: var(--uvci-purple-light);
    top: 40%;
    right: 15%;
    opacity: 0.2;
    animation-duration: 25s;
}

@keyframes authOrbFloat {
    0% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(30px, -50px) scale(1.1); }
    66% { transform: translate(-20px, 40px) scale(0.95); }
    100% { transform: translate(0, 0) scale(1); }
}

.auth-overlay {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, transparent 0%, rgba(7, 3, 10, 0.4) 100%);
    z-index: 1;
}

/* --- CONTAINER ET CARD --- */
.auth-section {
    position: relative;
    z-index: 2;
    width: 100%;
    padding: 60px 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-container {
    width: 100%;
    max-width: 1380px;
    margin: 0 auto;
}

.auth-card-wrap {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    animation: authFadeUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

.auth-card {
    background: rgba(13, 18, 32, 0.55);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 40px; /* Slightly more rounded for premium feel */
    overflow: hidden;
    display: flex;
    box-shadow: 0 60px 120px -30px rgba(0, 0, 0, 0.7);
}

/* --- COLONNES --- */
.auth-side-info {
    flex: 1;
    background: linear-gradient(135deg, rgba(142, 21, 130, 0.15) 0%, rgba(24, 168, 85, 0.05) 100%);
    padding: 60px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    border-right: 1px solid rgba(255, 255, 255, 0.05);
}

.auth-side-form {
    flex: 1.9;
    padding: 64px 72px;
    background: rgba(0, 0, 0, 0.15);
}

/* --- LOGO ET INFO SIDE --- */
.auth-logo {
    display: inline-block;
    margin-bottom: 40px;
}

.auth-logo img {
    height: 80px;
    width: auto;
    filter: drop-shadow(0 0 15px rgba(142, 21, 130, 0.3));
    transition: transform 0.3s ease;
}

.auth-logo img:hover {
    transform: scale(1.05);
}

.auth-title {
    font-family: 'Syne', sans-serif;
    font-weight: 800;
    font-size: 2.2rem;
    color: #fff;
    margin-bottom: 16px;
    letter-spacing: -0.5px;
    line-height: 1.2;
}

.highlight-green { color: var(--uvci-green); }
.highlight-purple { color: #b32eb8; }

.auth-subtitle {
    font-size: 1.15rem;
    color: var(--muted);
    line-height: 1.7;
    max-width: 450px;
    opacity: 0.9;
}

/* --- FORMULAIRE --- */
.auth-form {
    width: 100%;
}

.auth-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px 18px;
    align-items: start;
}

.auth-group {
    margin-bottom: 0;
    min-width: 0;
}

.auth-group-full {
    grid-column: 1 / -1;
}

.auth-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 8px;
}

.auth-label-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.auth-input-icon {
    position: relative;
}

.auth-input-icon i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.25);
    font-size: 0.9rem;
    transition: color 0.3s;
}

.auth-input {
    width: 100%;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 16px 16px 16px 48px;
    color: #fff;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.95rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.auth-input-icon .auth-input {
    padding-right: 46px;
}

.auth-password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: color 0.2s;
}

.auth-password-toggle:hover {
    color: rgba(255, 255, 255, 0.9);
}

.auth-password-toggle:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(24, 168, 85, 0.22);
}

.auth-input:focus {
    outline: none;
    border-color: var(--uvci-green);
    background: rgba(0, 0, 0, 0.45);
    box-shadow: 0 0 0 4px rgba(24, 168, 85, 0.15);
}

.auth-input:focus + i {
    color: var(--uvci-green);
    opacity: 1;
}

/* Fix browser autofill background */
.auth-input:-webkit-autofill,
.auth-input:-webkit-autofill:hover,
.auth-input:-webkit-autofill:focus {
    -webkit-text-fill-color: #fff;
    -webkit-box-shadow: 0 0 0px 1000px #0a0416 inset;
    transition: background-color 5000s ease-in-out 0s;
}

.auth-input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

/* --- BOUTON SUBMIT --- */
.auth-btn-submit {
    position: relative;
    width: 100%;
    padding: 18px;
    border: none;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--uvci-purple) 0%, #b32eb8 100%);
    color: #fff;
    font-family: 'Syne', sans-serif;
    font-weight: 700;
    font-size: 1.05rem;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    margin-top: 4px;
    box-shadow: 0 10px 30px -10px rgba(142, 21, 130, 0.5);
}

.auth-btn-submit:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 35px -10px rgba(142, 21, 130, 0.7);
    background: linear-gradient(135deg, #a11ca4 0%, #c43cc9 100%);
}

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

.btn-glow {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    transform: translateX(-100%);
    transition: transform 0.5s;
}

.auth-btn-submit:hover .btn-glow {
    transform: translateX(100%);
}

/* --- LIENS ET TEXTES --- */
.auth-link, .auth-forgot-link {
    color: var(--uvci-green);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    transition: opacity 0.2s;
}

.auth-link:hover, .auth-forgot-link:hover {
    opacity: 0.8;
}

.auth-footer-text {
    font-size: 0.9rem;
    color: var(--muted);
}

/* --- CHECKBOX CUSTOM --- */
.auth-checkbox {
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
    gap: 10px;
}

.auth-checkbox input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
    pointer-events: none;
}

.checkmark {
    width: 18px;
    height: 18px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.05);
    position: relative;
    transition: all 0.2s;
}

.auth-checkbox input:checked ~ .checkmark {
    background: var(--uvci-green);
    border-color: var(--uvci-green);
}

.checkmark::after {
    content: "";
    position: absolute;
    left: 5px;
    top: 1px;
    width: 5px;
    height: 10px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg) scale(0);
    transform-origin: center;
    transition: transform 0.2s;
    opacity: 0;
}

.auth-checkbox input:checked ~ .checkmark::after {
    transform: rotate(45deg) scale(1);
    opacity: 1;
}

.auth-checkbox input:focus-visible ~ .checkmark {
    box-shadow: 0 0 0 3px rgba(24, 168, 85, 0.22);
}

.cb-label-text {
    font-size: 0.85rem;
    color: var(--muted);
}

.auth-terms-error {
    display: none;
    margin-top: 8px;
}

.auth-terms-error.visible {
    display: block;
}

.auth-checkbox.invalid .checkmark {
    border-color: #ff6b6b;
    box-shadow: 0 0 0 2px rgba(255, 107, 107, 0.18);
}

.auth-checkbox.invalid .cb-label-text {
    color: rgba(255, 140, 140, 0.95);
}

/* --- ALERTES --- */
.auth-alert {
    padding: 12px 16px;
    border-radius: 10px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.85rem;
}

.alert-success {
    background: rgba(24, 168, 85, 0.1);
    border: 1px solid rgba(24, 168, 85, 0.3);
    color: #1edd69;
}

.alert-error {
    background: rgba(255, 107, 107, 0.1);
    border: 1px solid rgba(255, 107, 107, 0.3);
    color: #ff6b6b;
}

.auth-error-msg {
    font-size: 0.75rem;
    color: #ff6b6b;
    margin-top: 5px;
    display: block;
}

/* --- RESPONSIVE --- */
@media (max-width: 992px) {
    .auth-card {
        flex-direction: column;
    }
    
    .auth-side-info {
        padding: 40px 20px;
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
        text-align: center;
        align-items: center;
    }
    
    .auth-side-form {
        padding: 40px 28px;
    }

    .auth-form-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 18px 14px;
    }
    
    .auth-logo {
        margin-bottom: 24px;
    }
    
    .auth-logo img {
        height: 60px;
    }
    
    .auth-title {
        font-size: 1.8rem;
    }
    
    .auth-subtitle {
        font-size: 0.95rem;
    }
}

@media (max-width: 576px) {
    .auth-card {
        border-radius: 16px;
    }
    
    .auth-section {
        padding: 20px 6px; /* Minimal margin from edges to maximize form width */
    }
    
    .auth-side-info, .auth-side-form {
        padding: 30px 12px; /* Tighter padding for mobile input fields */
    }

    .auth-form-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .auth-group-full {
        grid-column: auto;
    }

    .auth-logo img {
        height: 50px;
    }

    .auth-title {
        font-size: 1.2rem;
    }

    .auth-input {
        padding-top: 15px;
        padding-bottom: 15px;
    }
}
