:root {
    --primary: #006233;
    --primary-dark: #004d28;
    --secondary: #D21034;
    --accent: #FFD700;
    --white: #ffffff;
    --black: #000000;
    --gray-light: #f8f9fa;
    --gray: #e2e8f0;
    --gray-dark: #4a5568;
    --gray-darker: #2d3748;
    --success: #10b981;
    --error: #ef4444;
    --warning: #f59e0b;
    --transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

[data-theme="light"] {
    --bg-primary: var(--white);
    --bg-secondary: var(--gray-light);
    --bg-card: var(--white);
    --text-primary: var(--gray-darker);
    --text-secondary: var(--gray-dark);
    --border-color: var(--gray);
    --shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 30px 80px rgba(0, 0, 0, 0.15);
}

[data-theme="dark"] {
    --bg-primary: var(--gray-darker);
    --bg-secondary: #2d2d2d;
    --bg-card: #374151;
    --text-primary: #e2e8f0;
    --text-secondary: #a0aec0;
    --border-color: #4a5568;
    --shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    --shadow-hover: 0 30px 80px rgba(0, 0, 0, 0.4);
}

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

body {
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--bg-primary);
    min-height: 100vh;
    transition: var(--transition);
}

.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    position: relative;
}

.auth-background {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    z-index: 1;
}

.auth-background::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('../images/télécharg.jpg');
    background-size: cover;
    background-position: center;
    opacity: 0.1;
}

.auth-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
}

.auth-card {
    background: var(--bg-card);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: var(--shadow);
    transition: var(--transition);
    border: 1px solid var(--border-color);
    backdrop-filter: blur(10px);
    width: 100%;
    max-width: 400px;
    position: relative;
    z-index: 2;
    animation: slideUp 0.8s ease;
    overflow: hidden;
}

.auth-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--accent), var(--secondary));
    border-radius: 20px 20px 0 0;
}

.logo-section {
    text-align: center;
    margin-bottom: 1.5rem;
}

.logo-circle {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 0.75rem;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    border: 3px solid var(--primary);
    overflow: hidden;
    padding: 4px;
}

.logo {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 50%;
}

.logo-title {
    color: var(--text-primary);
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 0.25rem;
    line-height: 1.2;
}

.logo-title span {
    color: var(--primary);
}

.welcome-section {
    text-align: center;
    margin-bottom: 1.5rem;
}

.welcome-section h2 {
    color: var(--text-primary);
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.welcome-section p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.4;
}

.auth-form {
    margin-bottom: 1.5rem;
}

.form-group {
    margin-bottom: 1rem;
}

.input-group {
    position: relative;
    transition: var(--transition);
    display: flex;
    align-items: center;
}

.input-group.focused .input-icon {
    color: var(--primary);
    transform: scale(1.1);
}

.input-group.focused .form-control {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 98, 51, 0.1);
}

.input-icon {
    position: absolute;
    left: 1rem;
    color: var(--text-secondary);
    transition: var(--transition);
    z-index: 2;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.form-control {
    width: 100%;
    padding: 0.875rem 0.875rem 0.875rem 2.75rem;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 0.95rem;
    transition: var(--transition);
    font-family: inherit;
    line-height: 1.5;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 98, 51, 0.1);
}

.form-control::placeholder {
    color: var(--text-secondary);
    opacity: 0.7;
}

/* Code input specific styles */
.code-input-group {
    text-align: center;
}

.code-input {
    width: 100%;
    padding: 1.25rem;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 1.5rem;
    font-weight: bold;
    text-align: center;
    letter-spacing: 8px;
    font-family: monospace;
    transition: var(--transition);
    line-height: 1;
}

.code-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 98, 51, 0.1);
}

.code-hint {
    margin-top: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
    text-align: center;
}

/* Password strength */
.password-strength {
    margin: 0.75rem 0;
}

.strength-bar {
    width: 100%;
    height: 5px;
    background: var(--border-color);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.strength-fill {
    height: 100%;
    width: 0%;
    border-radius: 3px;
    transition: var(--transition);
}

.strength-text {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-align: center;
}

/* Buttons */
.btn {
    width: 100%;
    padding: 0.875rem 1.5rem;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    position: relative;
    overflow: hidden;
    font-family: inherit;
    line-height: 1.5;
    min-height: 48px;
}

.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: var(--transition);
}

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

.btn-primary {
    background: var(--primary);
    color: var(--white);
    box-shadow: 0 4px 12px rgba(0, 98, 51, 0.3);
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(0, 98, 51, 0.4);
}

.btn-large {
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
}

/* Messages */
.message {
    padding: 0.875rem;
    border-radius: 10px;
    margin-bottom: 1rem;
    animation: slideIn 0.5s ease;
}

.message.success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.message.error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.message-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 600;
    line-height: 1.4;
    font-size: 0.9rem;
}

/* Links */
.auth-links {
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.auth-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem;
    border-radius: 6px;
    font-size: 0.9rem;
}

.auth-link:hover {
    color: var(--secondary);
    background: rgba(0, 98, 51, 0.05);
    text-decoration: none;
}

.auth-link.secondary {
    color: var(--text-secondary);
}

.auth-link.secondary:hover {
    color: var(--text-primary);
    background: rgba(113, 128, 150, 0.05);
}

.auth-divider {
    color: var(--text-secondary);
    margin: 0.25rem 0;
    font-size: 0.85rem;
    text-align: center;
}

/* Animations */
@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

/* Responsive */
@media (max-width: 768px) {
    .auth-container {
        padding: 0.75rem;
    }

    .auth-card {
        padding: 1.5rem;
        max-width: 380px;
    }

    .logo-title {
        font-size: 1.4rem;
    }

    .welcome-section h2 {
        font-size: 1.2rem;
    }

    .code-input {
        font-size: 1.3rem;
        letter-spacing: 6px;
        padding: 1rem;
    }

    .btn {
        min-height: 46px;
    }
}

@media (max-width: 480px) {
    .auth-card {
        padding: 1.25rem;
        max-width: 350px;
    }

    .logo-circle {
        width: 60px;
        height: 60px;
        margin-bottom: 0.5rem;
    }

    .logo {
        width: 32px;
        height: 32px;
    }

    .logo-title {
        font-size: 1.2rem;
    }

    .welcome-section h2 {
        font-size: 1.1rem;
    }

    .welcome-section p {
        font-size: 0.85rem;
    }

    .code-input {
        font-size: 1.1rem;
        letter-spacing: 4px;
        padding: 0.875rem;
    }

    .btn-large {
        padding: 0.75rem 1.25rem;
        font-size: 0.95rem;
        min-height: 44px;
    }

    .auth-links {
        gap: 0.5rem;
    }

    .auth-link {
        font-size: 0.85rem;
    }
}