/* =============================================
   PRODUCTIVEAPP - AUTH LOGIN CSS v2.0
   Login premium avec animations et image maître
   ============================================= */

/* === OVERLAY PRINCIPAL === */
.auth-login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 99999;
    background: linear-gradient(165deg, #0a0a0a 0%, #1a1410 40%, #2d2117 100%);
    background-size: 200% 200%;
    animation: authBgBreathe 8s ease-in-out infinite, authFadeIn 0.6s ease;
    overflow: hidden;
}

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

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

/* === PARTICULES DORÉES === */
.auth-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
    z-index: 0;
}

.auth-particles span {
    position: absolute;
    width: 4px;
    height: 4px;
    background: radial-gradient(circle, rgba(212, 175, 55, 0.8), transparent);
    border-radius: 50%;
    animation: authParticleFloat linear infinite;
    opacity: 0;
}

.auth-particles span:nth-child(1)  { left: 10%; animation-duration: 12s; animation-delay: 0s; width: 3px; height: 3px; }
.auth-particles span:nth-child(2)  { left: 20%; animation-duration: 15s; animation-delay: 1s; width: 5px; height: 5px; }
.auth-particles span:nth-child(3)  { left: 30%; animation-duration: 10s; animation-delay: 2s; }
.auth-particles span:nth-child(4)  { left: 40%; animation-duration: 18s; animation-delay: 0.5s; width: 6px; height: 6px; }
.auth-particles span:nth-child(5)  { left: 55%; animation-duration: 14s; animation-delay: 3s; width: 3px; height: 3px; }
.auth-particles span:nth-child(6)  { left: 65%; animation-duration: 11s; animation-delay: 1.5s; }
.auth-particles span:nth-child(7)  { left: 75%; animation-duration: 16s; animation-delay: 4s; width: 5px; height: 5px; }
.auth-particles span:nth-child(8)  { left: 85%; animation-duration: 13s; animation-delay: 2.5s; width: 3px; height: 3px; }
.auth-particles span:nth-child(9)  { left: 15%; animation-duration: 17s; animation-delay: 3.5s; }
.auth-particles span:nth-child(10) { left: 50%; animation-duration: 12s; animation-delay: 5s; width: 4px; height: 4px; }
.auth-particles span:nth-child(11) { left: 70%; animation-duration: 19s; animation-delay: 1s; width: 3px; height: 3px; }
.auth-particles span:nth-child(12) { left: 35%; animation-duration: 14s; animation-delay: 4.5s; width: 5px; height: 5px; }

@keyframes authParticleFloat {
    0% {
        transform: translateY(100vh) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 0.6;
    }
    90% {
        opacity: 0.3;
    }
    100% {
        transform: translateY(-10vh) rotate(720deg);
        opacity: 0;
    }
}

/* === LAYOUT CENTRÉ === */
.auth-login-layout {
    display: flex;
    width: 100%;
    height: 100%;
    position: relative;
    z-index: 1;
    align-items: center;
    justify-content: center;
}

/* === COLONNE GAUCHE (formulaire) - CENTRÉ === */
.auth-login-left {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    position: relative;
    z-index: 2;
}

/* === COLONNE DROITE (image maître) - CACHÉE PAR DÉFAUT === */
.auth-login-right {
    display: none;
    position: relative;
    overflow: hidden;
}

.auth-master-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    animation: authMasterReveal 1.2s cubic-bezier(0.22, 1, 0.36, 1) 0.3s both;
}

.auth-master-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    filter: brightness(0.85) saturate(1.1);
}

.auth-master-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
        #0a0a0a 0%,
        rgba(26, 20, 16, 0.95) 5%,
        rgba(26, 20, 16, 0.7) 20%,
        rgba(26, 20, 16, 0.3) 50%,
        transparent 100%
    );
    pointer-events: none;
    z-index: 1;
}

@keyframes authMasterReveal {
    from {
        opacity: 0;
        transform: scale(1.08);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* === BOX CENTRALE === */
.auth-login-box {
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 200, 100, 0.12);
    border-radius: 28px;
    padding: 48px 40px;
    width: 100%;
    max-width: 420px;
    text-align: center;
    box-shadow:
        0 25px 70px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 200, 100, 0.08);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    animation: authBoxEnter 0.8s cubic-bezier(0.22, 1, 0.36, 1) 0.1s both;
}

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

/* === LOGO === */
.auth-login-logo {
    margin-bottom: 20px;
    animation: authLogoEnter 0.8s cubic-bezier(0.22, 1, 0.36, 1) 0.3s both;
}

.auth-login-logo img {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid rgba(255, 200, 100, 0.3);
    box-shadow:
        0 0 30px rgba(255, 200, 100, 0.15),
        0 0 60px rgba(212, 175, 55, 0.08);
    animation: authLogoPulse 3s ease-in-out infinite 1.5s;
}

@keyframes authLogoEnter {
    from {
        opacity: 0;
        transform: scale(0.5) rotate(-10deg);
    }
    to {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
}

@keyframes authLogoPulse {
    0%, 100% {
        box-shadow:
            0 0 30px rgba(255, 200, 100, 0.15),
            0 0 60px rgba(212, 175, 55, 0.08);
    }
    50% {
        box-shadow:
            0 0 40px rgba(255, 200, 100, 0.25),
            0 0 80px rgba(212, 175, 55, 0.15);
    }
}

/* === TITRE === */
.auth-login-title {
    color: #fff;
    font-size: 2rem;
    font-weight: 700;
    margin: 0 0 4px 0;
    background: linear-gradient(135deg, #d4af37 0%, #f5d77a 50%, #d4af37 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: authTitleEnter 0.7s ease 0.4s both, authTitleShimmer 4s linear infinite 2s;
    letter-spacing: -0.5px;
}

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

@keyframes authTitleShimmer {
    from { background-position: -200% center; }
    to { background-position: 200% center; }
}

/* === TAGLINE === */
.auth-login-tagline {
    color: rgba(212, 175, 55, 0.5);
    font-size: 0.85rem;
    font-weight: 400;
    letter-spacing: 3px;
    text-transform: uppercase;
    margin: 0 0 30px 0;
    animation: authTitleEnter 0.7s ease 0.5s both;
}

/* === SUBTITLE === */
.auth-subtitle {
    color: rgba(255, 255, 255, 0.7);
    font-size: 1rem;
    margin: 0 0 25px 0;
    animation: authTitleEnter 0.6s ease 0.55s both;
}

/* === PHASES === */
.auth-phase {
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.auth-phase.hidden {
    display: none;
}

/* === INPUTS === */
.auth-inputs {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 16px;
}

.auth-input-wrapper {
    position: relative;
    animation: authInputEnter 0.6s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.auth-input-wrapper:nth-child(1) { animation-delay: 0.6s; }
.auth-input-wrapper:nth-child(2) { animation-delay: 0.7s; }

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

.auth-input-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: rgba(212, 175, 55, 0.4);
    transition: color 0.3s ease;
    pointer-events: none;
}

.auth-input-wrapper:focus-within .auth-input-icon {
    color: rgba(212, 175, 55, 0.8);
}

.auth-inputs input {
    width: 100%;
    padding: 15px 18px 15px 46px;
    border: 2px solid rgba(255, 200, 100, 0.15);
    border-radius: 14px;
    background: rgba(0, 0, 0, 0.4);
    color: #fff;
    font-size: 0.95rem;
    outline: none;
    transition: all 0.35s cubic-bezier(0.22, 1, 0.36, 1);
    box-sizing: border-box;
}

.auth-inputs input:focus {
    border-color: rgba(212, 175, 55, 0.6);
    background: rgba(0, 0, 0, 0.55);
    box-shadow:
        0 0 20px rgba(212, 175, 55, 0.1),
        0 0 40px rgba(212, 175, 55, 0.05);
    transform: translateY(-1px);
}

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

/* === ERREUR === */
.auth-error {
    color: #ff6b6b;
    font-size: 0.9rem;
    min-height: 24px;
    margin-bottom: 10px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.auth-error.visible {
    opacity: 1;
}

.auth-error.shake {
    animation: authShake 0.5s ease;
}

@keyframes authShake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-10px); }
    40% { transform: translateX(10px); }
    60% { transform: translateX(-10px); }
    80% { transform: translateX(10px); }
}

/* === BOUTON PRINCIPAL === */
.auth-btn {
    width: 100%;
    padding: 15px 24px;
    border: none;
    border-radius: 14px;
    background: linear-gradient(135deg, #d4af37 0%, #b8962e 100%);
    background-size: 200% auto;
    color: #1a1a1a;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.22, 1, 0.36, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    position: relative;
    overflow: hidden;
    animation: authInputEnter 0.6s cubic-bezier(0.22, 1, 0.36, 1) 0.8s both;
}

.auth-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.auth-btn:hover::before {
    left: 100%;
}

.auth-btn:hover {
    background-position: right center;
    transform: translateY(-3px);
    box-shadow:
        0 12px 35px rgba(212, 175, 55, 0.35),
        0 0 15px rgba(212, 175, 55, 0.15);
}

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

.auth-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.auth-btn-text {
    position: relative;
    z-index: 1;
}

.auth-btn-arrow {
    width: 20px;
    height: 20px;
    position: relative;
    z-index: 1;
    transition: transform 0.3s ease;
}

.auth-btn:hover .auth-btn-arrow {
    transform: translateX(4px);
}

/* === MEMBER GRID === */
.auth-member-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(105px, 1fr));
    gap: 14px;
    max-height: 420px;
    overflow-y: auto;
    padding: 5px;
}

.auth-member-grid::-webkit-scrollbar {
    width: 5px;
}

.auth-member-grid::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

.auth-member-grid::-webkit-scrollbar-thumb {
    background: rgba(255, 200, 100, 0.25);
    border-radius: 3px;
}

/* === MEMBER BUTTON === */
.auth-member-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 18px 12px;
    background: rgba(0, 0, 0, 0.35);
    border: 2px solid rgba(255, 200, 100, 0.1);
    border-radius: 18px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.22, 1, 0.36, 1);
    position: relative;
    overflow: hidden;
    animation: authMemberPop 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}

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

.auth-member-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #d4af37, #f5d77a, #d4af37);
    transform: scaleX(0);
    transition: transform 0.4s ease;
    transform-origin: left;
}

.auth-member-btn:hover {
    background: rgba(212, 175, 55, 0.08);
    border-color: rgba(212, 175, 55, 0.4);
    transform: translateY(-6px);
    box-shadow:
        0 16px 40px rgba(212, 175, 55, 0.15),
        0 0 20px rgba(212, 175, 55, 0.05);
}

.auth-member-btn:hover::before {
    transform: scaleX(1);
}

.auth-member-btn:active {
    transform: translateY(-2px) scale(0.98);
}

/* === MEMBER AVATAR === */
.auth-member-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 200, 100, 0.2);
    transition: all 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.auth-member-btn:hover .auth-member-avatar {
    border-color: rgba(212, 175, 55, 0.6);
    box-shadow: 0 0 25px rgba(212, 175, 55, 0.25);
    transform: scale(1.08);
}

/* === MEMBER NAME === */
.auth-member-name {
    color: #fff;
    font-size: 0.9rem;
    font-weight: 600;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 95px;
    transition: color 0.3s ease;
}

.auth-member-btn:hover .auth-member-name {
    color: #f5d77a;
}

/* === MEMBER ROLE === */
.auth-member-role {
    color: rgba(255, 200, 100, 0.5);
    font-size: 0.7rem;
    letter-spacing: 0.5px;
    transition: color 0.3s ease;
}

.auth-member-btn:hover .auth-member-role {
    color: rgba(255, 200, 100, 0.8);
}

/* === RESPONSIVE === */
@media (max-width: 900px) {
    .auth-login-layout {
        flex-direction: column;
    }

    .auth-login-left {
        flex: 1;
        padding: 30px 20px;
    }

    .auth-login-right {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        z-index: 0;
    }

    .auth-master-image img {
        filter: brightness(0.3) saturate(0.8);
    }

    .auth-master-overlay {
        background: radial-gradient(
            ellipse at center,
            rgba(10, 10, 10, 0.6) 0%,
            rgba(10, 10, 10, 0.85) 100%
        );
    }

    .auth-login-left {
        z-index: 2;
    }
}

@media (max-width: 480px) {
    .auth-login-box {
        padding: 32px 24px;
        border-radius: 22px;
    }

    .auth-login-logo img {
        width: 75px;
        height: 75px;
    }

    .auth-login-title {
        font-size: 1.6rem;
    }

    .auth-member-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .auth-member-avatar {
        width: 54px;
        height: 54px;
    }

    .auth-member-name {
        font-size: 0.8rem;
        max-width: 75px;
    }
}

/* === QUAND LOGGED IN, CACHER COMPLÈTEMENT === */
body.logged-in .auth-login-overlay {
    display: none !important;
}
