/* ============================================
   Reset et Variables CSS
   ============================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Couleurs principales */
    --color-primary: #2563eb;
    --color-primary-dark: #1e40af;
    --color-success: #10b981;
    --color-error: #ef4444;
    --color-warning: #f59e0b;
    
    /* Couleurs neutres */
    --color-bg: #f9fafb;
    --color-surface: #ffffff;
    --color-border: #e5e7eb;
    --color-text-primary: #111827;
    --color-text-secondary: #6b7280;
    --color-text-muted: #9ca3af;
    
    /* Skeleton */
    --color-skeleton: #e5e7eb;
    --color-skeleton-highlight: #f3f4f6;
    
    /* Espacements */
    --spacing-xs: 0.375rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 0.75rem;
    --spacing-lg: 1rem;
    --spacing-xl: 1.25rem;
    --spacing-2xl: 1.5rem;
    
    /* Bordures */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    
    /* Ombres */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    
    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 200ms ease;
    --transition-slow: 300ms ease;
}

/* ============================================
   Base Styles
   ============================================ */

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--color-bg);
    color: var(--color-text-primary);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ============================================
   Header
   ============================================ */

.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: var(--spacing-lg) var(--spacing-md);
    box-shadow: var(--shadow-md);
}

.header-container {
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
}

.header-logo {
    max-width: 150px;
    height: auto;
    display: block;
    margin: 0 auto;
    filter: brightness(0) invert(1);
}

/* Fallback si l'image ne charge pas */
.header-logo[style*="display: none"] + .header::before {
    content: '';
    display: block;
    width: 100%;
    height: 80px;
}

/* ============================================
   Container Principal
   ============================================ */

.container {
    max-width: 600px;
    margin: 0 auto;
    padding: var(--spacing-lg) var(--spacing-md);
    flex: 1;
}

/* ============================================
   Section Introduction
   ============================================ */

.intro-section {
    margin-bottom: var(--spacing-lg);
}

.title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-text-primary);
    margin-bottom: var(--spacing-md);
    line-height: 1.2;
}

.reassurance-text {
    font-size: 0.9375rem;
    color: var(--color-text-secondary);
    line-height: 1.5;
    background-color: var(--color-surface);
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    border-left: 3px solid var(--color-primary);
    box-shadow: var(--shadow-sm);
}

.reassurance-text strong {
    color: var(--color-text-primary);
    font-weight: 600;
}

/* ============================================
   Messages d'erreur globaux
   ============================================ */

.global-error {
    background-color: #fee2e2;
    border: 1px solid #fecaca;
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-md);
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   Skeleton Loader
   ============================================ */

.skeleton-loader {
    background-color: var(--color-surface);
    padding: var(--spacing-lg);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    margin-bottom: var(--spacing-md);
}

.skeleton-line {
    height: 16px;
    background: linear-gradient(
        90deg,
        var(--color-skeleton) 0%,
        var(--color-skeleton-highlight) 50%,
        var(--color-skeleton) 100%
    );
    background-size: 200% 100%;
    border-radius: var(--radius-sm);
    animation: shimmer 1.5s infinite;
    margin-bottom: var(--spacing-sm);
}

.skeleton-line-large {
    width: 80%;
    height: 20px;
}

.skeleton-line-medium {
    width: 60%;
}

.skeleton-line-small {
    width: 40%;
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

/* ============================================
   Informations du contact
   ============================================ */

.contact-info {
    margin-bottom: var(--spacing-lg);
    animation: fadeIn 0.4s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.contact-card {
    background-color: var(--color-surface);
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--color-border);
}

.contact-label {
    font-size: 0.8125rem;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: var(--spacing-xs);
    font-weight: 600;
}

.contact-name {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--color-text-primary);
    margin-bottom: var(--spacing-xs);
}

.contact-email {
    font-size: 0.875rem;
    color: var(--color-text-secondary);
    margin-bottom: var(--spacing-xs);
}

.contact-residence {
    font-size: 0.875rem;
    color: var(--color-text-secondary);
}

/* ============================================
   Formulaire
   ============================================ */

.phone-form {
    background-color: var(--color-surface);
    padding: var(--spacing-lg);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    animation: fadeIn 0.4s ease-out;
}

.form-group {
    margin-bottom: var(--spacing-md);
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-text-primary);
    margin-bottom: var(--spacing-sm);
}

.required-note {
    font-size: 0.8125rem;
    color: var(--color-text-muted);
    margin-bottom: var(--spacing-md);
    font-style: italic;
}

/* ============================================
   Select Indicatif Pays
   ============================================ */

.country-select {
    width: 100%;
    padding: 0.625rem 0.875rem;
    font-size: 0.9375rem;
    color: var(--color-text-primary);
    background-color: var(--color-surface);
    border: 2px solid var(--color-border);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-base);
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.875rem center;
    padding-right: 2.5rem;
}

.country-select:hover {
    border-color: var(--color-primary);
}

.country-select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* ============================================
   Input Téléphone
   ============================================ */

.phone-input {
    width: 100%;
    padding: 0.625rem 0.875rem;
    font-size: 0.9375rem;
    color: var(--color-text-primary);
    background-color: var(--color-surface);
    border: 2px solid var(--color-border);
    border-radius: var(--radius-md);
    transition: all var(--transition-base);
}

.phone-input::placeholder {
    color: var(--color-text-muted);
}

.phone-input:hover {
    border-color: var(--color-primary);
}

.phone-input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.phone-input.error {
    border-color: var(--color-error);
}

.phone-input.error:focus {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.phone-input.valid {
    border-color: var(--color-success);
}

.phone-input.valid:focus {
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

/* ============================================
   Messages d'erreur et validation
   ============================================ */

.error-message {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    color: var(--color-error);
    font-size: 0.875rem;
    font-weight: 500;
}

.field-error {
    margin-top: var(--spacing-sm);
    animation: slideDown 0.2s ease-out;
}

.error-icon {
    font-size: 1rem;
}

.valid-message {
    margin-top: var(--spacing-sm);
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    color: var(--color-success);
    font-size: 0.875rem;
    animation: slideDown 0.2s ease-out;
}

.valid-icon {
    font-size: 1rem;
    font-weight: bold;
}

/* ============================================
   Bouton Submit
   ============================================ */

.submit-btn {
    width: 100%;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    color: #ffffff;
    background-color: var(--color-primary);
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-base);
    box-shadow: var(--shadow-sm);
    min-height: 46px;
}

.submit-btn:hover:not(:disabled) {
    background-color: var(--color-primary-dark);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.submit-btn:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: var(--shadow-sm);
}

.submit-btn:disabled {
    background-color: var(--color-text-muted);
    cursor: not-allowed;
    opacity: 0.6;
}

.submit-btn.loading {
    position: relative;
    color: transparent;
}

.submit-btn.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin-left: -10px;
    margin-top: -10px;
    border: 3px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ============================================
   Message de succès
   ============================================ */

.success-message {
    margin-top: var(--spacing-md);
    padding: var(--spacing-md);
    background-color: #d1fae5;
    border: 1px solid #a7f3d0;
    border-radius: var(--radius-md);
    color: #065f46;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    animation: slideDown 0.3s ease-out;
}

.success-icon {
    font-size: 1.25rem;
    font-weight: bold;
}

/* ============================================
   Footer
   ============================================ */

.footer {
    background-color: var(--color-surface);
    padding: var(--spacing-md) var(--spacing-md);
    border-top: 1px solid var(--color-border);
    text-align: center;
}

.footer-text {
    font-size: 0.875rem;
    color: var(--color-text-secondary);
}

/* ============================================
   Responsive Design
   ============================================ */

/* Mobile (< 480px) */
@media (max-width: 479px) {
    .title {
        font-size: 1.375rem;
    }
    
    .container {
        padding: var(--spacing-md) var(--spacing-sm);
    }
    
    .phone-form {
        padding: var(--spacing-md);
    }
    
    .submit-btn {
        font-size: 0.9375rem;
        padding: 0.625rem 1.25rem;
    }
}

/* Tablet (480px - 767px) */
@media (min-width: 480px) and (max-width: 767px) {
    .container {
        padding: var(--spacing-xl) var(--spacing-lg);
    }
}

/* Desktop (≥ 768px) */
@media (min-width: 768px) {
    .header {
        padding: var(--spacing-xl) var(--spacing-md);
    }
    
    .title {
        font-size: 1.625rem;
    }
    
    .reassurance-text {
        font-size: 0.9375rem;
    }
}

/* Touch-friendly pour mobile */
@media (hover: none) and (pointer: coarse) {
    .submit-btn,
    .phone-input,
    .country-select {
        min-height: 44px;
    }
}

/* Mode sombre (optionnel, si le navigateur supporte) */
@media (prefers-color-scheme: dark) {
    :root {
        --color-bg: #111827;
        --color-surface: #1f2937;
        --color-border: #374151;
        --color-text-primary: #f9fafb;
        --color-text-secondary: #d1d5db;
        --color-text-muted: #9ca3af;
        --color-skeleton: #374151;
        --color-skeleton-highlight: #4b5563;
    }
    
    .header-logo {
        filter: none;
    }
}

