/**
 * FEVE Adhesion - Styles du formulaire
 * 
 * Design sobre et institutionnel pour le formulaire d'adhésion
 * Radio buttons desktop + Select mobile
 */

/* ========================================
   Container principal
   ======================================== */
.feve-adhesion-container {
    max-width: 700px;
    margin: 0 auto;
    padding: 20px;
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* ========================================
   Header du formulaire
   ======================================== */
.feve-form-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #2e7d32;
}

.feve-form-header h2 {
    margin: 0 0 10px 0;
    font-size: 28px;
    color: #1b5e20;
    font-weight: 600;
}

.feve-subtitle {
    margin: 0;
    font-size: 16px;
    color: #666;
}

/* ========================================
   Sections du formulaire
   ======================================== */
.feve-form-section {
    margin-bottom: 30px;
    padding: 20px;
    background-color: #f9f9f9;
    border-radius: 6px;
}

.feve-section-title {
    margin: 0 0 20px 0;
    font-size: 20px;
    color: #1b5e20;
    font-weight: 600;
    padding-bottom: 10px;
    border-bottom: 1px solid #e0e0e0;
}

/* ========================================
   Champs de formulaire standard
   ======================================== */
.feve-form-row {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
}

.feve-form-field {
    margin-bottom: 20px;
}

.feve-field-half {
    flex: 1;
    min-width: 0;
}

.feve-label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #333;
}

.feve-required {
    color: #d32f2f;
}

.feve-input {
    width: 100%;
    padding: 12px 15px;
    font-size: 15px;
    border: 1px solid #d0d0d0;
    border-radius: 4px;
    background-color: #ffffff;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    box-sizing: border-box;
}

.feve-input:focus {
    outline: none;
    border-color: #2e7d32;
    box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.1);
}

.feve-input-error {
    border-color: #d32f2f;
}

.feve-input-error:focus {
    box-shadow: 0 0 0 3px rgba(211, 47, 47, 0.1);
}

.feve-field-help {
    display: block;
    margin-top: 6px;
    font-size: 13px;
    color: #666;
}

/* ========================================
   Section Cotisation (Radio Buttons)
   ======================================== */
.feve-cotisation-section {
    background: linear-gradient(135deg, #f5f9f5 0%, #ffffff 100%);
    border: 2px solid #2e7d32;
}

/* Radio buttons stylés en cartes (DESKTOP) */
.feve-radio-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 30px;
}

.feve-radio-card {
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
}

.feve-radio-card input[type="radio"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.feve-radio-label {
    display: flex;
    align-items: center;
    padding: 18px 24px;
    background: #fafafa;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

/* Indicateur radio personnalisé */
.feve-radio-indicator {
    width: 24px;
    height: 24px;
    border: 2px solid #c0c0c0;
    border-radius: 50%;
    margin-right: 16px;
    position: relative;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.feve-radio-indicator::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    width: 12px;
    height: 12px;
    background: white;
    border-radius: 50%;
    transition: transform 0.2s ease;
}

/* Texte du label */
.feve-radio-text {
    flex: 1;
    font-size: 16px;
    color: #333;
    font-weight: 500;
}

/* Prix associé */
.feve-radio-price {
    font-size: 15px;
    color: #666;
    font-weight: 600;
    margin-left: 12px;
}

/* États hover */
.feve-radio-card:hover .feve-radio-label {
    background: #f5f5f5;
    border-color: #2e7d32;
    transform: translateX(4px);
    box-shadow: 0 2px 8px rgba(46, 125, 50, 0.1);
}

.feve-radio-card:hover .feve-radio-indicator {
    border-color: #2e7d32;
}

/* État sélectionné */
.feve-radio-card input[type="radio"]:checked ~ .feve-radio-label {
    background: linear-gradient(135deg, #e8f5e9 0%, #f1f8f1 100%);
    border-color: #2e7d32;
    border-width: 2px;
    box-shadow: 0 4px 12px rgba(46, 125, 50, 0.15);
}

.feve-radio-card input[type="radio"]:checked ~ .feve-radio-label .feve-radio-indicator {
    background: #2e7d32;
    border-color: #2e7d32;
}

.feve-radio-card input[type="radio"]:checked ~ .feve-radio-label .feve-radio-indicator::after {
    transform: translate(-50%, -50%) scale(1);
}

.feve-radio-card input[type="radio"]:checked ~ .feve-radio-label .feve-radio-text {
    color: #1b5e20;
    font-weight: 600;
}

.feve-radio-card input[type="radio"]:checked ~ .feve-radio-label .feve-radio-price {
    color: #2e7d32;
    font-weight: 700;
}

/* Focus clavier (accessibilité) */
.feve-radio-card input[type="radio"]:focus ~ .feve-radio-label {
    outline: 3px solid rgba(46, 125, 50, 0.3);
    outline-offset: 2px;
}

/* Select natif pour mobile (caché par défaut) */
.feve-select-mobile {
    display: none;
    margin-bottom: 30px;
}

.feve-select {
    width: 100%;
    padding: 14px 15px;
    font-size: 16px;
    border: 2px solid #2e7d32;
    border-radius: 6px;
    background-color: #ffffff;
    color: #333;
    cursor: pointer;
    transition: all 0.3s ease;
    appearance: none;
    background-image: url('data:image/svg+xml;utf8,<svg fill="%232e7d32" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M7 10l5 5 5-5z"/></svg>');
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 24px;
    padding-right: 45px;
}

.feve-select:focus {
    outline: none;
    border-color: #1b5e20;
    box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.2);
}

/* Box de prix calculé */
.feve-price-display {
    background: linear-gradient(135deg, #2e7d32 0%, #1b5e20 100%);
    border-radius: 12px;
    padding: 30px;
    text-align: center;
    margin-top: 30px;
    box-shadow: 0 6px 20px rgba(46, 125, 50, 0.3);
    transition: transform 0.3s ease;
}

.feve-price-display:hover {
    transform: translateY(-2px);
}

.feve-price-label {
    display: block;
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.feve-price-amount {
    display: block;
    color: white;
    font-size: 42px;
    font-weight: 700;
    transition: all 0.3s ease;
}

.feve-price-amount.feve-price-updated {
    animation: feve-price-pulse 0.4s ease;
}

@keyframes feve-price-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* ========================================
   Checkbox renouvellement
   ======================================== */
.feve-checkbox-container {
    display: flex;
    align-items: flex-start;
    cursor: pointer;
    user-select: none;
}

.feve-checkbox {
    width: 20px;
    height: 20px;
    margin-right: 12px;
    margin-top: 2px;
    cursor: pointer;
    accent-color: #2e7d32;
}

.feve-checkbox-label {
    font-size: 15px;
    color: #333;
}

/* ========================================
   Messages d'erreur et succès
   ======================================== */
.feve-form-errors {
    margin-bottom: 20px;
    padding: 15px;
    background-color: #ffebee;
    border-left: 4px solid #d32f2f;
    border-radius: 4px;
}

.feve-form-success {
    margin-bottom: 20px;
    padding: 15px;
    background-color: #e8f5e9;
    border-left: 4px solid #2e7d32;
    border-radius: 4px;
}

.feve-form-success p {
    margin: 5px 0;
    color: #1b5e20;
}

.feve-error-list {
    margin: 10px 0 0 0;
    padding: 0 0 0 20px;
    color: #c62828;
}

.feve-error-list li {
    margin-bottom: 5px;
}

/* ========================================
   Bouton de soumission
   ======================================== */
.feve-form-actions {
    text-align: center;
    margin-top: 30px;
}

.feve-submit-button {
    display: inline-block;
    padding: 16px 40px;
    font-size: 16px;
    font-weight: 600;
    color: #ffffff;
    background: linear-gradient(135deg, #2e7d32 0%, #1b5e20 100%);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 4px 12px rgba(46, 125, 50, 0.3);
    min-width: 280px;
}

.feve-submit-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(46, 125, 50, 0.4);
}

.feve-submit-button:active {
    transform: translateY(0);
}

.feve-submit-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.feve-button-loader {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.feve-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: feve-spin 0.8s linear infinite;
}

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

/* ========================================
   Cotisation juridique - Champ avec suffixe
   ======================================== */
.feve-input-group {
    position: relative;
    display: flex;
    align-items: center;
}

.feve-input-group .feve-input {
    padding-right: 35px;
}

.feve-input-suffix {
    position: absolute;
    right: 15px;
    font-size: 15px;
    font-weight: 600;
    color: #666;
    pointer-events: none;
}

/* ========================================
   Affichage du total avec breakdown
   ======================================== */
.feve-total-display {
    margin-top: 20px;
    padding: 20px;
    background-color: #ffffff;
    border: 2px solid #2e7d32;
    border-radius: 6px;
}

.feve-total-breakdown {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.feve-total-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
}

.feve-total-line.feve-total-final {
    border-top: 2px solid #2e7d32;
    padding-top: 15px;
    margin-top: 5px;
}

.feve-total-label {
    font-size: 15px;
    color: #333;
}

.feve-total-final .feve-total-label {
    font-size: 18px;
    font-weight: 700;
    color: #1b5e20;
}

.feve-total-value {
    font-size: 16px;
    font-weight: 600;
    color: #2e7d32;
}

.feve-total-final .feve-total-value {
    font-size: 24px;
    font-weight: 700;
    color: #1b5e20;
}

/* Animation du total */
.feve-total-display {
    animation: feve-slide-in 0.3s ease-out;
}

@keyframes feve-slide-in {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================
   Informations légales
   ======================================== */
.feve-legal-info {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
    text-align: center;
}

.feve-legal-text {
    margin: 0;
    font-size: 13px;
    color: #666;
}

/* ========================================
   Responsive - Tablet et Mobile
   ======================================== */
@media (max-width: 768px) {
    /* Masquer radio buttons sur mobile */
    .feve-radio-group {
        display: none !important;
    }
    
    /* Afficher select natif sur mobile */
    .feve-select-mobile {
        display: block !important;
    }
    
    .feve-adhesion-container {
        padding: 15px;
        border-radius: 0;
        box-shadow: none;
    }

    .feve-form-header h2 {
        font-size: 24px;
    }

    .feve-subtitle {
        font-size: 14px;
    }

    .feve-form-row {
        flex-direction: column;
        gap: 0;
    }

    .feve-form-section {
        padding: 15px;
    }

    .feve-section-title {
        font-size: 18px;
    }

    .feve-price-amount {
        font-size: 36px;
    }

    .feve-submit-button {
        width: 100%;
        min-width: auto;
    }
}

@media (max-width: 480px) {
    .feve-price-amount {
        font-size: 32px;
    }

    .feve-price-display {
        padding: 20px;
    }
}

/* ========================================
   Modal
   ======================================== */
.feve-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
}

.feve-modal.feve-modal-visible {
    display: block;
}

.feve-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
}

.feve-modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.feve-modal-close {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    font-size: 32px;
    color: #999;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 30px;
    height: 30px;
}

.feve-modal-close:hover {
    color: #333;
}

.feve-modal-message {
    font-size: 16px;
    line-height: 1.6;
    color: #333;
}

.feve-modal-message a {
    color: #2e7d32;
    text-decoration: underline;
}

.feve-modal-message a:hover {
    color: #1b5e20;
}
