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

body {
    min-height: 100vh;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    overflow: hidden;
    position: relative;
    background: #0f1419;
    margin: 0;
    padding: 0;
}

/* Animation Material Design avec vagues */
.material-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    overflow: hidden;
}

.wave {
    position: absolute;
    width: 200%;
    height: 200%;
    top: -50%;
    left: -50%;
    background: radial-gradient(circle at center, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    animation: wave-animation 20s ease-in-out infinite;
}

.wave:nth-child(1) {
    animation-duration: 25s;
    animation-delay: 0s;
}

.wave:nth-child(2) {
    animation-duration: 30s;
    animation-delay: -10s;
    opacity: 0.5;
}

.wave:nth-child(3) {
    animation-duration: 35s;
    animation-delay: -15s;
    opacity: 0.3;
}

@keyframes wave-animation {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    25% {
        transform: translate(-10%, 5%) scale(1.1);
    }
    50% {
        transform: translate(5%, -10%) scale(0.9);
    }
    75% {
        transform: translate(-5%, 8%) scale(1.05);
    }
}

/* Cercles flottants Material Design */
.floating-shapes {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    overflow: hidden;
}

.floating-circle {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    animation: float-material 15s ease-in-out infinite;
}

.floating-circle:nth-child(1) {
    width: 300px;
    height: 300px;
    top: 10%;
    left: -10%;
    animation-duration: 20s;
}

.floating-circle:nth-child(2) {
    width: 200px;
    height: 200px;
    top: 60%;
    right: -5%;
    animation-duration: 25s;
    animation-delay: -5s;
}

.floating-circle:nth-child(3) {
    width: 150px;
    height: 150px;
    bottom: 10%;
    left: 40%;
    animation-duration: 18s;
    animation-delay: -10s;
}

.floating-circle:nth-child(4) {
    width: 250px;
    height: 250px;
    top: 30%;
    right: 30%;
    animation-duration: 22s;
    animation-delay: -7s;
}

@keyframes float-material {
    0%, 100% {
        transform: translate(0, 0) scale(1);
        opacity: 0.3;
    }
    33% {
        transform: translate(30px, -40px) scale(1.1);
        opacity: 0.5;
    }
    66% {
        transform: translate(-20px, 30px) scale(0.9);
        opacity: 0.4;
    }
}

/* Canvas Material Design supprimé */
#matrixCanvas {
    display: none;
}

/* Overlay adapté */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.2);
    z-index: 1;
}

/* Container principal */
.auth-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow-y: auto;
}

.auth-wrapper::-webkit-scrollbar {
    width: 8px;
}

.auth-wrapper::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

.auth-wrapper::-webkit-scrollbar-thumb {
    background: rgba(30, 58, 138, 0.5);
    border-radius: 4px;
}

/* Container principal - bordure */
.auth-container {
    background: #191c24;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6),
                0 0 0 1px rgba(30, 58, 138, 0.2);
    padding: 50px 40px;
    width: 100%;
    max-width: 480px;
    backdrop-filter: blur(20px);
    border: 1px solid rgba(30, 58, 138, 0.15);
    animation: slideIn 0.6s ease-out;
    position: relative;
    overflow: hidden;
}

/* Effet de lumière sur le container */
.auth-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(30, 58, 138, 0.1), transparent);
    animation: shimmer 4s infinite;
}

@keyframes shimmer {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

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

/* Logo/Icône */
.auth-icon {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 25px;
    overflow: hidden;
    background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 100%); /* Bleu foncé */
    box-shadow: 0 4px 12px rgba(30, 58, 138, 0.4);
    position: relative;
    animation: pulse 3s infinite;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 4px 12px rgba(30, 58, 138, 0.4);
    }
    50% {
        box-shadow: 0 4px 20px rgba(30, 58, 138, 0.6), 
                    0 0 0 8px rgba(30, 58, 138, 0.1);
    }
}

.auth-icon img {
    width: 70%;
    height: 70%;
    object-fit: contain;
}

.auth-icon i {
    font-size: 45px;
    color: #fff;
}

/* Titres */
.auth-title {
    color: #fff;
    text-align: center;
    margin-bottom: 10px;
    font-weight: 600;
    font-size: 1.8rem;
}

.auth-subtitle {
    color: rgba(255, 255, 255, 0.6);
    text-align: center;
    margin-bottom: 25px;
    font-size: 0.9rem;
}

/* Formulaires */
.form-group {
    margin-bottom: 18px;
    position: relative;
}

.input-group {
    position: relative;
    transition: transform 0.2s;
}

/* Input group */
.input-group-text {
    background: rgba(30, 58, 138, 0.1);
    border: 1px solid rgba(30, 58, 138, 0.2);
    border-right: none;
    color: #3b82f6; /* Bleu plus vif pour l'icône */
    transition: all 0.3s;
    border-radius: 10px 0 0 10px;
}

.form-control {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-left: none;
    color: #fff;
    padding: 14px 18px;
    border-radius: 0 10px 10px 0;
    transition: all 0.3s;
}

.form-control:focus {
    background: rgba(255, 255, 255, 0.08);
    border-color: #3b82f6;
    color: #fff;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
    outline: none;
}

.form-control:focus + .input-group-text,
.input-group:focus-within .input-group-text {
    border-color: #3b82f6;
    background: rgba(30, 58, 138, 0.15);
}

.form-control::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

/* Force du mot de passe */
.password-strength {
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    margin-top: 8px;
    overflow: hidden;
}

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

.password-strength-bar.weak {
    width: 33%;
    background: #dc3545;
}

.password-strength-bar.medium {
    width: 66%;
    background: #ffc107;
}

.password-strength-bar.strong {
    width: 100%;
    background: #28a745;
}

/* Boutons */
.btn-auth {
    background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 100%); /* Gradient bleu foncé */
    border: none;
    color: #fff;
    padding: 14px;
    border-radius: 10px;
    font-weight: 600;
    width: 100%;
    transition: all 0.3s;
    font-size: 1.05rem;
    position: relative;
    overflow: hidden;
    margin-top: 10px;
    cursor: pointer;
}

.btn-auth::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-auth:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(30, 58, 138, 0.5);
}

.btn-auth:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.5);
}

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

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

/* Alerts */
.alert {
    border-radius: 10px;
    padding: 12px 15px;
    margin-bottom: 20px;
    animation: slideDown 0.5s;
}

.alert-danger {
    background: rgba(220, 53, 69, 0.15);
    border: 1px solid rgba(220, 53, 69, 0.4);
    color: #ff6b6b;
}

.alert-success {
    background: rgba(40, 167, 69, 0.15);
    border: 1px solid rgba(40, 167, 69, 0.4);
    color: #5dff5d;
}

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

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

/* Info box */
.info-box {
    background: rgba(30, 58, 138, 0.1);
    border: 1px solid rgba(30, 58, 138, 0.3);
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 20px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.85rem;
    display: flex;
    gap: 10px;
    align-items: start;
}

.info-box i {
    color: #3b82f6;
    margin-top: 2px;
}

/* Toggle entre login et register */
.toggle-link {
    text-align: center;
    margin-top: 20px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
}

/* Toggle link */
.toggle-link a {
    color: #3b82f6;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
    cursor: pointer;
}

.toggle-link a:hover {
    color: #2563eb;
    text-decoration: underline;
}

/* Masquer/afficher les formulaires */
.form-container {
    display: none;
}

.form-container.active {
    display: block;
    animation: fadeIn 0.4s ease-out;
}

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

/* Effet ripple */
.ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transform: scale(0);
    animation: ripple-animation 0.6s ease-out;
    pointer-events: none;
}

@keyframes ripple-animation {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* Responsive */
@media (max-width: 576px) {
    .auth-container {
        padding: 40px 30px;
        margin: 10px;
    }

    .auth-title {
        font-size: 1.5rem;
    }
    
    .auth-icon {
        width: 80px;
        height: 80px;
    }
}