/* Variables de couleurs pour Aurore */
:root {
    --primary-color: #7e3ff2;
    --primary-hover: #6a2ee0;
    --secondary-color: #f0f2f5;
    --text-color: #1c1e21;
    --text-secondary: #65676b;
    --border-color: #dddfe2;
    --error-color: #e41e3f;
    --success-color: #31a24c;
    --gradient-start: #7e3ff2;
    --gradient-middle: #5b6af2;
    --gradient-end: #00c6ff;
    --aurora1: rgba(120, 50, 255, 0.4);
    --aurora2: rgba(55, 110, 230, 0.4);
    --aurora3: rgba(0, 180, 255, 0.4);
    --aurora4: rgba(70, 120, 255, 0.4);
    --aurora5: rgba(130, 60, 240, 0.4);
    --aurora6: rgba(180, 70, 220, 0.3);
    --aurora7: rgba(40, 170, 255, 0.3);
    --aurora8: rgba(100, 80, 255, 0.3);
}

/* Reset et styles de base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    color: var(--text-color);
    background: #0f0c29;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    margin: 0;
    overflow: hidden;
    position: relative;
}

/* Effet d'aurore boréale animée */
.aurora-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: -1;
}

.aurora-light {
    position: absolute;
    width: 200%;
    height: 200%;
    top: -50%;
    left: -50%;
    background: radial-gradient(
        ellipse at center,
        rgba(90, 50, 180, 0.2) 0%,
        rgba(30, 20, 70, 0.1) 40%,
        rgba(10, 10, 30, 0) 70%
    );
    transform-origin: center center;
    animation: aurora-rotate 120s linear infinite;
}

.aurora-wave {
    position: absolute;
    width: 200%;
    height: 200%;
    opacity: 0.3;
    filter: blur(60px);
    border-radius: 40%;
}

.aurora-wave:nth-child(1) {
    background: var(--aurora1);
    top: -100%;
    left: -50%;
    animation: aurora-wave-1 25s ease-in-out infinite alternate;
}

.aurora-wave:nth-child(2) {
    background: var(--aurora2);
    top: -80%;
    left: -10%;
    animation: aurora-wave-2 30s ease-in-out -5s infinite alternate;
}

.aurora-wave:nth-child(3) {
    background: var(--aurora3);
    top: -60%;
    right: -30%;
    animation: aurora-wave-3 35s ease-in-out -10s infinite alternate;
}

.aurora-wave:nth-child(4) {
    background: var(--aurora4);
    bottom: -80%;
    left: 10%;
    animation: aurora-wave-4 40s ease-in-out -15s infinite alternate;
}

.aurora-wave:nth-child(5) {
    background: var(--aurora5);
    bottom: -70%;
    right: -20%;
    animation: aurora-wave-5 45s ease-in-out -20s infinite alternate;
}

.aurora-wave:nth-child(6) {
    background: var(--aurora6);
    top: -90%;
    right: -40%;
    animation: aurora-wave-6 38s ease-in-out -8s infinite alternate;
    opacity: 0;
    animation-delay: -8s;
}

@keyframes aurora-wave-1 {
    0% {
        transform: translate(5%, 10%) rotate(10deg);
        opacity: 0.3;
    }
    33% {
        opacity: 0.4;
    }
    50% {
        transform: translate(-5%, -15%) rotate(-5deg);
        opacity: 0.35;
    }
    66% {
        opacity: 0.3;
    }
    100% {
        transform: translate(5%, -10%) rotate(8deg);
        opacity: 0.25;
    }
}

@keyframes aurora-wave-2 {
    0% {
        transform: translate(-5%, 15%) rotate(-8deg);
        opacity: 0.3;
    }
    33% {
        opacity: 0.25;
    }
    50% {
        transform: translate(8%, -10%) rotate(4deg);
        opacity: 0.35;
    }
    66% {
        opacity: 0.4;
    }
    100% {
        transform: translate(-3%, -12%) rotate(-6deg);
        opacity: 0.3;
    }
}

@keyframes aurora-wave-3 {
    0% {
        transform: translate(0%, 10%) rotate(5deg);
        opacity: 0.35;
    }
    33% {
        opacity: 0.3;
    }
    50% {
        transform: translate(-8%, -12%) rotate(-8deg);
        opacity: 0.25;
    }
    66% {
        opacity: 0.35;
    }
    100% {
        transform: translate(3%, -5%) rotate(10deg);
        opacity: 0.4;
    }
}

@keyframes aurora-wave-4 {
    0% {
        transform: translate(-8%, -5%) rotate(-12deg);
        opacity: 0.25;
    }
    33% {
        opacity: 0.35;
    }
    50% {
        transform: translate(5%, 8%) rotate(5deg);
        opacity: 0.4;
    }
    66% {
        opacity: 0.3;
    }
    100% {
        transform: translate(-3%, -10%) rotate(-8deg);
        opacity: 0.35;
    }
}

@keyframes aurora-wave-5 {
    0% {
        transform: translate(3%, -8%) rotate(8deg);
        opacity: 0.3;
    }
    33% {
        opacity: 0.4;
    }
    50% {
        transform: translate(-5%, 5%) rotate(-5deg);
        opacity: 0.35;
    }
    66% {
        opacity: 0.25;
    }
    100% {
        transform: translate(8%, -3%) rotate(10deg);
        opacity: 0.3;
    }
}

@keyframes aurora-wave-6 {
    0% {
        transform: translate(0%, 0%) rotate(0deg);
        opacity: 0;
    }
    15% {
        opacity: 0;
    }
    20% {
        opacity: 0.4;
    }
    40% {
        transform: translate(-10%, 15%) rotate(-10deg);
        opacity: 0.35;
    }
    60% {
        opacity: 0.3;
    }
    80% {
        opacity: 0.2;
    }
    90% {
        opacity: 0;
    }
    100% {
        transform: translate(15%, -10%) rotate(15deg);
        opacity: 0;
    }
}

@keyframes aurora-rotate {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Effet de flash aléatoire */
.aurora-container::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(
        ellipse at center,
        rgba(120, 80, 255, 0) 0%,
        rgba(120, 80, 255, 0) 85%,
        rgba(120, 80, 255, 0.1) 100%
    );
    opacity: 0;
    animation: aurora-flash 15s ease-in-out infinite;
}

@keyframes aurora-flash {
    0%, 100% {
        opacity: 0;
    }
    25%, 30% {
        opacity: 0;
    }
    27.5% {
        opacity: 0.3;
    }
    75%, 80% {
        opacity: 0;
    }
    77.5% {
        opacity: 0.2;
    }
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    text-decoration: underline;
}

/* Conteneur principal */
.auth-container {
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.auth-form-container {
    background-color: rgba(255, 255, 255, 0.95);
    border-radius: 8px;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.2);
    padding: 30px;
    text-align: center;
    backdrop-filter: blur(5px);
    max-height: 95vh;
    overflow-y: auto;
}

/* Logo et titre */
.auth-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

.auth-logo .logo-icon {
    width: 70px;
    height: 70px;
    background-color: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
    box-shadow: 0 4px 15px rgba(126, 63, 242, 0.4);
    position: relative;
    overflow: hidden;
}

.auth-logo .logo-icon::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.1) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    transform: rotate(45deg);
    animation: logo-shine 6s ease-in-out infinite;
}

@keyframes logo-shine {
    0%, 100% {
        transform: rotate(45deg) translateX(-100%);
    }
    50% {
        transform: rotate(45deg) translateX(100%);
    }
}

.auth-logo .logo-icon i {
    font-size: 40px;
    color: white;
}

.auth-logo h1 {
    font-size: 36px;
    font-weight: 700;
    color: var(--primary-color);
    margin: 0;
    background: linear-gradient(to right, var(--gradient-start), var(--gradient-end));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 2px 10px rgba(126, 63, 242, 0.1);
    position: relative;
}

.auth-logo h1::after {
    content: attr(data-text);
    position: absolute;
    left: 0;
    top: 0;
    z-index: -1;
    background: linear-gradient(to right, var(--gradient-start), var(--gradient-end));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: blur(8px);
    opacity: 0.5;
}

/* Formulaire */
.auth-form {
    margin-bottom: 20px;
    text-align: left;
}

.form-row {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.form-row .form-group {
    flex: 1;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-color);
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 15px;
    background-color: rgba(240, 247, 255, 0.8);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(126, 63, 242, 0.2);
    outline: none;
    background-color: rgba(255, 255, 255, 0.95);
}

.has-error .form-control {
    border-color: var(--error-color);
    background-color: rgba(255, 240, 240, 0.8);
}

.error-message {
    color: var(--error-color);
    font-size: 13px;
    margin-top: 5px;
}

/* Boutons */
.btn {
    display: inline-block;
    padding: 12px 15px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.1) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    transform: rotate(45deg) translateX(-100%);
    transition: transform 0.6s ease-in-out;
}

.btn:hover::after {
    transform: rotate(45deg) translateX(100%);
}

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

.btn-primary {
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-middle));
    color: white;
    box-shadow: 0 4px 10px rgba(126, 63, 242, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-start));
    box-shadow: 0 6px 15px rgba(126, 63, 242, 0.4);
    transform: translateY(-2px);
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: var(--text-color);
}

.btn-success {
    background-color: var(--success-color);
    color: white;
}

.btn-block {
    display: block;
    width: 100%;
}

/* Séparateur */
.auth-divider {
    position: relative;
    text-align: center;
    margin: 20px 0;
}

.auth-divider::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background-color: var(--border-color);
}

.auth-divider span {
    position: relative;
    background-color: white;
    padding: 0 10px;
    color: var(--text-secondary);
}

/* Liens et footer */
.auth-links {
    text-align: center;
    margin-top: 15px;
}

.auth-footer {
    margin-top: 20px;
    text-align: center;
}

.auth-footer .btn {
    background: linear-gradient(135deg, #3a2a5e, #4b3a7e);
    color: white;
    transition: all 0.3s ease;
}

.auth-footer .btn:hover {
    background: linear-gradient(135deg, #4b3a7e, #3a2a5e);
    box-shadow: 0 6px 15px rgba(58, 42, 94, 0.4);
    transform: translateY(-2px);
}

/* Alertes */
.alert {
    padding: 10px 15px;
    border-radius: 6px;
    margin-bottom: 15px;
}

.alert-danger {
    background-color: rgba(253, 232, 232, 0.9);
    color: var(--error-color);
    border: 1px solid #f8d7d7;
}

.alert-success {
    background-color: rgba(230, 247, 239, 0.9);
    color: var(--success-color);
    border: 1px solid #d1f0e0;
}

/* Responsive */
@media (max-width: 480px) {
    .auth-container {
        max-width: 100%;
    }
    
    .auth-form-container {
        padding: 20px;
        border-radius: 6px;
    }
    
    .auth-logo h1 {
        font-size: 30px;
    }
    
    .btn {
        padding: 10px 15px;
        font-size: 15px;
    }
    
    body {
        padding: 10px;
    }
    
    .form-row {
        flex-direction: column;
        gap: 0;
    }
}

/* Optimisations pour éviter le défilement */
@media (max-height: 700px) {
    .auth-logo {
        margin-bottom: 10px;
    }
    
    .auth-logo .logo-icon {
        width: 50px;
        height: 50px;
        margin-bottom: 10px;
    }
    
    .auth-logo .logo-icon i {
        font-size: 30px;
    }
    
    .auth-logo h1 {
        font-size: 28px;
    }
    
    .form-group {
        margin-bottom: 10px;
    }
    
    .form-group label {
        margin-bottom: 5px;
    }
    
    .form-control {
        padding: 10px;
    }
    
    .btn {
        padding: 10px;
    }
    
    .auth-divider {
        margin: 15px 0;
    }
    
    .auth-footer {
        margin-top: 15px;
    }
    
    h2 {
        font-size: 20px;
        margin: 0 0 15px 0;
    }
}

/* Optimisations pour très petits écrans */
@media (max-height: 600px) {
    .auth-form-container {
        padding: 15px;
    }
    
    .auth-logo .logo-icon {
        width: 40px;
        height: 40px;
        margin-bottom: 5px;
    }
    
    .auth-logo .logo-icon i {
        font-size: 25px;
    }
    
    .auth-logo h1 {
        font-size: 24px;
    }
    
    .form-group label {
        font-size: 14px;
    }
    
    .form-control {
        padding: 8px;
        font-size: 14px;
    }
    
    .btn {
        padding: 8px;
        font-size: 14px;
    }
    
    h2 {
        font-size: 18px;
        margin: 0 0 10px 0;
    }
}