/* ═══════════════════════════════════════════════════════════════
   MLF DATA COLLECTION - DESIGN PROFESSIONNEL
   Palette: #0f637f (Bleu profond), Blanc, Gris
═══════════════════════════════════════════════════════════════ */

:root {
    --primary: #0f637f;
    --primary-light: #1a7a99;
    --primary-dark: #0a4a5c;
    --accent: #0f637f;
    --success: #38a169;
    --error: #c53030;
    --warning: #d69e2e;
    --text: #1a202c;
    --text-light: #4a5568;
    --text-muted: #718096;
    --bg: #f7fafc;
    --bg-white: #ffffff;
    --border: #e2e8f0;
    --border-light: #edf2f7;
    --shadow: rgba(15, 99, 127, 0.08);
    --shadow-lg: rgba(15, 99, 127, 0.12);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

/* ═══════════════════════════════════════════════════════════════
   CONTAINER
═══════════════════════════════════════════════════════════════ */

.container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    /* Réduit de 2rem à 1rem */
    position: relative;
}

.page {
    display: none;
    width: 100%;
    max-width: 560px;
}

.page.active {
    display: block;
}

/* ═══════════════════════════════════════════════════════════════
   LOGIN PAGE - DESIGN SIMPLE & PRO
═══════════════════════════════════════════════════════════════ */

#loginPage {
    background-color: var(--bg);
    /* Fond normal gris clair */
}

/* Suppression des animations de fond */
#loginPage::before,
#loginPage::after {
    display: none;
}

.login-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 3rem;

    /* Ombre style 3D simple et élégante */
    box-shadow:
        0 4px 6px -1px rgba(0, 0, 0, 0.05),
        0 10px 15px -3px rgba(15, 99, 127, 0.15),
        0 0 0 1px rgba(0, 0, 0, 0.02);
    /* Bordure subtile */

    text-align: center;
    /* Pas d'animation */
}

.logo {
    margin-bottom: 2rem;
}

.logo svg {
    width: 72px;
    height: 72px;
}

.login-card h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.5rem;
    letter-spacing: -0.5px;
}

.subtitle {
    color: var(--text-muted);
    font-size: 1rem;
    margin-bottom: 2.5rem;
}

.info-box {
    background: #f8fafc;
    border-left: 4px solid var(--primary);
    padding: 1.25rem;
    text-align: left;
    margin-bottom: 2rem;
    border-radius: 4px;
}

.info-box p {
    font-size: 0.9rem;
    color: var(--text-light);
    line-height: 1.5;
}

/* Google Button - Simple & Clean */
.btn-google {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    width: 100%;
    padding: 1rem;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    color: #1a202c;
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s, box-shadow 0.2s;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.btn-google:hover {
    background: #f7fafc;
    border-color: #cbd5e0;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.btn-google:active {
    background: #edf2f7;
    box-shadow: none;
    transform: translateY(1px);
    /* Petit effet d'enfoncement */
}

.btn-google svg {
    width: 20px;
    height: 20px;
}

.security-note {
    margin-top: 1.5rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    /* Gris visible sur fond blanc */
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.security-note svg {
    width: 14px;
    height: 14px;
    fill: var(--success);
}

/* ═══════════════════════════════════════════════════════════════
   FORM PAGE
═══════════════════════════════════════════════════════════════ */

#formPage {
    max-width: 640px;
    width: 100%;
}

.form-container {
    background: var(--bg-white);
    border-radius: 12px;
    box-shadow: 0 4px 24px var(--shadow);
    overflow: hidden;
    border: 1px solid var(--border-light);
}

/* Header */
.form-header {
    background: var(--primary);
    color: white;
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-photo {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.3);
    object-fit: cover;
}

.user-info h2 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.125rem;
}

.user-info p {
    font-size: 0.8rem;
    opacity: 0.8;
}

.btn-logout {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-logout:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* Progress */
.progress-bar {
    height: 4px;
    background: var(--border);
}

.progress-fill {
    height: 100%;
    background: var(--accent);
    width: 0%;
    transition: width 0.4s ease;
}

.progress-text {
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-muted);
    padding: 0.75rem;
    background: var(--bg);
    border-bottom: 1px solid var(--border-light);
}

/* Message de bienvenue */
.welcome-message {
    padding: 2rem 1.5rem;
    background: linear-gradient(135deg, rgba(15, 99, 127, 0.05) 0%, rgba(15, 99, 127, 0.02) 100%);
    border-bottom: 1px solid var(--border-light);
    text-align: center;
}

.welcome-message h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 0.75rem;
}

.welcome-message h2 span {
    color: var(--primary-dark);
    font-weight: 700;
}

.welcome-message p {
    font-size: 0.95rem;
    color: var(--text-light);
    line-height: 1.6;
    max-width: 600px;
    margin: 0 auto;
}

/* Form Sections */
.form-section {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-light);
}

.form-section:last-of-type {
    border-bottom: none;
}

.form-section h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-section h3 .icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary);
    color: white;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
}

/* Form Group */
.form-group {
    margin-bottom: 1rem;
}

.form-group:last-child {
    margin-bottom: 0;
}

.form-group label {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text);
    margin-bottom: 0.5rem;
}

.form-group label.required::after {
    content: ' *';
    color: var(--error);
}

/* Radio Cards */
.radio-group {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    /* Force 2 colonnes égales */
    gap: 1rem;
}

.radio-card {
    position: relative;
    cursor: pointer;
}

.radio-card input {
    position: absolute;
    opacity: 0;
}

.radio-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    background: var(--bg-white);
    border: 2px solid var(--border);
    border-radius: 8px;
    transition: all 0.2s;
    min-height: 60px;
    /* Hauteur minimale pour uniformité */
}

.radio-card input:checked+.radio-content {
    border-color: var(--accent);
    background: rgba(15, 99, 127, 0.05);
    box-shadow: 0 0 0 3px rgba(15, 99, 127, 0.1);
}

.radio-card:hover .radio-content {
    border-color: var(--accent);
    background: rgba(15, 99, 127, 0.02);
}

.radio-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
    border: 2px solid var(--border);
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    flex-shrink: 0;
    /* Empêche l'icône de rétrécir */
}

.radio-card input:checked+.radio-content .radio-icon {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

.radio-content>span:last-child {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text);
    line-height: 1.4;
    white-space: nowrap;
    /* Force le texte sur une seule ligne */
    overflow: hidden;
    text-overflow: ellipsis;
    /* Ajoute ... si trop long */
}

/* Inputs */
.form-input,
.form-select {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-white);
    color: var(--text);
    transition: all 0.2s;
}

/* Masquer la flèche du datalist pour une vraie autocomplétion */
input[list]::-webkit-calendar-picker-indicator {
    display: none !important;
}

input[list]::-webkit-list-button {
    display: none !important;
}

input[list] {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}

.form-input:focus,
.form-select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(15, 99, 127, 0.15);
}

.form-input::placeholder {
    color: var(--text-muted);
}

.form-input[readonly] {
    background: var(--bg);
    color: var(--text-light);
}

/* Custom Country Select avec drapeaux */
.country-select {
    position: relative;
    width: 100%;
}

.country-selected {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.country-selected:hover {
    border-color: var(--accent);
}

.country-selected.open {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(15, 99, 127, 0.15);
    border-radius: 8px 8px 0 0;
}

.country-selected .chevron {
    transition: transform 0.2s;
    color: var(--text-muted);
}

.country-selected.open .chevron {
    transform: rotate(180deg);
}

.country-options {
    display: none;
    z-index: 1000;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-white);
    border: 1px solid var(--accent);
    border-top: none;
    border-radius: 0 0 8px 8px;
    max-height: 250px;
    overflow-y: auto;
    z-index: 100;
    display: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.country-options.open {
    display: block;
}

.country-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: background 0.15s;
}

.country-option:hover {
    background: rgba(15, 99, 127, 0.05);
}

.country-option .fi {
    font-size: 1.25rem;
    border-radius: 2px;
}

/* Form Actions */
.form-actions {
    padding: 1.5rem;
    background: var(--bg);
    border-top: 1px solid var(--border-light);
}

/* Dual buttons layout (Retour + Valider) */
.form-actions-dual {
    display: flex;
    gap: 1rem;
    justify-content: space-between;
}

.form-actions-dual .btn-secondary {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-actions-dual .btn-submit {
    flex: 1;
}

/* Button with icon */
.btn-next {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-back {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Radio group with 4 items */
.radio-group-4 {
    grid-template-columns: repeat(2, 1fr);
}

.btn-submit {
    width: 100%;
    padding: 1rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-submit:hover {
    background: var(--primary-light);
}

.btn-submit:disabled {
    background: var(--text-muted);
    cursor: not-allowed;
}

/* Loader */
.loader {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Success Message */
.success-message {
    text-align: center;
    padding: 3rem 2rem;
}

.success-icon {
    width: 64px;
    height: 64px;
    background: var(--success);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    font-size: 1.5rem;
}

.success-message h3 {
    font-size: 1.25rem;
    color: var(--text);
    margin-bottom: 0.5rem;
}

.success-message p {
    color: var(--text-light);
    margin-bottom: 1.5rem;
}

.btn-secondary {
    padding: 0.75rem 2rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background: var(--border-light);
}

/* Departure Message */
.departure-message {
    text-align: center;
    padding: 2rem 1rem;
}

.departure-message svg {
    margin-bottom: 1rem;
}

.departure-message h3 {
    font-size: 1.25rem;
    color: var(--text);
    margin-bottom: 0.5rem;
}

.departure-message p {
    color: var(--text-light);
}

/* Already Submitted Message */
.already-submitted {
    text-align: center;
    padding: 3rem 2rem;
}

.already-submitted svg {
    margin-bottom: 1rem;
    color: var(--primary);
}

.already-submitted h3 {
    font-size: 1.25rem;
    color: var(--text);
    margin-bottom: 0.5rem;
}

.already-submitted p {
    color: var(--text-light);
    margin-bottom: 1.5rem;
}

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════════════════════════ */

@media (max-width: 480px) {
    .container {
        padding: 1rem;
    }

    .login-card {
        padding: 2rem 1.5rem;
    }

    .form-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .user-info {
        flex-direction: column;
    }

    .radio-group {
        grid-template-columns: 1fr;
        /* 1 colonne sur mobile */
    }

    .radio-content {
        padding: 0.875rem 1rem;
        min-height: 56px;
    }

    .radio-icon {
        width: 32px;
        height: 32px;
        font-size: 0.9rem;
    }
}