/**
 * WMH Forms — Styles par défaut.
 * Ces styles sont minimalistes et conçus pour être surchargés par le thème.
 */

/* Layout */
.wmh-forms-wrapper {
    max-width: 100%;
}

.wmh-forms-form {
    max-width: 100%;
}

/* ============================================================
   Stepper horizontal
   ============================================================ */
.wmh-forms-stepper {
    margin-bottom: 2.5rem;
    padding: 0 0.5rem;
}

/* Track : items + connecteurs en ligne */
.wmh-forms-stepper-track {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    width: 100%;
}

/* Connecteur entre les cercles */
.wmh-forms-stepper-connector {
    flex: 1;
    height: 3px;
    margin-top: 20px; /* centre du cercle (40/2) */
    background-color: #e0e2e6;
    border-radius: 2px;
    position: relative;
    overflow: hidden;
    transition: background-color 0.4s ease;
}

.wmh-forms-stepper-connector-filled {
    background-color: #e0e2e6;
}

.wmh-forms-stepper-connector-half {
    background: linear-gradient(90deg, var(--color-3, #00b6ec) 50%, #e0e2e6 50%);
}

/* Item : cercle + label empilés */
.wmh-forms-stepper-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    outline: none;
    -webkit-tap-highlight-color: transparent;
    transition: transform 0.2s ease;
}

.wmh-forms-stepper-clickable {
    cursor: pointer;
}

.wmh-forms-stepper-clickable:hover {
    transform: translateY(-2px);
}

.wmh-forms-stepper-clickable:hover .wmh-forms-stepper-circle {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.wmh-forms-stepper-clickable:focus-visible .wmh-forms-stepper-circle {
    outline: 3px solid var(--color-1, #f49400);
    outline-offset: 3px;
}

/* Cercle numéroté */
.wmh-forms-stepper-circle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 0.9375rem;
    font-weight: 700;
    flex-shrink: 0;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    position: relative;
    z-index: 1;
}

/* Active (étape courante) = bleu marine */
.wmh-forms-stepper-active .wmh-forms-stepper-circle {
    background-color: var(--color-5, #1e3868);
    color: #fff;
    box-shadow: 0 0 0 4px rgba(30, 56, 104, 0.2), 0 2px 8px rgba(30, 56, 104, 0.3);
}

/* Completed = vert avec checkmark */
.wmh-forms-stepper-completed .wmh-forms-stepper-circle {
    background-color: #34a853;
    color: #fff;
}

.wmh-forms-stepper-completed .wmh-forms-stepper-circle svg {
    display: block;
}

/* Pending = gris */
.wmh-forms-stepper-pending .wmh-forms-stepper-circle {
    background-color: #e8eaed;
    color: #9ca3af;
    box-shadow: none;
}

/* Label sous le cercle */
.wmh-forms-stepper-label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #374151;
    text-align: center;
    max-width: 120px;
    line-height: 1.3;
    transition: color 0.3s ease;
}

.wmh-forms-stepper-active .wmh-forms-stepper-label {
    color: var(--color-5, #1e3868);
}

.wmh-forms-stepper-completed .wmh-forms-stepper-label {
    color: #34a853;
}

/* Subtitle sous le label */
.wmh-forms-stepper-subtitle {
    font-size: 0.6875rem;
    font-weight: 400;
    color: #9ca3af;
    text-align: center;
    max-width: 120px;
    line-height: 1.2;
    margin-top: 2px;
}
.wmh-forms-stepper-active .wmh-forms-stepper-subtitle { color: var(--color-5, #1e3868); opacity: 0.8; }
.wmh-forms-stepper-completed .wmh-forms-stepper-subtitle { color: #34a853; opacity: 0.7; }

.wmh-forms-stepper-pending .wmh-forms-stepper-label {
    color: #b0b5bd;
}

/* Bandeau succès */
.wmh-forms-success-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px;
    margin: 16px 0;
    background-color: #ecfdf5;
    border: 1px solid #a7f3d0;
    border-radius: 8px;
    color: #065f46;
    font-size: 0.9375rem;
    font-weight: 500;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Barre de progression (désactivée, les connecteurs suffisent) */

/* Responsive : mobile = cacher labels, réduire cercles */
@media (max-width: 640px) {
    .wmh-forms-stepper-label {
        display: none;
    }

    .wmh-forms-stepper-circle {
        width: 34px;
        height: 34px;
        font-size: 0.8125rem;
    }

    .wmh-forms-stepper-connector {
        margin-top: 17px;
    }
}

/* Reduce motion */
@media (prefers-reduced-motion: reduce) {
    .wmh-forms-stepper-circle,
    .wmh-forms-stepper-connector,
    .wmh-forms-stepper-item,
    .wmh-forms-progress-bar-fill {
        transition: none;
    }
}

/* Montant total */
.wmh-forms-field-price_display {
    grid-column: 1 / -1;
}

.wmh-forms-price-display {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    padding: 1rem 1.25rem;
    margin-top: 0.5rem;
    border-top: 2px solid #e5e7eb;
    border-bottom: 2px solid #e5e7eb;
    background: #f9fafb;
    border-radius: 0.5rem;
    font-size: 1rem;
}

.wmh-forms-price-display.wmh-forms-price-total {
    padding: 1.25rem 1.5rem;
    background: var(--color-5, #1e3868);
    border: none;
    border-radius: 0.75rem;
    margin-top: 1rem;
}

.wmh-forms-price-display.wmh-forms-price-total .wmh-forms-price-label {
    color: rgba(255, 255, 255, 0.85);
    font-size: 1rem;
}

.wmh-forms-price-display.wmh-forms-price-total .wmh-forms-price-value {
    color: #ffffff;
    font-size: 1.5rem;
}

.wmh-forms-price-display.wmh-forms-price-free {
    text-align: center;
}
.wmh-forms-price-display.wmh-forms-price-free .wmh-forms-price-label {
    color: #ffffff;
    font-size: 1.125rem;
    font-weight: 600;
}

.wmh-forms-price-detail {
    width: 100%;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.8125rem;
    margin-top: 0.375rem;
    text-align: right;
}

/* Le champ price_display doit toujours prendre toute la largeur */
.wmh-forms-field-price_display {
    grid-column: 1 / -1;
}

/* Price display dans les champs standard (accompagnant) */
.wmh-forms-field-width-full .wmh-forms-price-display:not(.wmh-forms-price-total) {
    grid-column: 1 / -1;
}

/* Champs cachés : pas de gap */
.wmh-forms-field-hidden {
    display: none;
}

/* Récapitulatif */
.wmh-forms-field-recap_summary {
    grid-column: 1 / -1;
}

.wmh-forms-recap-section {
    margin-bottom: 1.5rem;
}

.wmh-forms-recap-section:last-child {
    margin-bottom: 0;
}

.wmh-forms-recap-title {
    font-size: 1.125rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding-left: 0.75rem;
    border-left: 4px solid var(--color-2, #00558a);
    margin-bottom: 0.75rem;
    color: #1d2327;
}

.wmh-forms-recap-items {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    overflow: hidden;
}

.wmh-forms-recap-item {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 0.625rem 1rem;
    border-bottom: 1px solid #f0f0f1;
    font-size: 0.9375rem;
}

.wmh-forms-recap-item:last-child {
    border-bottom: none;
}

.wmh-forms-recap-label {
    color: #6b7280;
    flex-shrink: 0;
    margin-right: 1rem;
}

.wmh-forms-recap-value {
    color: #1d2327;
    font-weight: 500;
    text-align: right;
}

.wmh-forms-recap-empty {
    color: #9ca3af;
    font-style: italic;
    font-weight: 400;
}

@media (max-width: 640px) {
    .wmh-forms-recap-item {
        flex-direction: column;
        gap: 0.125rem;
    }
    .wmh-forms-recap-value {
        text-align: left;
    }
}

/* intl-tel-input override */
.wmh-forms-field .iti {
    width: 100%;
}

.wmh-forms-field .iti__tel-input {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    font-size: 1rem;
    line-height: 1.5;
}

.wmh-forms-field .iti__tel-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

/* Autocomplete */
.wmh-forms-autocomplete {
    position: relative;
}

.wmh-forms-autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 100;
    background: #fff;
    border: 1px solid #d1d5db;
    border-top: none;
    border-radius: 0 0 0.5rem 0.5rem;
    max-height: 220px;
    overflow-y: auto;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.wmh-forms-autocomplete-item {
    padding: 0.625rem 0.875rem;
    cursor: pointer;
    font-size: 0.9375rem;
    transition: background 0.1s;
    border-bottom: 1px solid #f3f4f6;
}

.wmh-forms-autocomplete-item:last-child {
    border-bottom: none;
}

.wmh-forms-autocomplete-item:hover,
.wmh-forms-autocomplete-item.is-highlighted {
    background-color: #f0f6fc;
    color: var(--color-2, #00558a);
}

.wmh-forms-autocomplete-item mark {
    background: transparent;
    font-weight: 700;
    color: inherit;
}

.wmh-forms-autocomplete-empty {
    padding: 0.75rem 0.875rem;
    color: #9ca3af;
    font-size: 0.875rem;
    font-style: italic;
}

.wmh-forms-autocomplete-loading {
    padding: 0.75rem 0.875rem;
    color: #6b7280;
    font-size: 0.875rem;
}

.wmh-forms-price-label {
    font-weight: 600;
    color: #374151;
}

.wmh-forms-price-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-5, #1e3868);
}

/* Messages */
.wmh-forms-messages:empty {
    display: none;
}

.wmh-forms-messages {
    margin-bottom: 1rem;
}

.wmh-forms-fields {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
}

@media (min-width: 640px) {
    .wmh-forms-fields {
        grid-template-columns: 1fr 1fr;
    }

    .wmh-forms-field-width-full {
        grid-column: 1 / -1;
    }

    .wmh-forms-field-width-half {
        grid-column: span 1;
    }

    /* Radio, checkbox, textarea, price sont full-width par défaut */
    .wmh-forms-field-radio,
    .wmh-forms-field-checkbox,
    .wmh-forms-field-price_display {
        grid-column: 1 / -1;
    }
}

/* Sections */
.wmh-forms-section {
    margin-bottom: 1.5rem;
}

.wmh-forms-section:last-child {
    margin-bottom: 0;
}

/* Titres */
.wmh-forms-step-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.wmh-forms-step-description {
    margin-bottom: 1.5rem;
    opacity: 0.8;
}

.wmh-forms-section-title {
    grid-column: 1 / -1;
    font-size: 1.25rem;
    font-weight: 700;
    margin-top: 0.5rem;
    margin-bottom: 0.25rem;
}

.wmh-forms-section-description {
    grid-column: 1 / -1;
    opacity: 0.8;
    margin-bottom: 0.5rem;
    font-size: 0.9375rem;
    line-height: 1.5;
}

.wmh-forms-section-description a {
    color: var(--color-2, #00558a);
    text-decoration: underline;
}

/* Labels */
.wmh-forms-label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.375rem;
    font-size: 0.9375rem;
}

.wmh-forms-required {
    color: #dc2626;
}

/* Description sous un champ */
.wmh-forms-field-description {
    font-size: 0.8125rem;
    color: #6b7280;
    margin-top: 0.375rem;
    line-height: 1.5;
}

.wmh-forms-field-description a {
    color: var(--color-2, #00558a);
    text-decoration: underline;
}

/* Champs */
.wmh-forms-input,
.wmh-forms-select,
.wmh-forms-textarea {
    display: block;
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    font-size: 1rem;
    line-height: 1.5;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
    background-color: #fff;
}

.wmh-forms-input:focus,
.wmh-forms-select:focus,
.wmh-forms-textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.wmh-forms-input[readonly],
.wmh-forms-textarea[readonly] {
    background-color: #f3f4f6;
    cursor: not-allowed;
}

/* Radio */
.wmh-forms-radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}
.wmh-forms-radio-group.wmh-forms-radio-vertical {
    flex-direction: column;
    gap: 0.625rem;
}

.wmh-forms-radio-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.9375rem;
}

.wmh-forms-radio {
    width: 1.125rem;
    height: 1.125rem;
    accent-color: currentColor;
}

/* Checkbox */
.wmh-forms-checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.9375rem;
    grid-column: 1 / -1;
}

.wmh-forms-checkbox {
    width: 1.125rem;
    height: 1.125rem;
    margin-top: 0.125rem;
    flex-shrink: 0;
}

/* Erreurs */
.wmh-forms-field-error .wmh-forms-input,
.wmh-forms-field-error .wmh-forms-select,
.wmh-forms-field-error .wmh-forms-textarea {
    border-color: #dc2626;
}

.wmh-forms-field-error .wmh-forms-input:focus,
.wmh-forms-field-error .wmh-forms-select:focus,
.wmh-forms-field-error .wmh-forms-textarea:focus {
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.15);
}

.wmh-forms-error-message {
    display: block;
    color: #dc2626;
    font-size: 0.8125rem;
    margin-top: 0.25rem;
}

/* Messages flash */
.wmh-forms-success {
    background-color: #ecfdf5;
    border: 1px solid #6ee7b7;
    color: #065f46;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
}

.wmh-forms-error {
    background-color: #fef2f2;
    border: 1px solid #fca5a5;
    color: #991b1b;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
}

.wmh-forms-deadline-message {
    text-align: center;
    padding: 2rem;
    font-style: italic;
    opacity: 0.8;
}

/* Boutons */
.wmh-forms-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 2rem;
    gap: 1rem;
}

.wmh-forms-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 9999px;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    border: 2px solid transparent;
    text-decoration: none;
}

.wmh-forms-btn-primary {
    background-color: var(--color-5, #1e3868);
    color: #fff;
}

.wmh-forms-btn-primary:hover {
    background-color: var(--color-1, #f49400);
}

.wmh-forms-btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.wmh-forms-btn-secondary {
    background-color: transparent;
    color: var(--color-5, #1e3868);
    border-color: var(--color-5, #1e3868);
}

.wmh-forms-btn-secondary:hover {
    background-color: var(--color-5, #1e3868);
    color: #fff;
}
