/**
 * Styles - Formulaire d'adhésion FNH
 * @version 1.0.0
 * Design moderne avec Tailwind-inspired utility classes
 */

/* ==============================
   Variables CSS
   ============================== */
:root {
    --fnh-primary: #FFB500;
    --fnh-primary-dark: #e6a200;
    --fnh-primary-light: #ffc533;
    --fnh-success: #10b981;
    --fnh-success-dark: #059669;
    --fnh-error: #ef4444;
    --fnh-error-light: #fee2e2;
    --fnh-gray-50: #f9fafb;
    --fnh-gray-100: #f3f4f6;
    --fnh-gray-200: #e5e7eb;
    --fnh-gray-300: #d1d5db;
    --fnh-gray-400: #9ca3af;
    --fnh-gray-500: #6b7280;
    --fnh-gray-600: #4b5563;
    --fnh-gray-700: #374151;
    --fnh-gray-800: #1f2937;
    --fnh-gray-900: #111827;
    --fnh-border-radius: 8px;
    --fnh-border-radius-lg: 12px;
    --fnh-shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --fnh-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --fnh-shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --fnh-shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --fnh-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==============================
   Alpine.js cloak
   ============================== */
[x-cloak] {
    display: none !important;
}

/* ==============================
   Container principal
   ============================== */
.fnh-adhesion-wrapper {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* ==============================
   Barre de progression
   ============================== */
.fnh-progress-bar-wrapper {
    margin-bottom: 3rem;
}

.fnh-progress-bar {
    height: 8px;
    background-color: var(--fnh-gray-200);
    border-radius: 9999px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.fnh-progress-fill {
    height: 100%;
    background: var(--fnh-primary);
    border-radius: 9999px;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.fnh-progress-text {
    text-align: center;
    font-size: 0.875rem;
    color: var(--fnh-gray-600);
    font-weight: 500;
}

/* ==============================
   Stepper Navigation
   ============================== */
.fnh-stepper {
    display: flex;
    justify-content: space-between;
    margin-bottom: 3rem;
    position: relative;
}

.fnh-stepper::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 0;
    right: 0;
    height: 2px;
    background-color: var(--fnh-gray-200);
    z-index: 0;
}

.fnh-step-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    position: relative;
    z-index: 1;
    cursor: pointer;
    transition: var(--fnh-transition);
}

.fnh-step-item:hover .fnh-step-circle {
    transform: scale(1.1);
}

.fnh-step-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: white;
    border: 2px solid var(--fnh-gray-300);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--fnh-gray-500);
    transition: var(--fnh-transition);
}

.fnh-step-item.active .fnh-step-circle {
    background-color: var(--fnh-primary);
    border-color: var(--fnh-primary);
    color: #000000;
    font-weight: 700;
    box-shadow: 0 0 0 4px rgba(255, 181, 0, 0.2);
}

.fnh-step-item.completed .fnh-step-circle {
    background-color: var(--fnh-success);
    border-color: var(--fnh-success);
    color: white;
}

.fnh-check-icon {
    width: 20px;
    height: 20px;
}

.fnh-step-label {
    font-size: 0.75rem;
    color: var(--fnh-gray-500);
    font-weight: 500;
    text-align: center;
    max-width: 80px;
}

.fnh-step-item.active .fnh-step-label {
    color: var(--fnh-primary);
    font-weight: 600;
}

.fnh-step-item.completed .fnh-step-label {
    color: var(--fnh-success);
}

/* ==============================
   Formulaire
   ============================== */
.fnh-form {
    background: white;
    border-radius: var(--fnh-border-radius-lg);
    box-shadow: var(--fnh-shadow-md);
    padding: 2.5rem;
}

.fnh-step-content {
    animation: fadeIn 0.4s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fnh-step-title {
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--fnh-gray-900);
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    padding-left: 1rem;
    border-bottom: 3px solid var(--fnh-primary);
    border-left: 6px solid var(--fnh-primary);
    position: relative;
}

.fnh-step-title::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0;
    width: 80px;
    height: 3px;
    background: var(--fnh-primary);
}

/* ==============================
   Form Groups
   ============================== */
.fnh-form-group {
    margin-bottom: 1.5rem;
}

.fnh-form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.fnh-label {
    display: block;
    font-weight: 600;
    color: var(--fnh-gray-700);
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

.fnh-input,
.fnh-textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--fnh-gray-300);
    border-radius: var(--fnh-border-radius);
    font-size: 1rem;
    color: var(--fnh-gray-900);
    transition: var(--fnh-transition);
    background-color: white;
}

.fnh-input:focus,
.fnh-textarea:focus {
    outline: none;
    border-color: var(--fnh-primary);
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

.fnh-input::placeholder,
.fnh-textarea::placeholder {
    color: var(--fnh-gray-400);
}

.fnh-input-error {
    border-color: var(--fnh-error);
}

.fnh-input-error:focus {
    border-color: var(--fnh-error);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.fnh-error {
    display: block;
    color: var(--fnh-error);
    font-size: 0.875rem;
    margin-top: 0.5rem;
    font-weight: 500;
}

/* ==============================
   Radio Groups
   ============================== */
.fnh-radio-group {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.fnh-radio-card {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.25rem;
    border: 2px solid var(--fnh-gray-300);
    border-radius: var(--fnh-border-radius);
    cursor: pointer;
    transition: var(--fnh-transition);
    background-color: white;
}

.fnh-radio-card:hover {
    border-color: var(--fnh-primary);
    box-shadow: var(--fnh-shadow);
    transform: translateY(-2px);
}

.fnh-radio-card input[type="radio"] {
    width: 20px;
    height: 20px;
    margin-top: 2px;
    cursor: pointer;
    accent-color: var(--fnh-primary);
}

.fnh-radio-card input[type="radio"]:checked ~ .fnh-radio-content {
    color: var(--fnh-primary);
}

.fnh-radio-card:has(input[type="radio"]:checked) {
    border-color: var(--fnh-primary);
    background-color: rgba(0, 102, 204, 0.03);
    box-shadow: 0 0 0 1px var(--fnh-primary);
}

.fnh-radio-content {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex: 1;
}

.fnh-radio-title {
    font-weight: 600;
    color: var(--fnh-gray-900);
    font-size: 1rem;
}

.fnh-radio-desc {
    font-size: 0.875rem;
    color: var(--fnh-gray-500);
}

.fnh-radio-card-small {
    padding: 1rem;
}

.fnh-radio-card-small input[type="radio"] {
    margin-right: 0.75rem;
}

.fnh-radio-card-small span {
    font-size: 0.9375rem;
    color: var(--fnh-gray-700);
}

/* Radio inline */
.fnh-radio-group-inline {
    display: flex;
    gap: 2rem;
}

.fnh-radio-inline {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.fnh-radio-inline input[type="radio"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--fnh-primary);
}

.fnh-radio-inline span {
    font-size: 1rem;
    color: var(--fnh-gray-700);
    font-weight: 500;
}

/* ==============================
   Checkbox
   ============================== */
.fnh-checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    cursor: pointer;
    font-size: 0.9375rem;
    color: var(--fnh-gray-700);
    line-height: 1.5;
}

.fnh-checkbox {
    width: 20px;
    height: 20px;
    margin-top: 2px;
    cursor: pointer;
    accent-color: var(--fnh-primary);
}

/* ==============================
   Récapitulatif
   ============================== */
.fnh-summary-card {
    background-color: var(--fnh-gray-50);
    border: 1px solid var(--fnh-gray-200);
    border-radius: var(--fnh-border-radius-lg);
    padding: 2rem;
    margin-bottom: 2rem;
}

.fnh-summary-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--fnh-gray-900);
    margin-bottom: 1.5rem;
}

.fnh-summary-section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--fnh-gray-300);
}

.fnh-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.fnh-summary-label {
    font-weight: 600;
    color: var(--fnh-gray-700);
    font-size: 0.9375rem;
}

.fnh-summary-value {
    text-align: right;
    color: var(--fnh-gray-900);
    font-size: 0.9375rem;
}

.fnh-summary-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1.5rem;
}

.fnh-summary-total-label {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--fnh-gray-900);
}

.fnh-summary-total-value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--fnh-primary);
}

/* Affichage spécifique Partenaire */
.fnh-partenaire-amount {
    text-align: center;
    padding-top: 1.5rem;
    margin-top: 1.5rem;
    border-top: 2px solid var(--fnh-gray-200);
}

.fnh-partenaire-label {
    font-size: 1rem;
    font-weight: 700;
    color: var(--fnh-gray-700);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.75rem;
}

.fnh-partenaire-value {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--fnh-primary);
    line-height: 1;
}

/* ==============================
   Signature Pad
   ============================== */
.fnh-signature-wrapper {
    position: relative;
}

.fnh-signature-canvas {
    width: 100%;
    height: 200px;
    border: 2px solid var(--fnh-gray-300);
    border-radius: var(--fnh-border-radius);
    cursor: crosshair;
    background-color: white;
    touch-action: none;
}

.fnh-signature-canvas.fnh-input-error {
    border-color: var(--fnh-error);
}

.fnh-btn-clear-signature {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    padding: 0.5rem 1rem;
    background-color: white;
    border: 1px solid var(--fnh-gray-300);
    border-radius: var(--fnh-border-radius);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--fnh-gray-700);
    cursor: pointer;
    transition: var(--fnh-transition);
}

.fnh-btn-clear-signature:hover {
    background-color: var(--fnh-gray-50);
    border-color: var(--fnh-gray-400);
}

/* ==============================
   Info Box
   ============================== */
.fnh-info-box {
    display: flex;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background-color: #dbeafe;
    border: 1px solid #93c5fd;
    border-radius: var(--fnh-border-radius);
    margin-bottom: 1.5rem;
}

.fnh-info-icon {
    width: 20px;
    height: 20px;
    color: #1d4ed8;
    flex-shrink: 0;
    margin-top: 2px;
}

.fnh-info-box p {
    margin: 0;
    color: #1e40af;
    font-size: 0.9375rem;
    line-height: 1.5;
}

/* ==============================
   Help Text & Sections
   ============================== */
.fnh-help-text {
    font-size: 14px;
    line-height: 1.6;
    color: #666;
    padding: 12px 16px;
    background-color: #f5f5f5;
    border-left: 3px solid var(--fnh-primary);
    border-radius: var(--fnh-border-radius);
    margin-bottom: 1.5rem;
}

.fnh-help-text p {
    margin: 0;
}

.fnh-help-text strong {
    font-weight: 600;
    color: #333;
}

.fnh-section-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--fnh-gray-900);
    margin-bottom: 0.5rem;
    margin-top: 2rem;
    text-transform: uppercase;
}

.fnh-signature-help {
    font-size: 0.9375rem;
    color: var(--fnh-gray-600);
    margin-bottom: 1rem;
    font-style: italic;
}

/* ==============================
   Boutons
   ============================== */
.fnh-form-actions {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 2.5rem;
    padding-top: 2rem;
    border-top: 1px solid var(--fnh-gray-200);
}

.fnh-btn {
    padding: 0.875rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: var(--fnh-border-radius);
    border: none;
    cursor: pointer;
    transition: var(--fnh-transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 140px;
}

.fnh-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.fnh-btn-primary {
    background-color: var(--fnh-primary);
    color: #000000;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

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

.fnh-btn-secondary {
    background-color: white;
    color: var(--fnh-gray-700);
    border: 2px solid var(--fnh-gray-300);
}

.fnh-btn-secondary:hover:not(:disabled) {
    background-color: var(--fnh-gray-50);
    border-color: var(--fnh-gray-400);
}

.fnh-btn-success {
    background: var(--fnh-primary);
    color: #000000;
    font-size: 1.125rem;
    padding: 1rem 2.5rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.fnh-btn-success:hover:not(:disabled) {
    background-color: var(--fnh-primary-dark);
    box-shadow: var(--fnh-shadow-lg);
    transform: translateY(-2px);
}

/* ==============================
   Responsive
   ============================== */
@media (max-width: 768px) {
    .fnh-adhesion-wrapper {
        padding: 1rem 0.5rem;
    }

    .fnh-form {
        padding: 1.5rem 1rem;
    }

    .fnh-stepper {
        gap: 0.5rem;
    }

    .fnh-step-label {
        font-size: 0.625rem;
        max-width: 60px;
    }

    .fnh-step-circle {
        width: 32px;
        height: 32px;
        font-size: 0.75rem;
    }

    .fnh-step-title {
        font-size: 1.5rem;
    }

    .fnh-form-row {
        grid-template-columns: 1fr;
    }

    .fnh-radio-group-inline {
        flex-direction: column;
        gap: 1rem;
    }

    .fnh-summary-card {
        padding: 1.5rem 1rem;
    }

    .fnh-summary-row {
        flex-direction: column;
        gap: 0.25rem;
    }

    .fnh-summary-value {
        text-align: left;
    }

    .fnh-summary-total {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .fnh-form-actions {
        flex-direction: column-reverse;
    }

    .fnh-btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .fnh-stepper::before {
        display: none;
    }

    .fnh-step-item {
        flex-direction: row;
        gap: 0.25rem;
    }

    .fnh-step-label {
        max-width: none;
        text-align: left;
        font-size: 0.5rem;
    }

    .fnh-signature-canvas {
        height: 150px;
    }
}

/* ==============================
   Animations & Transitions
   ============================== */
@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.fnh-step-content {
    animation: fadeIn 0.4s ease-in-out;
}

/* ==============================
   Print Styles
   ============================== */
@media print {
    .fnh-progress-bar-wrapper,
    .fnh-stepper,
    .fnh-form-actions {
        display: none;
    }

    .fnh-form {
        box-shadow: none;
        border: 1px solid var(--fnh-gray-300);
    }
}
