/* ===== VARIABLES CSS ===== */
:root {
    --primary-gold: #F9E79F;
    --dark-gold: #d4b96a;
    --bg-dark: #0b0b0b;
    --bg-darker: #050505;
    --card-bg: #161616;
    --card-gradient-start: #1e1e1e;
    --card-gradient-end: #151515;
    --text-primary: #f1f1f1;
    --text-secondary: #aaa;
    --border-color: #333;
}

/* ===== RESET & BASE ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

/* ===== BACKGROUND ANIMÉ ===== */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(rgba(249, 231, 159, 0.08) 1px, transparent 1px);
    pointer-events: none;
    z-index: 0;
}


/* ===== PARTICULES FLOTTANTES ===== */
.particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 0;
    pointer-events: none;
}

.particle {
    position: absolute;
    background: var(--primary-gold);
    border-radius: 50%;
    opacity: 0;
    animation: float 20s infinite;
}

.particle:nth-child(1) {
    width: 3px;
    height: 3px;
    left: 10%;
    animation-delay: 0s;
    animation-duration: 15s;
}

.particle:nth-child(2) {
    width: 5px;
    height: 5px;
    left: 20%;
    animation-delay: 2s;
    animation-duration: 18s;
}

.particle:nth-child(3) {
    width: 4px;
    height: 4px;
    left: 30%;
    animation-delay: 4s;
    animation-duration: 20s;
}

.particle:nth-child(4) {
    width: 6px;
    height: 6px;
    left: 40%;
    animation-delay: 1s;
    animation-duration: 22s;
}

.particle:nth-child(5) {
    width: 3px;
    height: 3px;
    left: 50%;
    animation-delay: 3s;
    animation-duration: 16s;
}

.particle:nth-child(6) {
    width: 5px;
    height: 5px;
    left: 60%;
    animation-delay: 5s;
    animation-duration: 19s;
}

.particle:nth-child(7) {
    width: 4px;
    height: 4px;
    left: 70%;
    animation-delay: 2s;
    animation-duration: 21s;
}

.particle:nth-child(8) {
    width: 3px;
    height: 3px;
    left: 80%;
    animation-delay: 4s;
    animation-duration: 17s;
}

.particle:nth-child(9) {
    width: 5px;
    height: 5px;
    left: 90%;
    animation-delay: 1s;
    animation-duration: 23s;
}

.particle:nth-child(10) {
    width: 4px;
    height: 4px;
    left: 15%;
    animation-delay: 6s;
    animation-duration: 18s;
}

@keyframes float {
    0% {
        transform: translateY(100vh) translateX(0) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 0.3;
    }
    90% {
        opacity: 0.3;
    }
    100% {
        transform: translateY(-100vh) translateX(100px) rotate(360deg);
        opacity: 0;
    }
}

/* ===== CONTENEUR PRINCIPAL AUTH ===== */
.auth-box {
    position: relative;
    z-index: 1;
    max-width: 480px;
    width: 90%;
    background: linear-gradient(145deg, var(--card-gradient-start), var(--card-gradient-end));
    padding: 50px 45px;
    border-radius: 24px;
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.8),
        0 0 0 1px rgba(249, 231, 159, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    animation: slideInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(249, 231, 159, 0.1);
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(40px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}


/* ===== LOGO / TITRE ===== */
.logo-container {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-bottom: 40px;
    animation: logoEntrance 1s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes logoEntrance {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.8);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.ironlog-logo {
    width: 80px;
    flex-shrink: 0;
    /* Fix pour Safari iOS - force le rendu hardware-accelerated */
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    /* Améliore le rendu sur tous les navigateurs */
    shape-rendering: geometricPrecision;
}

.ironlog-logo path {
    /* Force le rendu des contours */
    vector-effect: non-scaling-stroke;
    /* Améliore l'anti-aliasing */
    shape-rendering: geometricPrecision;
}

.ironlog-logo:hover {
    transform: scale(1.1) translateZ(0);
    filter: drop-shadow(0 8px 16px rgba(249, 231, 159, 0.5));
}


.auth-box h1 {
    text-align: left;
    margin-bottom: 0;
    font-size: 2.8rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary-gold), var(--dark-gold));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
    position: relative;
    animation: titleGlow 3s ease-in-out infinite;
}

/* Responsive : empiler sur mobile */
@media (max-width: 600px) {
    .logo-container {
        flex-direction: column;
        gap: 15px;
    }
    
    .auth-box h1 {
        text-align: center;
        font-size: 2.2rem;
    }
    
    .ironlog-logo {
        width: 70px;
        height: 70px;
    }
}

/* Si le logo est présent, réduire l'espacement du titre */
.logo-container + h1 {
    margin-bottom: 30px;
    font-size: 2.2rem;
}

@keyframes titleGlow {
    0%, 100% {
        filter: drop-shadow(0 0 10px rgba(249, 231, 159, 0.3));
    }
    50% {
        filter: drop-shadow(0 0 20px rgba(249, 231, 159, 0.6));
    }
}

.auth-box h1::after {
    content: '';
    position: absolute;
    bottom: -12px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--primary-gold), transparent);
    border-radius: 2px;
    animation: lineExpand 2s ease-in-out infinite;
}

@keyframes lineExpand {
    0%, 100% {
        width: 60px;
        opacity: 1;
    }
    50% {
        width: 100px;
        opacity: 0.7;
    }
}

/* ===== FORMULAIRE ===== */
form {
    display: flex;
    flex-direction: column;
    gap: 24px;
    position: relative;
    z-index: 1;
}

/* ===== GROUPE D'INPUT ===== */
.input-group {
    position: relative;
    animation: fadeInInput 0.6s ease-out backwards;
}

.input-group:nth-child(1) {
    animation-delay: 0.1s;
}

.input-group:nth-child(2) {
    animation-delay: 0.2s;
}

.input-group:nth-child(3) {
    animation-delay: 0.3s;
}

@keyframes fadeInInput {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ===== INPUTS ===== */
input {
    width: 100%;
    padding: 18px 20px;
    font-size: 1.05rem;
    background: rgba(255, 255, 255, 0.03);
    border: 2px solid var(--border-color);
    border-radius: 14px;
    color: var(--text-primary);
    outline: none;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: inherit;
    backdrop-filter: blur(5px);
}

input::placeholder {
    color: var(--text-secondary);
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

input:focus::placeholder {
    opacity: 0.4;
}

/* Effet focus sur l'input */
input:focus {
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--primary-gold);
    box-shadow: 
        0 0 0 4px rgba(249, 231, 159, 0.1),
        0 8px 16px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

/* Animation au hover */
input:hover:not(:focus) {
    border-color: rgba(249, 231, 159, 0.4);
    background: rgba(255, 255, 255, 0.05);
}

/* Icône animée dans l'input (optionnel) */
.input-group::before {
    content: '';
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    background: var(--primary-gold);
    border-radius: 50%;
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
}

input:focus + .input-group::before {
    opacity: 0.2;
    animation: ping 1.5s cubic-bezier(0, 0, 0.2, 1) infinite;
}

@keyframes ping {
    75%, 100% {
        transform: translateY(-50%) scale(2);
        opacity: 0;
    }
}

/* ===== BOUTON ===== */
button {
    width: 100%;
    padding: 18px 24px;
    font-size: 1.1rem;
    font-weight: 700;
    color: #000;
    background: linear-gradient(135deg, var(--primary-gold), var(--dark-gold));
    border: none;
    border-radius: 14px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 
        0 10px 30px rgba(249, 231, 159, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    animation: fadeInButton 0.6s ease-out 0.4s backwards;
}

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

/* Effet de brillance sur le bouton */
button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.4),
        transparent
    );
    transition: left 0.6s ease;
}

button:hover::before {
    left: 100%;
}

/* Hover sur le bouton */
button:hover {
    transform: translateY(-3px);
    box-shadow: 
        0 15px 40px rgba(249, 231, 159, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

/* Active state du bouton */
button:active {
    transform: translateY(-1px);
    box-shadow: 
        0 8px 20px rgba(249, 231, 159, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

/* Effet d'ondulation au clic */
button::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

button:active::after {
    width: 300px;
    height: 300px;
}

/* ===== LIEN "CRÉER UN COMPTE" ===== */
.auth-box p {
    text-align: center;
    margin-top: 30px;
    color: var(--text-secondary);
    font-size: 0.95rem;
    animation: fadeIn 0.6s ease-out 0.5s backwards;
}

.auth-box p a {
    color: var(--primary-gold);
    text-decoration: none;
    font-weight: 600;
    position: relative;
    transition: all 0.3s ease;
}

.auth-box p a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-gold);
    transition: width 0.3s ease;
}

.auth-box p a:hover {
    color: var(--dark-gold);
    transform: translateX(3px);
}

.auth-box p a:hover::after {
    width: 100%;
}

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

/* ===== MESSAGE D'ERREUR ===== */
.error-message {
    background: rgba(255, 107, 107, 0.15);
    color: #ff6b6b;
    padding: 14px 18px;
    border-radius: 12px;
    border-left: 4px solid #ff6b6b;
    font-size: 0.95rem;
    margin-bottom: 20px;
    animation: shake 0.5s ease, fadeIn 0.3s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

/* ===== MESSAGE DE SUCCÈS ===== */
.success-message {
    background: rgba(76, 175, 80, 0.15);
    color: #4CAF50;
    padding: 14px 18px;
    border-radius: 12px;
    border-left: 4px solid #4CAF50;
    font-size: 0.95rem;
    margin-bottom: 20px;
    animation: slideDown 0.5s ease;
}

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

/* ===== DIVISEUR "OU" ===== */
.divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 30px 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--border-color);
}

.divider::before {
    margin-right: 15px;
}

.divider::after {
    margin-left: 15px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 600px) {
    .auth-box {
        padding: 40px 30px;
        border-radius: 20px;
    }
    
    .auth-box h1 {
        font-size: 2.2rem;
        margin-bottom: 35px;
    }
    
    input {
        padding: 16px 18px;
        font-size: 1rem;
    }
    
    button {
        padding: 16px 20px;
        font-size: 1.05rem;
    }
    
    form {
        gap: 20px;
    }
}

@media (max-width: 400px) {
    .auth-box {
        padding: 35px 25px;
    }
    
    .auth-box h1 {
        font-size: 2rem;
    }
}

/* ===== PRÉCHARGEMENT / LOADING ===== */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.loading-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(249, 231, 159, 0.2);
    border-top-color: var(--primary-gold);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* ===== CHECKBOX REMEMBER ME ===== */
.checkbox-group {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: -10px 0 10px 0;
}

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

.checkbox-group label {
    color: var(--text-secondary);
    font-size: 0.95rem;
    cursor: pointer;
    user-select: none;
}

/* ===== FORCE STRENGTH INDICATOR (pour les mots de passe) ===== */
.password-strength {
    margin-top: 8px;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
}

.strength-bar {
    height: 100%;
    width: 0;
    transition: all 0.3s ease;
    border-radius: 2px;
}

.strength-weak {
    width: 33%;
    background: #ff6b6b;
}

.strength-medium {
    width: 66%;
    background: #ffa500;
}

.strength-strong {
    width: 100%;
    background: #4CAF50;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 0.6em; /* espace proportionnel au texte */
}

.ironlog-logo {
    height: 8em;   /* clé du scaling */
    width: auto;
    flex-shrink: 0;
}

.logo-container h1 {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1;
    margin: 0;
}

@media (max-width: 480px) {
    .logo-container h1 {
        font-size: 1.6rem;
    }

    .ironlog-logo {
        height: 6em;
    }
}
