/* Variables CSS */
:root {
    --primary-color: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --error-color: #ef4444;
    --warning-color: #f59e0b;

    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;

    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-accent: #f1f5f9;

    --border-color: #e2e8f0;
    --border-focus: #2563eb;

    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);

    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;

    --spacing-xs: 0.5rem;
    --spacing-sm: 0.75rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-secondary);
    font-size: 16px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-lg);
}

/* Header */
.header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    padding: var(--spacing-2xl) 0;
    text-align: center;
    box-shadow: var(--shadow-md);
}

.header__title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: var(--spacing-sm);
    letter-spacing: -0.025em;
}

.header__subtitle {
    font-size: 1.25rem;
    font-weight: 400;
    opacity: 0.9;
}

/* Main content */
.main {
    padding: var(--spacing-2xl) 0;
}

/* Introduction section */
.intro {
    text-align: center;
    margin-bottom: var(--spacing-2xl);
}

.intro__content {
    max-width: 800px;
    margin: 0 auto;
}

.intro h2 {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: var(--spacing-lg);
    color: var(--text-primary);
}

.intro p {
    font-size: 1.125rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

/* Registration section */
.registration {
    display: flex;
    justify-content: center;
}

.form-container {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    padding: var(--spacing-2xl);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 800px;
}

.form-title {
    font-size: 1.5rem;
    font-weight: 600;
    text-align: center;
    margin-bottom: var(--spacing-xl);
    color: var(--text-primary);
}

/* Form styles */
.registration-form {
    width: 100%;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-xl);
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group--full {
    grid-column: 1 / -1;
}

.form-label {
    font-weight: 500;
    margin-bottom: var(--spacing-xs);
    color: var(--text-primary);
    font-size: 0.875rem;
}

.required {
    color: var(--error-color);
    margin-left: 2px;
}

.form-control {
    padding: var(--spacing-sm) var(--spacing-md);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 1rem;
    transition: all 0.2s ease;
    background-color: var(--bg-primary);
}

.form-control:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgb(37 99 235 / 0.1);
}

.form-control:hover {
    border-color: var(--secondary-color);
}

.form-control.error {
    border-color: var(--error-color);
    box-shadow: 0 0 0 3px rgb(239 68 68 / 0.1);
}

textarea.form-control {
    resize: vertical;
    min-height: 80px;
}

select.form-control {
    cursor: pointer;
}

.error-message {
    color: var(--error-color);
    font-size: 0.75rem;
    margin-top: var(--spacing-xs);
    min-height: 1rem;
}

/* Form actions */
.form-actions {
    text-align: center;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-sm) var(--spacing-xl);
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    min-width: 140px;
    height: 48px;
}

.btn--primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    box-shadow: var(--shadow-sm);
}

.btn--primary:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

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

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* Spinner */
.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: var(--spacing-xs);
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Messages */
.message {
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-lg);
    font-weight: 500;
}

.message.success {
    background-color: rgb(16 185 129 / 0.1);
    color: var(--success-color);
    border: 1px solid rgb(16 185 129 / 0.2);
}

.message.error {
    background-color: rgb(239 68 68 / 0.1);
    color: var(--error-color);
    border: 1px solid rgb(239 68 68 / 0.2);
}

.hidden {
    display: none !important;
}

/* Footer */
.footer {
    background-color: var(--text-primary);
    color: white;
    text-align: center;
    padding: var(--spacing-lg) 0;
    margin-top: var(--spacing-2xl);
}

.footer p {
    opacity: 0.8;
}

/* Responsive design */
@media (max-width: 768px) {
    .container {
        padding: 0 var(--spacing-md);
    }

    .header__title {
        font-size: 2rem;
    }

    .header__subtitle {
        font-size: 1.125rem;
    }

    .intro h2 {
        font-size: 1.5rem;
    }

    .intro p {
        font-size: 1rem;
    }

    .form-container {
        padding: var(--spacing-lg);
    }

    .form-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }

    .form-group--full {
        grid-column: 1;
    }

    .btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .header {
        padding: var(--spacing-lg) 0;
    }

    .main {
        padding: var(--spacing-lg) 0;
    }

    .form-container {
        padding: var(--spacing-md);
        margin: 0 var(--spacing-xs);
    }
}

/* Améliorations d'accessibilité */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* États de focus améliorés pour l'accessibilité */
.btn:focus-visible,
.form-control:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}