/* ================================================
   AUTH PAGES (LOGIN & REGISTER) - UNIFIED DESIGN
   ================================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Signika', sans-serif;
    overflow: hidden; /* Empêcher tout scroll sur les pages auth */
}

footer.main-footer {
    display: none;
}

/* Navbar réduite sur pages auth (pas de main-links) */
.navbar {
    height: 90px !important;
}

.navbar-nav.main-links {
    display: none !important;
}

/* Animated Background */
.animated-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--gradient-hero);
    background-size: cover;
    z-index: -2;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.blob {
    position: absolute;
    border-radius: var(--radius-full);
    filter: blur(80px);
    opacity: 0.5;
    animation: float 20s infinite ease-in-out;
}

.blob:nth-child(1) {
    width: 300px;
    height: 300px;
    background: rgba(132, 79, 192, 0.6);
    top: 10%;
    left: 10%;
    animation-delay: 0s;
}

.blob:nth-child(2) {
    width: 400px;
    height: 400px;
    background: rgba(255, 67, 101, 0.6);
    top: 50%;
    right: 10%;
    animation-delay: 5s;
}

.blob:nth-child(3) {
    width: 350px;
    height: 350px;
    background: rgba(73, 182, 160, 0.6);
    bottom: 10%;
    left: 30%;
    animation-delay: 10s;
}

.blob:nth-child(4) {
    width: 250px;
    height: 250px;
    background: rgba(79, 141, 192, 0.6);
    bottom: 30%;
    right: 30%;
    animation-delay: 15s;
}

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

/* Container */
.container-auth {
    height: calc(100vh - 90px);
    margin-top: 90px; /* Aligné avec hauteur navbar réduite */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    z-index: 1;
    overflow: hidden;
}

/* Main Card - Glassmorphism */
.main-card-auth {
    background: rgba(255, 255, 255, 0.22);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    border-radius: var(--radius-xl);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: var(--shadow-xl);
    padding: 35px 45px; /* Réduit de 50px à 35px */
    width: 100%;
    max-width: 600px;
    max-height: calc(100vh - 130px); /* Limite la hauteur (90px navbar + 40px padding) */
    overflow-y: auto; /* Scroll interne si nécessaire */
    animation: slideIn 0.6s ease-out;
}

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

/* Logo du formulaire uniquement (exclut le logo de la navbar) */
.main-card-auth .logo {
    text-align: center;
    margin-bottom: 20px; /* Réduit de 30px */
    display: flex;
    justify-content: center;
    align-items: center;
}

.main-card-auth .logo img {
    max-width: 100px; /* Réduit de 120px */
    height: auto;
    filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.2));
    animation: logoFloat 3s ease-in-out infinite;
}

@keyframes logoFloat {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* Title Section */
.ti_subti {
    text-align: center;
    margin-bottom: 25px; /* Réduit de 35px */
}

.title {
    font-family: var(--font-family-display);
    font-size: clamp(1.7rem, 1.3rem + 1.6vw, 2.2rem);
    font-weight: 500;
    letter-spacing: -0.01em;
    color: white;
    margin-bottom: 8px; /* Réduit de 10px */
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.subtitle {
    font-size: 1rem; /* Réduit de 1.1rem */
    font-weight: 400;
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 0 1px 5px rgba(0, 0, 0, 0.1);
}

/* Flash Messages */
.flash-message {
    padding: 15px 20px;
    border-radius: var(--radius-xl);
    margin-bottom: 25px;
    font-size: 0.95rem;
    animation: fadeIn 0.5s ease-out;
}

.flash-message.error,
.flash-message.danger {
    background: rgba(255, 67, 101, 0.2);
    border: 1px solid rgba(255, 67, 101, 0.5);
    color: white;
}

.flash-message.success {
    background: rgba(73, 182, 160, 0.2);
    border: 1px solid rgba(73, 182, 160, 0.5);
    color: white;
}

.flash-message.warning {
    background: rgba(255, 193, 7, 0.2);
    border: 1px solid rgba(255, 193, 7, 0.5);
    color: white;
}

.flash-message a {
    color: white;
    text-decoration: underline;
    font-weight: 600;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Form Container */
.form-container {
    margin-bottom: 15px; /* Réduit de 25px */
}

.form-container form {
    width: 100%;
}

.input-container {
    display: flex;
    flex-direction: column;
    gap: 12px; /* Réduit de 20px */
    margin-bottom: 20px; /* Réduit de 25px */
}

.input-group {
    position: relative;
    width: 100%;
}

.input-group input {
    width: 80%;
    margin: auto;
    padding: 8px 20px;
    font-size: 1rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--radius-xl);
    color: rgb(31, 31, 31);
    transition: var(--transition-normal);
    font-family: 'Signika', sans-serif;
}

.input-group input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.input-group input:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.6);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.2);
}

.input-group input:-webkit-autofill,
.input-group input:-webkit-autofill:hover,
.input-group input:-webkit-autofill:focus {
    -webkit-text-fill-color: rgb(31, 31, 31);
    -webkit-box-shadow: 0 0 0px 1000px rgba(255, 255, 255, 0.2) inset;
    transition: background-color 5000s ease-in-out 0s;
}

/* Checkbox */
.checkbox-container {
    margin-bottom: 25px;
    display: flex;
    /* La case et le lien d'oubli se partagent la ligne, chacun à un bord :
       l'un est un réglage, l'autre une sortie de secours. */
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.forgot-link {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.9rem;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.forgot-link:hover,
.forgot-link:focus-visible {
    color: #ffffff;
}

.checkbox-container label {
    display: flex;
    align-items: center;
    color: white;
    font-size: 0.95rem;
    cursor: pointer;
    user-select: none;
}

.checkbox-container input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-right: 10px;
    cursor: pointer;
    accent-color: var(--color-primary);
}

/* Submit Button */
.submit-button-auth {
    width: 60%;
    padding: 12px;
    display: flex;
    justify-content: center;
    margin: auto;
    font-size: 1.1rem;
    font-weight: 600;
    color: white;
    background: black;
    border: none;
    border-radius: var(--radius-xl);
    cursor: pointer;
    transition: var(--transition-normal);
    box-shadow: var(--shadow-primary);
    font-family: 'Signika', sans-serif;
}

.submit-button-auth:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-primary-hover);
    background: #0f0f0f;
}

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

/* Additional Links */
/* Rappel de la contrainte de saisie, énoncé avant l'envoi plutôt qu'en reproche
   après. Discret : c'est une indication, pas un avertissement. */
.reset-hint {
    text-align: center;
    margin: 0 0 14px;
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.75);
}

.additional-links {
    text-align: center;
    margin-top: 15px; /* Réduit de 25px */
}

.additional-links p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.95rem;
}

.additional-links a {
    color: white;
    font-weight: 600;
    text-decoration: none;
    border-bottom: 2px solid rgba(255, 255, 255, 0.5);
    transition: var(--transition-normal);
}

.additional-links a:hover {
    border-bottom-color: white;
    color: #ffeb3b;
}

/* ===== RESPONSIVE TABLETTE (768px - 1024px) ===== */
@media (max-width: 1023px) and (min-width: 768px) {
    .navbar {
        height: auto !important;
    }

    .container-auth {
        height: auto;
        min-height: calc(100vh - 160px);
        margin-top: 160px;
        padding: 20px;
    }

    body {
        overflow: auto;
    }

    .main-card-auth {
        max-height: none;
        padding: 30px 40px;
    }

    .blob:nth-child(1) { width: 200px; height: 200px; }
    .blob:nth-child(2) { width: 250px; height: 250px; }
    .blob:nth-child(3) { width: 200px; height: 200px; }
    .blob:nth-child(4) { display: none; }
}

/* ===== RESPONSIVE MOBILE (< 768px) ===== */
@media (max-width: 767px) {
    body {
        overflow: auto;
    }

    .navbar {
        height: auto !important;
    }

    .navbar-nav.main-links {
        display: none !important;
    }

    .container-auth {
        height: auto;
        min-height: calc(100vh - var(--navbar-offset, 226px));
        margin-top: 136px; /* Aligné avec navbar mobile */
        padding: 15px 10px;
    }

    .main-card-auth {
        max-height: none;
        padding: 25px 20px;
        max-width: 100%;
        border-radius: 16px;
    }

    .main-card-auth .logo img {
        max-width: 80px;
    }

    .title {
        font-size: 1.6rem;
    }

    .subtitle {
        font-size: 0.9rem;
    }

    .ti_subti {
        margin-bottom: 15px;
    }

    .input-group input {
        width: 100%;
        padding: 10px 16px;
        font-size: 0.95rem;
    }

    .input-container {
        gap: 10px;
        margin-bottom: 15px;
    }

    .submit-button-auth {
        width: 80%;
        padding: 12px;
        font-size: 1rem;
    }

    .checkbox-container {
        margin-bottom: 15px;
    }

    .additional-links p {
        font-size: 0.85rem;
    }

    /* Réduire les blobs pour performances */
    .blob:nth-child(1) { width: 150px; height: 150px; filter: blur(60px); }
    .blob:nth-child(2) { width: 180px; height: 180px; filter: blur(60px); }
    .blob:nth-child(3) { display: none; }
    .blob:nth-child(4) { display: none; }
}

/* ===== TRÈS PETIT MOBILE (< 480px) ===== */
@media (max-width: 480px) {
    .main-card-auth {
        padding: 20px 15px;
    }

    .main-card-auth .logo {
        margin-bottom: 10px;
    }

    .main-card-auth .logo img {
        max-width: 65px;
    }

    .title {
        font-size: 1.4rem;
    }

    .subtitle {
        font-size: 0.85rem;
    }

    .input-group input {
        padding: 9px 14px;
        font-size: 0.9rem;
    }

    .submit-button-auth {
        width: 90%;
        font-size: 0.95rem;
    }

    .flash-message {
        font-size: 0.85rem;
        padding: 10px 14px;
    }
}
