/* ===========================================
   FORM.CSS - Styles pour le formulaire
   =========================================== */

/* Card formulaire principale */
.form-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 16px;
    padding: 1.2rem;
    margin: 1rem;
    max-width: 450px;
    margin-left: auto;
    margin-right: auto;
}

/* Titre formulaire */
.form-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: #1a365d;
    margin-bottom: 0.8rem;
}

/* Meta infos */
.form-meta {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    margin-bottom: 1rem;
    padding-bottom: 0.8rem;
    border-bottom: 1px solid #eee;
}

.form-meta span {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    color: #666;
}

.form-meta svg {
    width: 14px;
    height: 14px;
    stroke: #639241;
}

/* Texte champs obligatoires */
.form-required-text {
    font-size: 0.95rem;
    color: #333;
    margin-bottom: 1.2rem;
}

.required {
    color: #c0392b;
}

/* ===========================================
   STEPPER
   =========================================== */
.stepper {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    margin-bottom: 1.2rem;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
}

.step-circle {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background-color: #e8e8e8;
    color: #999;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.8rem;
}

.step.active .step-circle {
    background-color: #639241;
    color: #fff;
}

.step-label {
    font-size: 0.7rem;
    color: #999;
    text-align: center;
}

.step.active .step-label {
    color: #333;
    font-weight: 500;
}

.step-line {
    width: 35px;
    height: 2px;
    background-color: #e8e8e8;
    margin: 13px 0.4rem 0;
}

/* ===========================================
   FORMULAIRE
   =========================================== */
.billing-form {
    padding: 0 0.2rem;
}

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

.form-group label {
    display: block;
    font-size: 0.95rem;
    font-weight: 500;
    color: #333;
    margin-bottom: 0.4rem;
}

.form-group input {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    border: 1px solid #ddd;
    border-radius: 25px;
    background-color: #f8f9fa;
    transition: border-color 0.2s ease, background-color 0.2s ease;
    box-sizing: border-box;
}

.form-group input:focus {
    outline: none;
    border-color: #639241;
    background-color: #fff;
}

.form-group input::placeholder {
    color: #aaa;
}

/* Input avec espacement entre chiffres (numéro ID) */
.input-spaced {
    letter-spacing: 2px;
    font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
}

/* État erreur */
.form-group.error input,
.form-group.error .phone-input-container {
    border-color: #c0392b;
}

.form-group.error input {
    background-color: #fef8f8;
}

.form-group.error .error-message {
    display: block;
}

.error-message {
    display: none;
    color: #c0392b;
    font-size: 0.8rem;
    margin-top: 0.3rem;
    padding-left: 1rem;
}

/* ===========================================
   SÉLECTEUR DE PAYS AVEC DRAPEAUX
   =========================================== */
.phone-input-container {
    display: flex;
    gap: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 25px;
    padding: 0.75rem 1rem;
    background-color: #f8f9fa;
    transition: border-color 0.2s ease, background-color 0.2s ease;
}

.phone-input-container:focus-within {
    border-color: #639241;
    background-color: #fff;
}

/* Sélecteur de pays */
.country-selector {
    position: relative;
    flex-shrink: 0;
}

.country-selected {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    cursor: pointer;
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    transition: background-color 0.2s ease;
}

.country-selected:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.country-flag {
    font-size: 1.3rem;
    line-height: 1;
}

.country-code {
    font-weight: 500;
    color: #333;
    font-size: 0.95rem;
}

.dropdown-arrow {
    width: 14px;
    height: 14px;
    stroke: #666;
    transition: transform 0.2s ease;
}

.country-dropdown.open + .country-selected .dropdown-arrow,
.country-selected:hover .dropdown-arrow {
    transform: rotate(180deg);
}

/* Dropdown des pays */
.country-dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 100;
    min-width: 220px;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    pointer-events: none;
}

.country-dropdown.open {
    max-height: 300px;
    opacity: 1;
    transform: translateY(0);
    pointer-events: all;
}

.country-option {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.8rem 1rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
    position: relative;
}

.country-option:hover {
    background-color: #f5f5f5;
}

.country-option:first-child {
    border-radius: 12px 12px 0 0;
}

.country-option:last-child {
    border-radius: 0 0 12px 12px;
}

.country-option .country-flag {
    font-size: 1.5rem;
}

.country-option .country-name {
    flex: 1;
    font-weight: 500;
    color: #333;
    font-size: 0.95rem;
}

.country-option .country-code {
    color: #666;
    font-size: 0.9rem;
}

.country-option .check-icon {
    width: 18px;
    height: 18px;
    stroke: #639241;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.country-option.active {
    background-color: #f0f7ec;
}

.country-option.active .check-icon {
    opacity: 1;
}

/* Input téléphone */
.phone-input-container input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 0;
    font-size: 1rem;
}

.phone-input-container input:focus {
    outline: none;
    background: transparent;
}

/* ===========================================
   CODE POSTAL + VILLE
   =========================================== */
.form-row {
    display: flex;
    gap: 0.8rem;
}

.form-group-small {
    flex: 0 0 35%;
}

.form-group-large {
    flex: 1;
}

/* ===========================================
   BOUTON
   =========================================== */
.form-actions {
    margin-top: 1.5rem;
}

.form-actions .btn-cta {
    width: 100%;
    border-radius: 25px;
}

/* ===========================================
   FOOTER SIMPLE
   =========================================== */
.footer-simple {
    padding: 1rem;
    text-align: center;
    font-size: 0.8rem;
    color: #999;
}

/* ===========================================
   RESPONSIVE
   =========================================== */
@media (min-width: 768px) {
    .form-card {
        padding: 1.5rem;
        margin: 1.5rem auto;
    }
    
    .form-meta {
        flex-direction: row;
        gap: 1.2rem;
    }
    
    .step-line {
        width: 50px;
    }
    
    .form-actions .btn-cta {
        width: auto;
        min-width: 180px;
        display: block;
        margin: 0 auto;
    }
}

@media (max-width: 400px) {
    .form-card {
        margin: 0.5rem;
        padding: 1rem;
    }
    
    .form-row {
        flex-direction: column;
        gap: 0;
    }
    
    .form-group-small,
    .form-group-large {
        flex: 1;
    }
    
    .step-line {
        width: 20px;
    }
    
    .step-label {
        font-size: 0.6rem;
    }
    
    .country-dropdown {
        left: -1rem;
        right: -1rem;
        min-width: auto;
    }
}