/**
 * HDKN Dynamic Forms - Frontend Styles
 * Radio/Checkbox simples et natifs
 */

/* ==========================================================================
   VARIABLES
   ========================================================================== */

.hdkn-form-wrapper {
    --hdkn-primary: #0073aa;
    --hdkn-primary-hover: #005a87;
    --hdkn-text: #333;
    --hdkn-text-light: #666;
    --hdkn-border: #ccc;
    --hdkn-radius: 4px;
    --hdkn-error: #dc3545;
    --hdkn-success: #28a745;
    --hdkn-btn-bg: #0073aa;
    --hdkn-btn-hover: #005a87;
    --hdkn-btn-text: #ffffff;
    --hdkn-btn-prev-bg: #f0f0f0;
    --hdkn-btn-prev-hover: #e0e0e0;
    --hdkn-btn-prev-text: #333333;
    --hdkn-label-color: #333333;
    --hdkn-label-size: 14px;
    --hdkn-label-weight: 600;
    --hdkn-label-transform: none;
}

/* ==========================================================================
   BASE
   ========================================================================== */

.hdkn-form-wrapper {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: var(--hdkn-text);
}

.hdkn-form-wrapper * {
    box-sizing: border-box;
}

/* ==========================================================================
   LAYOUT CHAMPS
   ========================================================================== */

.hdkn-step-fields {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -10px;
}

.hdkn-field {
    width: 100%;
    padding: 0 10px;
    margin-bottom: 14px;
}

/* Largeurs en % */
.hdkn-field.hdkn-width-100 { width: 100%; }
.hdkn-field.hdkn-width-90 { width: 90%; }
.hdkn-field.hdkn-width-80 { width: 80%; }
.hdkn-field.hdkn-width-75 { width: 75%; }
.hdkn-field.hdkn-width-70 { width: 70%; }
.hdkn-field.hdkn-width-60 { width: 60%; }
.hdkn-field.hdkn-width-50 { width: 50%; }
.hdkn-field.hdkn-width-40 { width: 40%; }
.hdkn-field.hdkn-width-30 { width: 30%; }
.hdkn-field.hdkn-width-25 { width: 25%; }
.hdkn-field.hdkn-width-20 { width: 20%; }

/* Responsive : mobile = toujours 100% */
@media (max-width: 600px) {
    .hdkn-field[class*="hdkn-width-"] {
        width: 100%;
    }
}

.hdkn-field.hdkn-hidden {
    display: none !important;
}

/* ==========================================================================
   SÉPARATEUR (DIVIDER)
   ========================================================================== */

.hdkn-divider {
    border: none;
    border-top: 1px solid var(--hdkn-border);
    margin: 20px 0;
}

.hdkn-divider.hdkn-divider-margin-small { margin: 10px 0; }
.hdkn-divider.hdkn-divider-margin-medium { margin: 20px 0; }
.hdkn-divider.hdkn-divider-margin-large { margin: 30px 0; }
.hdkn-divider.hdkn-divider-margin-xlarge { margin: 50px 0; }

/* ==========================================================================
   HEADING (TITRE)
   ========================================================================== */

.hdkn-heading {
    margin: 0 0 10px 0;
    color: var(--hdkn-text);
    font-weight: 600;
    line-height: 1.3;
}

.hdkn-heading.hdkn-align-left { text-align: left; }
.hdkn-heading.hdkn-align-center { text-align: center; }
.hdkn-heading.hdkn-align-right { text-align: right; }

/* ==========================================================================
   PARAGRAPH (TEXTE)
   ========================================================================== */

.hdkn-paragraph {
    margin: 0 0 15px 0;
    color: var(--hdkn-text-light);
    line-height: 1.6;
}

.hdkn-paragraph.hdkn-align-left { text-align: left; }
.hdkn-paragraph.hdkn-align-center { text-align: center; }
.hdkn-paragraph.hdkn-align-right { text-align: right; }

.hdkn-paragraph.hdkn-size-small { font-size: 13px; }
.hdkn-paragraph.hdkn-size-normal { font-size: 15px; }
.hdkn-paragraph.hdkn-size-large { font-size: 17px; }
.hdkn-paragraph.hdkn-size-xlarge { font-size: 20px; }

/* ==========================================================================
   LABELS
   ========================================================================== */

.hdkn-label {
    display: block;
    margin-bottom: 4px;
    font-weight: var(--hdkn-label-weight);
    font-size: var(--hdkn-label-size);
    color: var(--hdkn-label-color);
    text-transform: var(--hdkn-label-transform);
}

.hdkn-required {
    color: var(--hdkn-error);
    margin-left: 2px;
}

/* ==========================================================================
   INPUTS STANDARDS
   ========================================================================== */

.hdkn-form-wrapper input[type="text"],
.hdkn-form-wrapper input[type="email"],
.hdkn-form-wrapper input[type="tel"],
.hdkn-form-wrapper input[type="url"],
.hdkn-form-wrapper input[type="number"],
.hdkn-form-wrapper input[type="date"],
.hdkn-form-wrapper input[type="time"],
.hdkn-form-wrapper input[type="password"],
.hdkn-form-wrapper select,
.hdkn-form-wrapper textarea {
    width: 100%;
    padding: 6px 10px;
    font-size: 14px;
    font-family: inherit;
    color: #333333;
    background: #fff;
    border: 1px solid var(--hdkn-border);
    border-radius: var(--hdkn-radius);
    transition: border-color 0.2s, box-shadow 0.2s;
}

/* Fix spécifique pour les inputs date/time - couleur forcée */
.hdkn-form-wrapper input[type="date"],
.hdkn-form-wrapper input[type="time"],
.hdkn-form-wrapper input[type="datetime-local"] {
    color: #333333 !important;
}

/* Webkit date picker */
.hdkn-form-wrapper input[type="date"]::-webkit-datetime-edit,
.hdkn-form-wrapper input[type="date"]::-webkit-datetime-edit-fields-wrapper,
.hdkn-form-wrapper input[type="date"]::-webkit-datetime-edit-text,
.hdkn-form-wrapper input[type="date"]::-webkit-datetime-edit-month-field,
.hdkn-form-wrapper input[type="date"]::-webkit-datetime-edit-day-field,
.hdkn-form-wrapper input[type="date"]::-webkit-datetime-edit-year-field {
    color: #333333;
}

.hdkn-form-wrapper input:focus,
.hdkn-form-wrapper select:focus,
.hdkn-form-wrapper textarea:focus {
    outline: none;
    border-color: var(--hdkn-primary);
    box-shadow: 0 0 0 3px rgba(0,115,170,0.15);
}

.hdkn-form-wrapper textarea {
    min-height: 100px;
    resize: vertical;
}

.hdkn-form-wrapper select {
    cursor: pointer;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12'%3E%3Cpath fill='%23333' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

/* ==========================================================================
   RADIO ET CHECKBOX - AVEC OPTIONS
   ========================================================================== */

/* Container du champ */
.hdkn-radio-field,
.hdkn-checkbox-field {
    margin-bottom: 5px;
}

/* Label du champ (pour radio, checkbox, daterange, etc.) */
.hdkn-field > .hdkn-field-label {
    display: block;
    font-weight: var(--hdkn-label-weight);
    font-size: var(--hdkn-label-size);
    color: var(--hdkn-label-color);
    text-transform: var(--hdkn-label-transform);
    margin-bottom: 10px;
}

/* Container des options - en ligne */
.hdkn-radio-options,
.hdkn-checkbox-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 20px;
    align-items: center;
}

/* Item individuel : bouton + texte */
.hdkn-radio-item,
.hdkn-checkbox-item {
    display: inline-flex;
    align-items: center;
}

/* Input natif */
.hdkn-radio-item input[type="radio"],
.hdkn-checkbox-item input[type="checkbox"] {
    -webkit-appearance: auto;
    -moz-appearance: auto;
    appearance: auto;
    width: 16px;
    height: 16px;
    margin: 0;
    margin-right: 6px;
    padding: 0;
    accent-color: var(--hdkn-primary);
    cursor: pointer;
    vertical-align: middle;
}

/* Label texte à côté du bouton */
.hdkn-radio-item label,
.hdkn-checkbox-item label {
    font-weight: 400;
    color: var(--hdkn-text);
    font-size: 15px;
    line-height: 1;
    cursor: pointer;
    vertical-align: middle;
}

/* Ancienne structure (compatibilité fieldset) */
.hdkn-fieldset {
    border: none;
    padding: 0;
    margin: 0;
}

.hdkn-fieldset legend.hdkn-label {
    margin-bottom: 10px;
    padding: 0;
    float: none;
    width: 100%;
}

.hdkn-radio-group,
.hdkn-checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 20px;
    align-items: center;
}

.hdkn-radio-option,
.hdkn-checkbox-option {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

.hdkn-radio-option input[type="radio"],
.hdkn-checkbox-option input[type="checkbox"] {
    -webkit-appearance: auto;
    -moz-appearance: auto;
    appearance: auto;
    width: 16px;
    height: 16px;
    margin: 0;
    padding: 0;
    accent-color: var(--hdkn-primary);
    cursor: pointer;
}

.hdkn-radio-option span,
.hdkn-checkbox-option span {
    font-weight: 400;
    color: var(--hdkn-text);
    font-size: 15px;
    line-height: 1.4;
}

/* ==========================================================================
   FILE INPUT
   ========================================================================== */

.hdkn-file-input {
    position: relative;
}

.hdkn-file {
    width: 100%;
    padding: 12px;
    border: 2px dashed var(--hdkn-border);
    border-radius: var(--hdkn-radius);
    background: #fafafa;
    cursor: pointer;
}

.hdkn-file:hover {
    border-color: var(--hdkn-primary);
    background: #f0f7fc;
}

.hdkn-file-preview {
    margin-top: 8px;
}

.hdkn-file-name {
    font-size: 14px;
    color: var(--hdkn-text-light);
}

.hdkn-field-hint {
    display: block;
    margin-top: 6px;
    font-size: 13px;
    color: var(--hdkn-text-light);
}

/* ==========================================================================
   LAYOUT ELEMENTS
   ========================================================================== */

.hdkn-heading {
    margin: 30px 0 15px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid #eee;
    color: var(--hdkn-text);
}

.hdkn-paragraph {
    margin: 15px 0;
    color: var(--hdkn-text-light);
    line-height: 1.6;
}

.hdkn-divider {
    height: 1px;
    background: #eee;
    margin: 25px 0;
    border: none;
}

/* ==========================================================================
   ERREURS
   ========================================================================== */

.hdkn-field-error {
    color: var(--hdkn-error);
    font-size: 13px;
    margin-top: 5px;
}

.hdkn-field.has-error input,
.hdkn-field.has-error select,
.hdkn-field.has-error textarea {
    border-color: var(--hdkn-error);
}

/* ==========================================================================
   BOUTONS - Couleurs personnalisables
   ========================================================================== */

.hdkn-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 18px;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    border-radius: var(--hdkn-radius);
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.hdkn-btn-submit,
.hdkn-btn-next {
    background: var(--hdkn-btn-bg, var(--hdkn-primary));
    color: var(--hdkn-btn-text, #fff);
}

.hdkn-btn-submit:hover,
.hdkn-btn-next:hover {
    background: var(--hdkn-btn-hover, var(--hdkn-primary-hover));
}

.hdkn-btn-prev {
    background: var(--hdkn-btn-prev-bg, #f0f0f0);
    color: var(--hdkn-btn-prev-text, var(--hdkn-text));
    border: 1px solid var(--hdkn-border);
}

.hdkn-btn-prev:hover {
    background: var(--hdkn-btn-prev-hover, #e0e0e0);
}

.hdkn-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.hdkn-btn.loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
}

.hdkn-btn.loading::after {
    content: "";
    position: absolute;
    width: 18px;
    height: 18px;
    border: 2px solid var(--hdkn-btn-text, #fff);
    border-top-color: transparent;
    border-radius: 50%;
    animation: hdkn-spin 0.8s linear infinite;
}

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

/* ==========================================================================
   MESSAGES
   ========================================================================== */

.hdkn-message {
    padding: 15px 20px;
    margin-bottom: 20px;
    border-radius: var(--hdkn-radius);
}

.hdkn-message-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.hdkn-message-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* ==========================================================================
   MULTI-STEP
   ========================================================================== */

.hdkn-progress-bar {
    margin-bottom: 30px;
}

.hdkn-progress-track {
    height: 4px;
    background: #e0e0e0;
    border-radius: 2px;
    margin-bottom: 20px;
}

.hdkn-progress-fill {
    height: 100%;
    background: var(--hdkn-primary);
    border-radius: 2px;
    transition: width 0.3s;
}

.hdkn-progress-steps {
    display: flex;
    justify-content: space-between;
}

.hdkn-progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
}

.hdkn-step-number {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #e0e0e0;
    color: #999;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 8px;
}

.hdkn-progress-step.active .hdkn-step-number,
.hdkn-progress-step.completed .hdkn-step-number {
    background: var(--hdkn-primary);
    color: #fff;
}

.hdkn-progress-step .hdkn-step-title {
    font-size: 13px;
    color: #999;
}

.hdkn-progress-step.active .hdkn-step-title,
.hdkn-progress-step.completed .hdkn-step-title {
    color: var(--hdkn-text);
    font-weight: 500;
}

/* Masquer le titre d'une étape spécifique */
.hdkn-progress-step.hdkn-hide-title .hdkn-step-title {
    display: none;
}

.hdkn-form-step {
    display: none;
}

.hdkn-form-step.active {
    display: block;
    animation: hdkn-fadeIn 0.3s ease;
}

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

.hdkn-step-header {
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.hdkn-step-header .hdkn-step-title {
    font-size: 20px;
    margin: 0 0 5px 0;
}

.hdkn-step-description {
    color: var(--hdkn-text-light);
    margin: 0;
}

.hdkn-step-navigation {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.hdkn-step-navigation .hdkn-btn:only-child {
    margin-left: auto;
}

.hdkn-form-footer {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

/* ==========================================================================
   STYLES PRESETS
   ========================================================================== */

.hdkn-form-style-minimal input[type="text"],
.hdkn-form-style-minimal input[type="email"],
.hdkn-form-style-minimal input[type="tel"],
.hdkn-form-style-minimal select,
.hdkn-form-style-minimal textarea {
    border: none;
    border-bottom: 2px solid #e0e0e0;
    border-radius: 0;
    padding: 10px 0;
    background: transparent;
}

.hdkn-form-style-minimal input:focus,
.hdkn-form-style-minimal select:focus,
.hdkn-form-style-minimal textarea:focus {
    box-shadow: none;
    border-bottom-color: var(--hdkn-primary);
}

.hdkn-form-wrapper.hdkn-style-modern {
    background: linear-gradient(135deg, #f5f7fa, #e4e8ec);
    padding: 30px;
    border-radius: 12px;
}

.hdkn-form-wrapper.hdkn-style-boxed {
    background: #fff;
    padding: 35px;
    border: 2px solid #e0e0e0;
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

@media (max-width: 768px) {
    .hdkn-field.hdkn-width-75,
    .hdkn-field.hdkn-width-66,
    .hdkn-field.hdkn-width-50,
    .hdkn-field.hdkn-width-33,
    .hdkn-field.hdkn-width-25 {
        width: 100%;
    }
    
    .hdkn-step-navigation {
        flex-direction: column;
    }
    
    .hdkn-step-navigation .hdkn-btn {
        width: 100%;
    }
    
    .hdkn-radio-group,
    .hdkn-checkbox-group {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
}

/* ==========================================================================
   ESTIMATION DE PRIX
   ========================================================================== */

.hdkn-price-estimate {
    background: #fff;
    border: 2px solid var(--price-header-bg, #0073aa);
    border-radius: var(--hdkn-radius, 4px);
    margin: 20px 0;
    overflow: hidden;
}

.hdkn-price-header {
    background: var(--price-header-bg, #0073aa);
    padding: 12px 15px;
}

.hdkn-price-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--price-header-text, #ffffff);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: block;
}

.hdkn-price-items {
    padding: 12px 15px;
    max-height: 200px;
    overflow-y: auto;
    background: #ffffff;
}

.hdkn-price-empty {
    color: var(--price-item-text, #666666);
    font-style: italic;
    font-size: 14px;
    padding: 8px 0;
}

.hdkn-price-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 10px 0;
    border-bottom: 1px dashed #ddd;
    font-size: 14px;
    gap: 10px;
}

.hdkn-price-item:last-child {
    border-bottom: none;
}

.hdkn-price-item-label {
    color: var(--price-item-text, #333333);
    flex: 1;
    padding-right: 10px;
    font-weight: 500;
    line-height: 1.4;
}

.hdkn-price-item-value {
    color: var(--price-total-color, #0073aa);
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
}

.hdkn-price-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 15px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-top: 2px solid var(--price-header-bg, #0073aa);
}

.hdkn-price-total-label {
    font-size: 15px;
    font-weight: 700;
    color: var(--price-item-text, #333333);
    text-transform: uppercase;
}

.hdkn-price-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--price-total-color, #0073aa);
}

.hdkn-price-amount {
    transition: all 0.3s ease;
}

.hdkn-price-suffix {
    font-size: 18px;
    margin-left: 3px;
}

.hdkn-price-estimate.updating .hdkn-price-amount {
    opacity: 0.5;
}

@media (max-width: 600px) {
    .hdkn-price-items {
        max-height: 150px;
    }
}

/* ==========================================================================
   CHAMP ADRESSE AVEC AUTOCOMPLÉTION
   ========================================================================== */

.hdkn-address-wrapper {
    position: relative;
}

.hdkn-address-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--hdkn-border);
    border-radius: var(--hdkn-radius);
    font-size: 15px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.hdkn-address-input:focus {
    outline: none;
    border-color: var(--hdkn-primary);
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.1);
}

.hdkn-address-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1000;
    background: #fff;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 var(--hdkn-radius) var(--hdkn-radius);
    max-height: 250px;
    overflow-y: auto;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.hdkn-address-suggestions:empty {
    display: none;
}

.hdkn-address-suggestion {
    padding: 12px 15px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.15s;
}

.hdkn-address-suggestion:last-child {
    border-bottom: none;
}

.hdkn-address-suggestion:hover {
    background: #f7f9fc;
}

.hdkn-suggestion-main {
    display: block;
    font-weight: 500;
    color: #1e1e1e;
    font-size: 14px;
}

.hdkn-suggestion-detail {
    display: block;
    font-size: 12px;
    color: #666;
    margin-top: 2px;
}

/* Résultat de distance */
.hdkn-distance-result {
    margin-top: 10px;
    padding: 12px 15px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: var(--hdkn-radius);
    border-left: 4px solid var(--hdkn-primary);
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.hdkn-distance-label {
    font-weight: 600;
    color: #555;
    font-size: 13px;
}

.hdkn-distance-value {
    font-weight: 500;
    color: #333;
    font-size: 14px;
}

.hdkn-distance-price {
    font-weight: 700;
    color: var(--hdkn-primary);
    font-size: 15px;
    margin-left: auto;
}

/* Animation d'apparition */
.hdkn-distance-result {
    animation: hdkn-slide-in 0.3s ease;
}

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

/* Option aller-retour */
.hdkn-round-trip-option {
    margin-top: 12px;
    padding: 10px 15px;
    background: #f8f9fa;
    border-radius: var(--hdkn-radius);
    border: 1px solid #e0e0e0;
}

.hdkn-round-trip-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 14px;
    color: #333;
    font-weight: 500;
    margin: 0;
}

.hdkn-round-trip-checkbox {
    width: 18px;
    height: 18px;
    accent-color: var(--hdkn-primary);
    cursor: pointer;
}

.hdkn-round-trip-label:hover {
    color: var(--hdkn-primary);
}

.hdkn-round-trip-checkbox:checked + span {
    color: var(--hdkn-primary);
}

/* ==========================================================================
   REPEATER - Groupes répétables
   ========================================================================== */

.hdkn-repeater-wrapper {
    margin-bottom: 20px;
}

.hdkn-repeater-header {
    margin-bottom: 15px;
}

.hdkn-repeater-header .hdkn-label {
    font-size: 16px;
    font-weight: 600;
    color: var(--hdkn-text);
}

.hdkn-repeater-groups {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.hdkn-repeater-group {
    background: var(--repeater-group-bg, #f8f9fa);
    border: 1px solid var(--repeater-border, #e0e0e0);
    border-radius: var(--hdkn-radius);
    overflow: hidden;
    animation: hdkn-slide-in 0.3s ease;
    /* Hériter des variables CSS du parent */
    --repeater-input-bg: inherit;
    --repeater-input-border: inherit;
    --repeater-input-text: inherit;
}

.hdkn-repeater-group-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: var(--repeater-header-bg, #e9ecef);
    border-bottom: 1px solid var(--repeater-border, #ddd);
}

.hdkn-repeater-group-title {
    font-weight: 600;
    font-size: 14px;
    color: var(--repeater-header-text, #333);
}

.hdkn-repeater-remove {
    background: none;
    border: none;
    cursor: pointer;
    color: #999;
    padding: 5px;
    border-radius: 4px;
    transition: all 0.2s;
}

.hdkn-repeater-remove:hover {
    background: #fee;
    color: #d63638;
}

.hdkn-repeater-group-fields {
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.hdkn-repeater-subfield {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.hdkn-repeater-subfield .hdkn-label {
    font-size: 13px;
    font-weight: 500;
    color: #555;
}

.hdkn-repeater-actions {
    margin-top: 10px;
}

.hdkn-repeater-add {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 2px dashed #ccc;
    border-radius: var(--hdkn-radius);
    color: #666;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
    justify-content: center;
}

.hdkn-repeater-add:hover {
    border-color: var(--hdkn-primary);
    color: var(--hdkn-primary);
    background: #f0f7ff;
}

.hdkn-repeater-add.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.hdkn-repeater-add .dashicons {
    font-size: 18px;
}

/* Responsive */
@media (min-width: 768px) {
    .hdkn-repeater-group-fields {
        flex-direction: row;
        flex-wrap: wrap;
    }
    
    .hdkn-repeater-subfield {
        flex: 1;
        min-width: 200px;
    }
}

/* Inputs dans les sous-champs du repeater */
.hdkn-repeater-subfield .hdkn-input {
    background: var(--repeater-input-bg, #ffffff);
    border: 1px solid var(--repeater-input-border, #cccccc);
    border-radius: var(--hdkn-radius);
    padding: 10px 12px;
    font-size: 14px;
    color: var(--repeater-input-text, #333333);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.hdkn-repeater-subfield .hdkn-input:focus {
    border-color: var(--hdkn-primary);
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.15);
    outline: none;
}

.hdkn-repeater-subfield select.hdkn-input {
    background: var(--repeater-input-bg, #ffffff) url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23666%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.4-12.8z%22%2F%3E%3C%2Fsvg%3E') no-repeat right 12px center;
    background-size: 10px;
    padding-right: 35px;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}

/* Radio dans les sous-champs du repeater */
.hdkn-subfield-radio {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.hdkn-subfield-radio .hdkn-radio-option {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 14px;
    background: var(--repeater-input-bg, #ffffff);
    border: 2px solid var(--repeater-input-border, #cccccc);
    border-radius: var(--hdkn-radius);
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
}

/* Override spécifique pour le texte des radios dans le repeater - IMPORTANT */
.hdkn-repeater-wrapper .hdkn-repeater-group .hdkn-subfield-radio .hdkn-radio-option span,
.hdkn-repeater-wrapper .hdkn-repeater-groups .hdkn-subfield-radio .hdkn-radio-option span,
.hdkn-repeater-wrapper .hdkn-subfield-radio.hdkn-radio-group .hdkn-radio-option span,
.hdkn-form-wrapper .hdkn-subfield-radio .hdkn-radio-option span {
    color: #333333 !important;
}

.hdkn-subfield-radio .hdkn-radio-option:hover {
    border-color: var(--hdkn-primary);
}

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

/* Override pour le texte sélectionné */
.hdkn-repeater-wrapper .hdkn-subfield-radio input[type="radio"]:checked + span,
.hdkn-form-wrapper .hdkn-subfield-radio input[type="radio"]:checked + span {
    color: var(--hdkn-primary) !important;
    font-weight: 600;
}

.hdkn-subfield-radio .hdkn-radio-option:has(input:checked) {
    border-color: var(--hdkn-primary);
    background: rgba(0, 115, 170, 0.08);
}

/* Force aussi la couleur du texte dans les select */
.hdkn-repeater-wrapper .hdkn-repeater-subfield select.hdkn-input,
.hdkn-repeater-wrapper .hdkn-repeater-subfield select.hdkn-input option {
    color: #333333 !important;
}

/* ==========================================================================
   CHAMP PLAGE DE DATES
   ========================================================================== */

.hdkn-daterange-wrapper {
    padding: 15px;
    background: #f9f9f9;
    border-radius: var(--hdkn-radius);
    border: 1px solid var(--hdkn-border);
}

.hdkn-daterange-inputs {
    display: flex;
    align-items: flex-end;
    gap: 15px;
    flex-wrap: wrap;
}

.hdkn-daterange-field {
    flex: 1;
    min-width: 150px;
}

.hdkn-daterange-sublabel {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #555;
    margin-bottom: 6px;
}

.hdkn-daterange-field input[type="date"] {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--hdkn-border);
    border-radius: var(--hdkn-radius);
    font-size: 15px;
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.hdkn-daterange-field input[type="date"]:focus {
    outline: none;
    border-color: var(--hdkn-primary);
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.1);
}

.hdkn-daterange-separator {
    font-size: 20px;
    color: #999;
    padding-bottom: 10px;
}

.hdkn-daterange-result {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px dashed var(--hdkn-border);
}

.hdkn-daterange-days,
.hdkn-daterange-price {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
}

.hdkn-daterange-days-icon,
.hdkn-daterange-price-icon {
    font-size: 18px;
}

.hdkn-daterange-days-text,
.hdkn-daterange-price-text {
    font-size: 15px;
    color: #333;
}

.hdkn-daterange-days-value,
.hdkn-daterange-price-value {
    font-size: 18px;
    color: var(--hdkn-primary);
}

.hdkn-daterange-price {
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    padding: 12px 15px;
    border-radius: var(--hdkn-radius);
    margin-top: 10px;
}

.hdkn-daterange-price-value {
    color: #2e7d32;
    font-size: 22px;
}

.hdkn-daterange-price-detail {
    color: #666;
    font-size: 12px;
    margin-left: 5px;
}

/* Responsive */
@media (max-width: 500px) {
    .hdkn-daterange-inputs {
        flex-direction: column;
        gap: 10px;
    }
    
    .hdkn-daterange-field {
        width: 100%;
    }
    
    .hdkn-daterange-separator {
        display: none;
    }
}

/* ==========================================================================
   CALCULATEUR DE DISTANCE TOTAL
   ========================================================================== */

.hdkn-distance-calculator-wrapper {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 1px solid var(--hdkn-border);
    border-radius: var(--hdkn-radius);
    padding: 20px;
    margin-top: 5px;
}

.hdkn-calc-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--hdkn-primary);
}

.hdkn-calc-icon {
    font-size: 24px;
}

.hdkn-calc-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--hdkn-text);
}

.hdkn-calc-details {
    margin-bottom: 15px;
}

.hdkn-calc-route {
    position: relative;
    padding-left: 15px;
}

.hdkn-calc-step {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 15px;
    background: #fff;
    border-radius: 8px;
    margin-bottom: 5px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.hdkn-calc-step-icon {
    font-size: 18px;
    flex-shrink: 0;
}

.hdkn-calc-step-label {
    font-weight: 500;
    color: var(--hdkn-text);
    min-width: 120px;
}

.hdkn-calc-step-address {
    color: #666;
    font-size: 13px;
    flex: 1;
}

.hdkn-calc-enterprise {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    border-left: 3px solid #2196F3;
}

.hdkn-calc-return-enterprise {
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    border-left: 3px solid #4CAF50;
}

.hdkn-calc-legs {
    padding: 5px 0 5px 20px;
    position: relative;
}

.hdkn-calc-legs::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(180deg, var(--hdkn-primary) 0%, #4CAF50 100%);
}

.hdkn-calc-leg {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: #fff;
    border-radius: 6px;
    margin: 8px 0;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    position: relative;
}

.hdkn-calc-leg::before {
    content: '';
    position: absolute;
    left: -16px;
    top: 50%;
    width: 10px;
    height: 2px;
    background: var(--hdkn-primary);
}

.hdkn-calc-leg-return {
    background: linear-gradient(135deg, #fff3e0 0%, #ffe0b2 100%);
    border-left: 3px solid #FF9800;
}

.hdkn-calc-leg-final {
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    border-left: 3px solid #4CAF50;
}

.hdkn-calc-leg-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.hdkn-calc-leg-icon {
    font-size: 16px;
}

.hdkn-calc-leg-label {
    flex: 1;
    font-size: 13px;
    color: var(--hdkn-text);
}

.hdkn-calc-leg-distance {
    font-weight: 600;
    color: var(--hdkn-primary);
    font-size: 13px;
    background: rgba(0,0,0,0.05);
    padding: 3px 8px;
    border-radius: 4px;
}

.hdkn-calc-summary {
    background: #fff;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.hdkn-calc-total-distance,
.hdkn-calc-total-price {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
}

.hdkn-calc-total-distance {
    border-bottom: 1px dashed #ddd;
    margin-bottom: 8px;
}

.hdkn-calc-total-label,
.hdkn-calc-price-label {
    font-weight: 500;
    color: #666;
}

.hdkn-calc-total-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--hdkn-primary);
}

.hdkn-calc-total-unit {
    font-size: 14px;
    color: #666;
}

.hdkn-calc-price-value {
    font-size: 28px;
    font-weight: 700;
    color: #4CAF50;
}

.hdkn-calc-price-currency {
    font-size: 16px;
    font-weight: 600;
    color: #4CAF50;
}

.hdkn-calc-price-detail {
    color: #999;
    font-size: 12px;
    margin-left: auto;
}

.hdkn-calc-return-info {
    margin-top: 10px;
    padding: 8px 12px;
    background: #fff3e0;
    border-radius: 6px;
    color: #e65100;
    font-size: 13px;
}

@media (max-width: 600px) {
    .hdkn-calc-step {
        flex-wrap: wrap;
    }
    
    .hdkn-calc-step-label {
        min-width: 100%;
        margin-bottom: 5px;
    }
    
    .hdkn-calc-leg-info {
        flex-wrap: wrap;
    }
    
    .hdkn-calc-total-value {
        font-size: 20px;
    }
    
    .hdkn-calc-price-value {
        font-size: 22px;
    }
    
    .hdkn-calc-price-detail {
        width: 100%;
        margin-left: 0;
        margin-top: 5px;
    }
}
