/* Variables CSS pour le thème FUI */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-primary);
    background: radial-gradient(circle at 30% 70%, var(--bg-void) 0%, var(--hex-color-011) 50%, var(--hex-color-001) 100%);
    color: var(--text-primary);
    min-height: 100vh;
    overflow: hidden;
    position: relative;
}

/* Grille de fond animée */
.grid-background {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        linear-gradient(var(--rgba-color-027) 1px, transparent 1px),
        linear-gradient(90deg, var(--rgba-color-027) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: gridMove 20s linear infinite;
    z-index: 0;
}

@keyframes gridMove {
    0% { transform: translate(0, 0); }
    100% { transform: translate(50px, 50px); }
}

/* Particules flottantes */
.particles {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
    pointer-events: none;
}

.particle {
    position: absolute;
    width: 2px;
    height: 2px;
    background: var(--accent-cyan);
    border-radius: 50%;
    animation: float 6s ease-in-out infinite;
    box-shadow: 0 0 6px var(--accent-cyan);
}

/* Variations de taille pour certaines particules */
.particle:nth-child(3n) {
    width: 3px;
    height: 3px;
    box-shadow: 0 0 8px var(--accent-cyan);
}

.particle:nth-child(5n) {
    width: 1px;
    height: 1px;
    box-shadow: 0 0 4px var(--accent-cyan);
    opacity: 0.7;
}

/* Particules avec des couleurs légèrement différentes */
.particle:nth-child(7n) {
    background: var(--accent-blue);
    box-shadow: 0 0 6px var(--accent-blue);
}

.particle:nth-child(11n) {
    background: var(--rgba-color-034);
    box-shadow: 0 0 5px var(--rgba-color-033);
}

.particle:nth-child(1) {
    top: 20%;
    left: 10%;
    animation-delay: 0s;
    animation-duration: 8s;
}

.particle:nth-child(2) {
    top: 60%;
    left: 80%;
    animation-delay: 2s;
    animation-duration: 6s;
}

.particle:nth-child(3) {
    top: 80%;
    left: 20%;
    animation-delay: 4s;
    animation-duration: 10s;
}

.particle:nth-child(4) {
    top: 30%;
    left: 70%;
    animation-delay: 1s;
    animation-duration: 7s;
}

.particle:nth-child(5) {
    top: 70%;
    left: 50%;
    animation-delay: 3s;
    animation-duration: 9s;
}

.particle:nth-child(6) {
    top: 15%;
    left: 30%;
    animation-delay: 1.5s;
    animation-duration: 7.5s;
}

.particle:nth-child(7) {
    top: 45%;
    left: 15%;
    animation-delay: 4.5s;
    animation-duration: 8.5s;
}

.particle:nth-child(8) {
    top: 85%;
    left: 75%;
    animation-delay: 2.5s;
    animation-duration: 6.5s;
}

.particle:nth-child(9) {
    top: 25%;
    left: 85%;
    animation-delay: 0.5s;
    animation-duration: 9.5s;
}

.particle:nth-child(10) {
    top: 55%;
    left: 35%;
    animation-delay: 3.5s;
    animation-duration: 7s;
}

.particle:nth-child(11) {
    top: 75%;
    left: 25%;
    animation-delay: 1s;
    animation-duration: 8s;
}

.particle:nth-child(12) {
    top: 35%;
    left: 65%;
    animation-delay: 4s;
    animation-duration: 6s;
}

.particle:nth-child(13) {
    top: 65%;
    left: 85%;
    animation-delay: 2s;
    animation-duration: 9s;
}

.particle:nth-child(14) {
    top: 5%;
    left: 45%;
    animation-delay: 3.8s;
    animation-duration: 7.8s;
}

.particle:nth-child(15) {
    top: 95%;
    left: 55%;
    animation-delay: 0.8s;
    animation-duration: 8.8s;
}

@keyframes float {
    0%, 100% { 
        transform: translate(0, 0) scale(1);
        opacity: 0.3;
    }
    33% { 
        transform: translate(30px, -30px) scale(1.2);
        opacity: 1;
    }
    66% { 
        transform: translate(-20px, 20px) scale(0.8);
        opacity: 0.7;
    }
}

/* Container principal */
.auth-container {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

/* Panneau d'authentification */
.auth-panel {
    background: linear-gradient(145deg, var(--bg-panel) 0%, var(--rgba-color-036) 100%);
    border: 1px solid var(--border-neon);
    padding: 40px;
    width: 100%;
    max-width: 420px;
    position: relative;
    overflow: hidden;
    clip-path: polygon(0 0, calc(100% - 20px) 0, 100% 20px, 100% 100%, 20px 100%, 0 calc(100% - 20px));
    backdrop-filter: blur(10px);
    box-shadow: 
        0 0 30px var(--rgba-color-029),
        inset 0 1px 0 var(--rgba-color-054);
}

.auth-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 30%, var(--rgba-color-028) 50%, transparent 70%);
    animation: shimmer 3s ease-in-out infinite;
    pointer-events: none;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* En-tête */
.auth-header {
    text-align: center;
    margin-bottom: 40px;
}

.app-title {
    font-family: var(--font-title);
    font-size: 2.5rem;
    font-weight: 900;
    color: var(--text-neon);
    margin-bottom: 8px;
    text-shadow: 0 0 20px var(--rgba-color-019);
    letter-spacing: 2px;
}

.title-accent {
    color: var(--accent-cyan);
    font-size: 3rem;
    text-shadow: 0 0 30px var(--rgba-color-034);
}

.app-subtitle {
    font-family: var(--font-secondary);
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 3px;
    margin-bottom: 20px;
}

.status-line {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: var(--font-secondary);
    font-size: 0.65rem;
    color: var(--accent-orange);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.status-indicator {
    width: 8px;
    height: 8px;
    background: var(--accent-orange);
    border-radius: 50%;
    animation: pulse 2s infinite;
    box-shadow: 0 0 6px var(--accent-orange);
}

/* Formulaire */
.auth-form {
    margin-bottom: 30px;
}

.form-group {
    margin-bottom: 25px;
    position: relative;
}

.form-label {
    display: block;
    font-family: var(--font-secondary);
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-void);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    font-family: var(--font-primary);
    font-size: 0.9rem;
    outline: none;
    transition: all 0.3s ease;
    clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 8px 100%, 0 calc(100% - 8px));
    position: relative;
    z-index: 1;
}

.form-input:focus {
    border-color: var(--accent-cyan);
    box-shadow: 
        inset 0 0 10px var(--rgba-color-029),
        0 0 15px var(--rgba-color-030);
    background: var(--rgba-color-007);
}

.form-input::placeholder {
    color: var(--text-muted);
    font-style: italic;
}

.input-glow {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent, var(--rgba-color-029), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 8px 100%, 0 calc(100% - 8px));
}

.form-input:focus + .input-glow {
    opacity: 1;
}

/* Options du formulaire */
.form-options {
    margin-bottom: 30px;
}

.checkbox-container {
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.checkbox-container input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.checkmark {
    width: 16px;
    height: 16px;
    background: var(--bg-void);
    border: 1px solid var(--border-subtle);
    margin-right: 10px;
    position: relative;
    transition: all 0.3s ease;
    clip-path: polygon(0 0, calc(100% - 3px) 0, 100% 3px, 100% 100%, 3px 100%, 0 calc(100% - 3px));
}

.checkbox-container input:checked ~ .checkmark {
    background: var(--accent-cyan);
    border-color: var(--accent-cyan);
    box-shadow: 0 0 8px var(--rgba-color-032);
}

.checkmark::after {
    content: '';
    position: absolute;
    left: 4px;
    top: 1px;
    width: 4px;
    height: 8px;
    border: solid var(--bg-void);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.checkbox-container input:checked ~ .checkmark::after {
    opacity: 1;
}

.checkbox-label {
    font-family: var(--font-secondary);
    font-size: 0.7rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Séparateur */
.auth-separator {
    text-align: center;
    margin: 1.5rem 0;
    position: relative;
}

.auth-separator::before,
.auth-separator::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 40%;
    height: 1px;
    background: var(--border-subtle);
}

.auth-separator::before {
    left: 0;
}

.auth-separator::after {
    right: 0;
}

.auth-separator span {
    display: inline-block;
    padding: 0 1rem;
    background: var(--bg-primary);
    color: var(--text-secondary);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    position: relative;
    z-index: 1;
}

/* Bouton de connexion secondaire */
.auth-button-secondary {
    width: 100%;
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    padding: 0.75rem 1.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    margin-top: 0.5rem;
}

.auth-button-secondary:hover {
    background: linear-gradient(135deg, var(--bg-tertiary) 0%, var(--bg-secondary) 100%);
    border-color: var(--accent-cyan);
    box-shadow: 0 0 15px var(--rgba-color-066);
    transform: translateY(-2px);
}

.auth-button-secondary:active {
    transform: translateY(0);
}

.auth-button {
    width: 100%;
    padding: 14px 0;
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-blue));
    border: none;
    color: var(--bg-void);
    font-family: var(--font-secondary);
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 10px 100%, 0 calc(100% - 10px));
}

.auth-button:hover {
    background: linear-gradient(135deg, var(--accent-cyan), var(--text-neon));
    box-shadow: 0 0 25px var(--rgba-color-032);
    transform: translateY(-1px);
}

.auth-button:active {
    transform: translateY(0);
}

.auth-button.loading {
    pointer-events: none;
}

.button-text {
    transition: opacity 0.3s ease;
}

.auth-button.loading .button-text {
    opacity: 0;
}

.button-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.auth-button.loading .button-loading {
    opacity: 1;
}

.loading-dots {
    display: flex;
    gap: 4px;
}

.loading-dots div {
    width: 6px;
    height: 6px;
    background: var(--bg-void);
    border-radius: 50%;
    animation: loadingDots 1.4s ease-in-out infinite both;
}

.loading-dots div:nth-child(1) { animation-delay: -0.32s; }
.loading-dots div:nth-child(2) { animation-delay: -0.16s; }

@keyframes loadingDots {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Message d'erreur */
.error-message {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: var(--rgba-color-057);
    border: 1px solid var(--rgba-color-058);
    color: var(--accent-red);
    font-size: 0.8rem;
    margin-top: 15px;
    clip-path: polygon(0 0, calc(100% - 6px) 0, 100% 6px, 100% 100%, 6px 100%, 0 calc(100% - 6px));
    transition: all 0.3s ease;
}

.error-message.hidden {
    opacity: 0;
    transform: translateY(-10px);
    max-height: 0;
    padding: 0 16px;
    margin: 0;
}

.error-icon {
    font-size: 1rem;
    animation: pulse 2s infinite;
}

/* Pied de page */
.auth-footer {
    text-align: center;
    border-top: 1px solid var(--border-ultra-subtle);
    padding-top: 20px;
}

.system-info {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
}

.info-item {
    font-family: var(--font-mono);
    font-size: 0.6rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Statut de connexion */
.connection-status {
    position: fixed;
    bottom: 20px;
    right: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--rgba-color-005);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    font-family: var(--font-secondary);
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    backdrop-filter: blur(5px);
    clip-path: polygon(0 0, calc(100% - 6px) 0, 100% 6px, 100% 100%, 6px 100%, 0 calc(100% - 6px));
    z-index: 10;
}

.status-dot {
    width: 8px;
    height: 8px;
    background: var(--accent-green);
    border-radius: 50%;
    animation: pulse 2s infinite;
    box-shadow: 0 0 6px var(--accent-green);
}

.connection-status.offline .status-dot {
    background: var(--accent-red);
    box-shadow: 0 0 6px var(--accent-red);
}

.connection-status.connecting .status-dot {
    background: var(--accent-orange);
    box-shadow: 0 0 6px var(--accent-orange);
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* Responsivité */
@media (max-width: 480px) {
    .auth-panel {
        margin: 20px;
        padding: 30px 25px;
    }
    
    .app-title {
        font-size: 2rem;
    }
    
    .title-accent {
        font-size: 2.5rem;
    }
    
    .system-info {
        flex-direction: column;
        gap: 8px;
    }
}