:root {
    --bg-dark: #0b0f14;
    --panel-dark: rgba(12, 16, 22, 0.6);
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.06);
    --violet-main: #7f63cc;
    --violet-dark: #5b3bbd;
    --violet-light: #a885ff;
    --success-color: #4CAF50;
    --error-color: #ff6b6b;
    --warning-color: #ffcc00;
    --radius: 14px;
    --spacing-unit: 0.8em;
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.15);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.25);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.35);
}

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

body {
    margin: 0;
    padding: var(--spacing-unit);
    background: var(--bg-dark);
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(127, 99, 204, 0.1) 0%, transparent 20%),
        radial-gradient(circle at 90% 80%, rgba(91, 59, 189, 0.1) 0%, transparent 20%);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    color: #d7e6f2;
    line-height: 1.5;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--violet-main), transparent);
    z-index: 1000;
}

.container {
    background: var(--glass-bg);
    backdrop-filter: blur(12px) saturate(180%);
    -webkit-backdrop-filter: blur(12px) saturate(180%);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 2rem;
    text-align: center;
    max-width: 420px;
    width: 100%;
    animation: fadeIn 0.5s ease-out;
    position: relative;
    z-index: 10;
    box-shadow: var(--shadow-md);
}

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

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(127, 99, 204, 0.4); }
    70% { box-shadow: 0 0 0 8px rgba(127, 99, 204, 0); }
    100% { box-shadow: 0 0 0 0 rgba(127, 99, 204, 0); }
}

.logo {
    font-size: 2.2rem;
    font-weight: 800;
    margin-bottom: 1.2rem;
    background: linear-gradient(45deg, var(--violet-main), var(--violet-light));
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    position: relative;
    letter-spacing: -0.5px;
}

.logo::after {
    content: '🎯';
    margin-left: 8px;
    font-size: 1.4em;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.tagline {
    color: #aaa;
    font-size: 1.1rem;
    margin-bottom: 1.8rem;
    font-weight: 300;
    line-height: 1.4;
}

.auth-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
    padding: 4px;
    backdrop-filter: blur(4px);
    border: 1px solid var(--glass-border);
}

.auth-tab {
    flex: 1;
    padding: 0.75rem;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: #aaa;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 1;
}

.auth-tab:hover {
    color: white;
}

.auth-tab.active {
    color: white;
    background: var(--violet-main);
    box-shadow: 0 2px 6px rgba(127, 99, 204, 0.35);
    transform: translateY(-1px);
}

.form-group {
    margin-bottom: 1.1rem;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.9em;
    color: #ccc;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.form-group label::before {
    content: '•';
    color: var(--violet-main);
    font-size: 1.2em;
    line-height: 0.6;
}

.form-group input {
    width: 100%;
    padding: 0.9rem 1rem;
    border-radius: 10px;
    border: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.04);
    color: white;
    font-size: 1rem;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: inherit;
}

.form-group input:focus {
    outline: none;
    border-color: var(--violet-main);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 2px rgba(127, 99, 204, 0.25);
}

.auth-btn {
    background: var(--violet-main);
    color: white;
    border: none;
    padding: 0.9rem;
    border-radius: 10px;
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    width: 100%;
    margin-top: 0.3rem;
    box-shadow: 0 4px 8px rgba(127, 99, 204, 0.25);
    font-family: inherit;
    position: relative;
    overflow: hidden;
}

.auth-btn::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.3) 0%, transparent 70%);
    transform: scale(0);
    transition: transform 0.5s ease-out;
    z-index: 1;
}

.auth-btn:hover::after {
    transform: scale(1);
}

.auth-btn:hover {
    background: var(--violet-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(127, 99, 204, 0.35);
}

.auth-btn:active {
    transform: translateY(0);
    box-shadow: 0 3px 6px rgba(127, 99, 204, 0.3);
}

.auth-btn:disabled {
    background: #9a88e0;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    opacity: 0.8;
}

.auth-btn.loading {
    position: relative;
    pointer-events: none;
}

.auth-btn.loading::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

.error-message {
    color: var(--error-color);
    margin: 0.6rem 0;
    font-size: 0.92em;
    min-height: 1.6rem;
    text-align: left;
    animation: shake 0.3s;
    font-weight: 500;
}

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

.success-message {
    color: var(--success-color);
    margin: 0.6rem 0;
    font-size: 0.92em;
    min-height: 1.6rem;
    text-align: left;
    animation: fadeIn 0.3s;
    font-weight: 500;
}

.hidden {
    display: none;
}

.footer {
    margin-top: 1.5rem;
    font-size: 0.85rem;
    color: #777;
    padding-top: 1rem;
    border-top: 1px solid var(--glass-border);
}

.status-indicator {
    position: absolute;
    bottom: 15px;
    right: 15px;
    width: 8px;
    height: 8px;
    background: #4CAF50;
    border-radius: 50%;
    box-shadow: 0 0 6px #4CAF50;
    animation: pulse 2s infinite;
    z-index: 100;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(76, 175, 80, 0.7); }
    70% { box-shadow: 0 0 0 8px rgba(76, 175, 80, 0); }
    100% { box-shadow: 0 0 0 0 rgba(76, 175, 80, 0); }
}

.api-status {
    font-size: 0.75rem;
    color: #777;
    margin-top: 0.5rem;
    transition: color 0.3s;
}

.api-status.ok {
    color: var(--success-color);
}

.api-status.error {
    color: var(--error-color);
}

/* Animation pour la redirection */
.fade-out {
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease-out;
}

/* Responsive adjustments */
@media (max-width: 480px) {
    .container {
        padding: 1.5rem;
        margin: 8px;
    }
    .logo {
        font-size: 1.8rem;
    }
    .tagline {
        font-size: 1rem;
        margin-bottom: 1.5rem;
    }
    .auth-tabs {
        gap: 0.25rem;
    }
    .auth-tab {
        padding: 0.6rem;
        font-size: 0.9rem;
    }
    .form-group input {
        padding: 0.8rem;
    }
    .auth-btn {
        padding: 0.8rem;
        font-size: 1rem;
    }
}

/* Animation pour les éléments */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in-up {
    animation: fadeInUp 0.6s ease-out forwards;
}

.delay-100 {
    animation-delay: 0.1s;
}

.delay-200 {
    animation-delay: 0.2s;
}

.delay-300 {
    animation-delay: 0.3s;
}

/* Styles pour le loading initial */
#initial-loading {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-dark);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    transition: opacity 0.3s ease;
}

.loader {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    border-top-color: var(--violet-main);
    animation: spin 1s linear infinite;
    margin-bottom: 1.5rem;
}

.loader-text {
    color: #aaa;
    font-size: 1.1rem;
    font-weight: 300;
}
