/* 
 * NMH Forms Expert - Professional Mobile First CSS 
 * Pure CSS, logic-driven, high accessibility.
 * BLINDADO EXTREMO (EXTREME SHIELDED) MODE
 */

:root {
    --nmh-primary: #2271b1;
    --nmh-primary-dark: #135e96;
    --nmh-success-bg: #f0fdf4;
    --nmh-success-text: #166534;
    --nmh-error-bg: #fef2f2;
    --nmh-error-text: #991b1b;
    --nmh-bg-sec: #f8fafc;
    --nmh-border: #e2e8f0;
    --nmh-text-main: #1e293b;
    --nmh-text-muted: #475569;
    --nmh-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1);
    --nmh-radius: 8px;
    --nmh-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 0. ROOT WRAPPER & RESET (ENCAPSULATION) */
.nmh-fe-form-wrapper {
    width: 100%;
    margin: 0;
    padding: 0;
    font-family: 'Inter', -apple-system, system-ui, sans-serif;
}

/* Local Reset - Critical Force */
.nmh-fe-form-wrapper *,
.nmh-fe-form-wrapper *::before,
.nmh-fe-form-wrapper *::after {
    box-sizing: border-box !important;
    margin: 0;
    padding: 0;
}

/* 1. BASE STRUCTURE (Mobile First) */
.nmh-fe-form-wrapper .nmh-fe-form-container {
    width: 100%;
    max-width: var(--nmh-form-width, 650px);
    margin: 20px auto;
    padding: 20px;
    background: #ffffff;
    border-radius: var(--nmh-radius);
    box-shadow: var(--nmh-shadow);
    color: var(--nmh-text-main);
    display: block;
}

/* 2. FORM ELEMENTS */
.nmh-fe-form-wrapper .nmh-fe-form-row {
    margin-bottom: 20px !important;
    display: block;
}

.nmh-fe-form-wrapper .nmh-fe-inline-group {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    margin-bottom: 20px;
}

.nmh-fe-form-wrapper .nmh-fe-inline-group .nmh-fe-form-row {
    flex: 1;
    min-width: 0;
    margin-bottom: 0 !important;
}

@media (max-width: 600px) {
    .nmh-fe-form-wrapper .nmh-fe-inline-group {
        flex-direction: column;
        gap: 0;
    }
    .nmh-fe-form-wrapper .nmh-fe-inline-group .nmh-fe-form-row {
        margin-bottom: 20px !important;
    }
}

/* Títulos de campos principales */
.nmh-fe-form-wrapper .nmh-fe-field-image_radio > label {
    text-align: center !important;
}

.nmh-fe-form-wrapper .nmh-fe-field-group label {
    font-size: 18px !important;
    margin-bottom: 8px !important;
    display: block !important;
    color: var(--nmh-text-main);
    line-height: 1.4;
    font-weight: 600 !important;
}

.nmh-fe-form-wrapper .nmh-fe-form-row input,
.nmh-fe-form-wrapper .nmh-fe-form-row select,
.nmh-fe-form-wrapper .nmh-fe-form-row textarea {
    width: 100% !important;
    max-width: 100%;
    padding: 12px 14px !important;
    border: 1px solid var(--nmh-border) !important;
    border-radius: var(--nmh-radius) !important;
    font-size: 16px !important;
    font-family: inherit !important;
    line-height: 1.5;
    background-color: var(--nmh-bg-sec);
    color: var(--nmh-text-main);
    height: auto;
    box-shadow: none;
    transition: var(--nmh-transition);
    appearance: none;
    -webkit-appearance: none;
}

.nmh-fe-form-wrapper .nmh-fe-form-row input {
    text-overflow: ellipsis;
}

.nmh-fe-form-wrapper .nmh-fe-form-row input::placeholder {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nmh-fe-form-wrapper .nmh-fe-form-row input:focus,
.nmh-fe-form-wrapper .nmh-fe-form-row select:focus,
.nmh-fe-form-wrapper .nmh-fe-form-row textarea:focus {
    outline: none !important;
    border-color: var(--nmh-primary) !important;
    background-color: #ffffff;
    box-shadow: 0 0 0 3px rgba(34, 113, 177, 0.15) !important;
}

/* Validation Styles */
.nmh-fe-form-wrapper .nmh-fe-form-row .nmh-fe-invalid {
    border-color: var(--nmh-error-text) !important;
    background-color: var(--nmh-error-bg) !important;
    box-shadow: 0 0 0 3px rgba(153, 27, 27, 0.1) !important;
}

.nmh-fe-field-group.nmh-fe-group-invalid,
.nmh-fe-acceptance-row.nmh-fe-group-invalid {
    background-color: rgba(153, 27, 27, 0.02) !important;
    border-radius: var(--nmh-radius) !important;
    padding: 10px !important;
    border: 1px dashed var(--nmh-error-text) !important;
    transition: all 0.3s ease;
}

/* RGPD checkbox - Estado error (flex column) */
.nmh-fe-form-wrapper .nmh-fe-acceptance-row.nmh-fe-group-invalid {
    flex-direction: column !important;
    gap: 0px !important;
}

.nmh-fe-form-wrapper .nmh-fe-form-row .nmh-fe-invalid:focus {
    border-color: var(--nmh-error-text) !important;
    box-shadow: 0 0 0 3px rgba(153, 27, 27, 0.2) !important;
}

.nmh-fe-form-wrapper .nmh-fe-error-msg {
    display: block;
    color: var(--nmh-error-text) !important;
    font-size: 12px;
    margin-top: 4px;
    font-weight: 500;
}

.nmh-fe-form-wrapper .nmh-fe-form-row textarea {
    resize: vertical;
    min-height: 100px;
}

.nmh-fe-form-wrapper .nmh-fe-form-row select {
    padding-right: 38px !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23555' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 12px center !important;
    background-size: 16px !important;
    cursor: pointer;
}

/* Minimalist Style */
.nmh-fe-form-wrapper .nmh-fe-form-container.nmh-fe-minimalist .nmh-fe-form-row input,
.nmh-fe-form-wrapper .nmh-fe-form-container.nmh-fe-minimalist .nmh-fe-form-row select,
.nmh-fe-form-wrapper .nmh-fe-form-container.nmh-fe-minimalist .nmh-fe-form-row textarea {
    border-top: none !important;
    border-left: none !important;
    border-right: none !important;
    border-bottom: 2px solid var(--nmh-border) !important;
    border-radius: 0 !important;
    background-color: transparent !important;
    padding-left: 0 !important;
}

.nmh-fe-form-wrapper .nmh-fe-form-container.nmh-fe-minimalist .nmh-fe-form-row input,
.nmh-fe-form-wrapper .nmh-fe-form-container.nmh-fe-minimalist .nmh-fe-form-row textarea {
    padding-right: 0 !important;
}

.nmh-fe-form-wrapper .nmh-fe-form-container.nmh-fe-minimalist .nmh-fe-form-row input:focus,
.nmh-fe-form-wrapper .nmh-fe-form-container.nmh-fe-minimalist .nmh-fe-form-row select:focus,
.nmh-fe-form-wrapper .nmh-fe-form-container.nmh-fe-minimalist .nmh-fe-form-row textarea:focus {
    box-shadow: none !important;
    border-bottom-color: var(--nmh-primary) !important;
    background-color: transparent !important;
}

/* File Input Styling */
.nmh-fe-form-wrapper .nmh-fe-file-custom {
    display: flex;
    align-items: center;
    gap: 12px;
    background-color: var(--nmh-bg-sec);
    padding: 8px !important;
    border: 1px solid var(--nmh-border);
    border-radius: var(--nmh-radius);
    width: 100%;
}

.nmh-fe-form-wrapper .nmh-fe-file-btn {
    background: var(--nmh-primary) !important;
    color: #fff !important;
    border: none !important;
    padding: 8px 16px !important;
    border-radius: 4px !important;
    cursor: pointer !important;
    font-weight: 600 !important;
    font-size: 14px !important;
    transition: var(--nmh-transition);
    flex-shrink: 0;
    text-transform: none !important;
    box-shadow: none !important;
}

.nmh-fe-form-wrapper .nmh-fe-file-btn:hover {
    background: var(--nmh-primary-dark) !important;
    transform: none !important;
}

.nmh-fe-form-wrapper .nmh-fe-file-name {
    font-size: 14px !important;
    color: var(--nmh-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

.nmh-fe-form-wrapper .nmh-fe-form-row input[type="file"] {
    display: none !important;
}

/* 3. BUTTONS */
.nmh-fe-form-wrapper .nmh-fe-submit-btn {
    width: 100% !important;
    padding: 15px !important;
    background: var(--nmh-primary) !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: var(--nmh-radius) !important;
    font-size: 15px !important;
    font-weight: 700 !important;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    cursor: pointer !important;
    transition: var(--nmh-transition);
    box-shadow: 0 4px 6px -1px rgba(34, 113, 177, 0.2);
    display: inline-block;
    text-align: center;
    line-height: 1.2;
}

.nmh-fe-form-footer {
    margin-top: 2rem;
}

.nmh-fe-form-wrapper .nmh-fe-submit-btn:hover {
    background: var(--nmh-primary-dark) !important;
    transform: translateY(-1px);
    box-shadow: 0 10px 15px -3px rgba(34, 113, 177, 0.3);
}

.nmh-fe-form-wrapper .nmh-fe-submit-btn:active {
    transform: translateY(0);
}

.nmh-fe-form-wrapper .nmh-fe-submit-btn:disabled {
    background: #cbd5e1 !important;
    cursor: not-allowed !important;
    transform: none;
}

/* 4. MESSAGES & PRIVACY */
.nmh-fe-form-wrapper .nmh-fe-response-msg {
    margin-top: 1.5rem;
    padding: 1rem;
    border-radius: var(--nmh-radius);
    font-size: 0.95rem;
    font-weight: 500;
    text-align: center;
}

.nmh-fe-form-wrapper .nmh-fe-response-msg.success {
    background-color: var(--nmh-success-bg);
    color: var(--nmh-success-text);
    border: 1px solid #bbf7d0;
}

.nmh-fe-form-wrapper .nmh-fe-response-msg.error {
    background-color: var(--nmh-error-bg);
    color: var(--nmh-error-text);
    border: 1px solid #fecaca;
}

.nmh-fe-form-wrapper .nmh-fe-privacy-container {
    margin-bottom: 20px !important;
}

/* Forzar fila de aceptación */
.nmh-fe-form-wrapper .nmh-fe-acceptance-row {
    display: flex !important;
    flex-direction: row !important;
    align-items: flex-start !important;
    gap: 15px !important;
    margin: 25px 0 !important;
    width: 100% !important;
}

/* Reset total del Checkbox */
.nmh-fe-form-wrapper .nmh-fe-acceptance-row input[type="checkbox"] {
    all: revert !important;
    /* Ignora estilos del tema */
    width: 22px !important;
    height: 22px !important;
    margin: 0 !important;
    flex-shrink: 0 !important;
    cursor: pointer !important;
    border: 1px solid #ccc !important;
    /* Fallback if revert doesn't give border */
    appearance: auto !important;
    -webkit-appearance: checkbox !important;
    accent-color: var(--nmh-primary) !important;
}

/* Reset total del Label de aceptación para que no salte de línea */
.nmh-fe-form-wrapper .nmh-fe-acceptance-row label {
    display: block !important;
    flex: 1 !important;
    width: auto !important;
    font-size: 15px !important;
    line-height: 1.4 !important;
    color: var(--nmh-text-main);
    cursor: pointer !important;
    font-weight: 400 !important;
    white-space: normal !important;
}

.nmh-fe-form-wrapper .nmh-fe-acceptance-row label a,
.nmh-fe-form-wrapper .nmh-fe-gdpr-text,
.nmh-fe-form-wrapper .nmh-fe-gdpr-text a {
    font-size: 15px !important;
    color: #353535 !important;
}

.nmh-fe-form-wrapper .nmh-fe-acceptance-row label a {
    display: inline !important;
    white-space: normal !important;
    text-decoration: underline !important;
}

.nmh-fe-form-wrapper .nmh-fe-gdpr-text p {
    margin: 15px 0;
    font-size: 12.9px !important;
}

.nmh-fe-form-wrapper .nmh-fe-gdpr-text .nmh-fe-gdpr-content a {
    font-size: 12.9px !important;
    font-weight: 600 !important;
}

.nmh-fe-form-wrapper .nmh-fe-gdpr-text {
    line-height: 1.5 !important;
}

.nmh-fe-form-wrapper .nmh-fe-gdpr-layer {
    margin-top: 6px;
    padding: 0;
    border: none;
    background: transparent;
}

.nmh-fe-gdpr-toggle {
    color: #aaa;
    text-decoration: none;
    font-weight: 400;
    font-size: 12px;
    letter-spacing: 0.01em;
    border-bottom: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 4px;
    transition: color 0.2s ease;
}

.nmh-fe-gdpr-toggle::before {
    content: '+';
    font-size: 14px;
    line-height: 1;
    transition: content 0s;
}

.nmh-fe-gdpr-toggle.active::before {
    content: '−';
}

.nmh-fe-gdpr-toggle:hover {
    color: #777;
    cursor: pointer;
}

/* 5. UTILS */
.nmh-fe-form-wrapper .nmh-fe-message-full {
    background: var(--nmh-error-bg);
    border-left: 4px solid #ef4444;
    padding: 1.5rem;
    border-radius: var(--nmh-radius);
}

.nmh-fe-form-wrapper .nmh-fe-status-title {
    margin: 0;
    font-size: 1.125rem;
    color: var(--nmh-error-text);
    font-weight: 700;
}

/* 6. MULTISTEP & IMAGE RADIO */
.nmh-fe-step {
    display: none;
    animation: nmhFadeIn 0.4s ease-out;
}

.nmh-fe-step.active {
    display: block;
}

@keyframes nmhFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.nmh-fe-step-title {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 24px;
    font-weight: 700;
    color: var(--nmh-primary);
    border-bottom: 2px solid var(--nmh-border);
    padding-bottom: 10px;
    text-align: center;
}

.nmh-fe-step-subtitle {
    margin-top: 0;
    margin-bottom: 25px;
    font-size: 15px;
    font-weight: 400;
    color: var(--nmh-text-light, #666);
    text-align: center;
}

/* PROGRESS BAR */
.nmh-fe-progress-container {
    width: 100%;
    height: 8px;
    background: #f1f5f9;
    margin-bottom: 30px;
    border-radius: 10px;
    overflow: hidden;
}

.nmh-fe-progress-bar {
    height: 100%;
    background: var(--nmh-primary);
    width: 0%;
    transition: width 0.4s ease;
    border-radius: 10px;
}

/* STEPS INDICATOR */
.nmh-fe-steps-indicator {
    display: flex;
    align-items: flex-start;
    margin-bottom: 30px;
    padding: 0 4px;
}

.nmh-fe-step-node {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 0 0 auto;
    min-width: 48px;
}

.nmh-fe-step-connector {
    flex: 1;
    height: 2px;
    background: #e2e8f0;
    margin-top: 15px;
    min-width: 8px;
    transition: background 0.35s ease;
}

.nmh-fe-step-connector.completed {
    background: var(--nmh-primary);
}

.nmh-fe-step-node-circle {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 2px solid #cbd5e1;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
    color: #94a3b8;
    position: relative;
    z-index: 1;
    transition: border-color 0.3s ease, background 0.3s ease, color 0.3s ease;
}

.nmh-fe-step-node.active .nmh-fe-step-node-circle {
    border-color: var(--nmh-primary);
    color: var(--nmh-primary);
    background: #ffffff;
}

.nmh-fe-step-node.completed {
    cursor: pointer;
}

.nmh-fe-step-node.completed .nmh-fe-step-node-circle {
    border-color: var(--nmh-primary);
    background: var(--nmh-primary);
    color: #ffffff;
}

.nmh-fe-step-node-label {
    margin-top: 6px;
    font-size: 11px;
    font-weight: 500;
    color: #94a3b8;
    text-align: center;
    max-width: 90px;
    line-height: 1.3;
    overflow-wrap: break-word;
    transition: color 0.3s ease, font-weight 0.3s ease;
}

.nmh-fe-step-node.active .nmh-fe-step-node-label {
    color: var(--nmh-primary);
    font-weight: 700;
}

.nmh-fe-step-node.completed .nmh-fe-step-node-label {
    color: #475569;
}

@media (max-width: 600px) {
    .nmh-fe-step-node-label {
        display: none;
    }
    .nmh-fe-step-node.active .nmh-fe-step-node-label {
        display: block;
        font-size: 11px;
        max-width: 90px;
        text-align: center;
    }
    .nmh-fe-step-node {
        min-width: 32px;
    }
    .nmh-fe-step-node-circle {
        width: 26px;
        height: 26px;
        font-size: 11px;
    }
    .nmh-fe-step-connector {
        margin-top: 13px;
    }
}

@media (max-width: 380px) {
    .nmh-fe-step-node.active .nmh-fe-step-node-label {
        display: none;
    }
}

.nmh-fe-step-navigation {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 30px !important;
    /* Force design to breathe */
}

.nmh-fe-next-btn,
.nmh-fe-prev-btn,
.nmh-fe-step-navigation .nmh-fe-submit-btn {
    flex: 0 0 auto;
    width: auto !important;
    padding: 12px 35px !important;
    border-radius: var(--nmh-radius);
    font-weight: 600;
    cursor: pointer;
    transition: var(--nmh-transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.nmh-fe-next-btn {
    background: #475569 !important;
    color: #ffffff !important;
    border: 1px solid #334155 !important;
    font-size: 15px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
}

.nmh-fe-prev-btn {
    background: #475569 !important;
    color: #ffffff !important;
    border: 1px solid #334155 !important;
    font-size: 15px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
}

.nmh-fe-next-btn:hover {
    background: #334155 !important;
}

.nmh-fe-prev-btn:hover {
    background: #334155 !important;
}

/* IMAGE RADIO GRID */
.nmh-fe-image-radio-label {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 15px;
    text-align: center;
}

.nmh-fe-image-radio-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)) !important;
    gap: 10px !important;
    margin-bottom: 20px !important;
    width: 100% !important;
    max-width: 100% !important;
}

/* Hide label option - hide text under each image */
.nmh-fe-image-radio-grid.hide-label .nmh-fe-image-option p {
    display: none !important;
}

/* Base styles - these must be BEFORE no-border overrides */
.nmh-fe-image-option label {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 10px !important;
    background: #ffffff !important;
    border: 2px solid var(--nmh-border) !important;
    border-radius: var(--nmh-radius) !important;
    cursor: pointer !important;
    transition: var(--nmh-transition) !important;
    height: 100% !important;
    text-align: center !important;
    opacity: 1 !important;
    visibility: visible !important;
}

.nmh-fe-image-option img {
    display: block !important;
    width: 80% !important;
    max-width: var(--nmh-img-max, 80%) !important;
    height: auto !important;
    aspect-ratio: 1 / 1 !important;
    object-fit: contain !important;
    margin: 0 auto 5px auto !important;
    transition: var(--nmh-transition) !important;
    opacity: 1 !important;
    visibility: visible !important;
}

.nmh-fe-image-option p {
    margin: 0 !important;
    padding: 0 !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    color: var(--nmh-text-main) !important;
    line-height: 1.2 !important;
}

.nmh-fe-image-option p.nmh-fe-label-above {
    margin-bottom: 10px !important;
}

.nmh-fe-image-option p.nmh-fe-label-below {
    margin-top: 10px !important;
}

.nmh-fe-option-description {
    display: block !important;
    margin-top: 6px !important;
    font-size: 12px !important;
    font-weight: 400 !important;
    color: var(--nmh-text-light, #666) !important;
    line-height: 1.3 !important;
    text-align: center !important;
}

.nmh-fe-image-option input:checked+label {
    border-color: var(--nmh-primary) !important;
    background-color: rgba(34, 113, 177, 0.05);
    box-shadow: 0 0 0 1px var(--nmh-primary);
}

.nmh-fe-image-option input:checked+label img {
    transform: scale(1.1);
}

.nmh-fe-image-option label:hover {
    border-color: var(--nmh-primary);
    transform: translateY(-2px);
}

/* NO-BORDER OPTION - must be AFTER base rules */
.nmh-fe-image-radio-grid.no-border .nmh-fe-image-option label {
    border: none !important;
    padding: 5px !important;
    box-shadow: none !important;
}

.nmh-fe-image-radio-grid.no-border .nmh-fe-image-option img {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    margin: 0 !important;
}

.nmh-fe-image-radio-grid.no-border .nmh-fe-image-option p {
    display: none !important;
}

/* FIXED COLUMNS GRID - flex para centrar última fila incompleta */
.nmh-fe-image-radio-grid.nmh-fe-grid-fixed {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
}

.nmh-fe-image-radio-grid.nmh-fe-grid-fixed .nmh-fe-image-option {
    flex: 0 0 calc(100% / var(--nmh-cols) - 12px) !important;
    max-width: calc(100% / var(--nmh-cols) - 12px) !important;
}

@media (max-width: 600px) {
    .nmh-fe-image-radio-grid.nmh-fe-grid-fixed .nmh-fe-image-option {
        flex: 0 0 calc(50% - 12px) !important;
        max-width: calc(50% - 12px) !important;
    }
}

@media (max-width: 400px) {
    .nmh-fe-image-radio-grid.nmh-fe-grid-fixed .nmh-fe-image-option {
        flex: 0 0 100% !important;
        max-width: 100% !important;
    }
}

/* 7. CHOICE OPTIONS (Radio/Checkbox Groups) */
.nmh-fe-choices-list {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin: 20px auto 10px auto;
    width: 100%;
}

.nmh-fe-choice-option {
    width: 100%;
    max-width: 400px;
    flex: none;
}

.nmh-fe-choice-option label {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 12px 20px !important;
    background: #ffffff !important;
    border: 2px solid var(--nmh-border) !important;
    border-radius: var(--nmh-radius) !important;
    cursor: pointer !important;
    transition: var(--nmh-transition) !important;
    text-align: center !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    color: var(--nmh-text-main) !important;
    margin: 0 !important;
}

.nmh-fe-choice-option input {
    position: absolute !important;
    opacity: 0 !important;
    cursor: pointer !important;
    height: 0 !important;
    width: 0 !important;
}

.nmh-fe-choice-option label:hover {
    border-color: var(--nmh-primary) !important;
    background-color: var(--nmh-bg-sec) !important;
    transform: translateY(-1px);
}

.nmh-fe-choice-option input:checked+span {
    color: var(--nmh-primary) !important;
}

.nmh-fe-choice-option input:checked+span::before {
    content: '✓';
    margin-right: 8px;
    font-weight: 900;
}

.nmh-fe-choice-option input:checked~label,
/* This selector is wrong but I will use the one below */
.nmh-fe-choice-option:has(input:checked) label {
    border-color: var(--nmh-primary) !important;
    background-color: rgba(34, 113, 177, 0.05) !important;
    box-shadow: 0 0 0 1px var(--nmh-primary);
}

/* 8. TABLET & DESKTOP ENHANCEMENTS */
@media (min-width: 768px) {
    .nmh-fe-form-wrapper .nmh-fe-form-container {
        max-width: var(--nmh-form-width, 650px);
        padding: 40px 40px 10px 40px;
        margin: 10px auto;
        width: 100%;
    }

    .nmh-fe-form-wrapper .nmh-fe-form-row {
        margin-bottom: 24px !important;
    }
}

/* 8. ESCAPE PATH STYLES */
.nmh-fe-image-escape-container {
    text-align: center;
    margin-top: 25px;
    margin-bottom: 10px;
    width: 100%;
}

.nmh-fe-image-escape {
    display: inline-block;
    font-size: 15px;
    color: var(--nmh-text-muted) !important;
    text-decoration: none !important;
    transition: var(--nmh-transition);
    font-weight: 600;
    background-color: #ffffff;
    border: 2px solid #e0e0e0;
    padding: 10px 20px;
    border-radius: var(--nmh-radius, 8px);
}

.nmh-fe-image-escape:hover {
    color: var(--nmh-primary);
    text-decoration: none !important;
    border-color: var(--nmh-primary);
    background-color: rgba(34, 113, 177, 0.05);
    transform: translateY(-2px);
}

/* Input Mask Styles */
.nmh-fe-masked-input {
    letter-spacing: 1px;
}



/* Toggle GDPR */
.nmh-fe-gdpr-content {
    display: block;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.4s ease, opacity 0.4s ease;
}

.nmh-fe-gdpr-content.nmh-fe-expanded {
    max-height: 500px;
    opacity: 1;
}

/* Summary Step */
.nmh-fe-summary-container {
    margin-bottom: 24px;
}

.nmh-fe-summary-list {
    list-style: none;
    margin: 0 0 0 0;
    padding: 0;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    overflow: hidden;
}

.nmh-fe-summary-item {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 16px;
    padding: 10px 16px;
    border-bottom: 1px solid #f0f0f0;
}

.nmh-fe-summary-item:last-child {
    border-bottom: none;
}

.nmh-fe-summary-item:nth-child(odd) {
    background: #f9f9f9;
}

.nmh-fe-summary-label {
    font-weight: 600;
    font-size: 14px;
    color: #333;
    flex-shrink: 0;
}

.nmh-fe-summary-value {
    font-size: 14px;
    color: #555;
    text-align: right;
}

.nmh-fe-summary-download-btn {
    display: inline-block;
    margin-top: 16px;
    padding: 10px 20px;
    background: #2271b1;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s;
}

.nmh-fe-summary-download-btn:hover {
    background: #135e96;
}

.nmh-fe-summary-download-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Multiselect widget */
.nmh-fe-multiselect {
    position: relative;
    width: 100%;
}

.nmh-fe-multiselect-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 12px 14px !important;
    border: 1px solid var(--nmh-border) !important;
    border-radius: var(--nmh-radius) !important;
    background-color: var(--nmh-bg-sec);
    color: var(--nmh-text-main);
    font-size: 16px;
    font-family: inherit;
    line-height: 1.5;
    cursor: pointer;
    user-select: none;
    transition: var(--nmh-transition);
    box-sizing: border-box;
}

.nmh-fe-multiselect-trigger:focus {
    outline: none;
    border-color: var(--nmh-primary) !important;
    box-shadow: 0 0 0 3px rgba(34, 113, 177, 0.15) !important;
}

.nmh-fe-multiselect-display {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nmh-fe-multiselect-placeholder {
    color: var(--nmh-text-muted);
    opacity: 0.6;
}

.nmh-fe-multiselect-arrow {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    margin-left: 8px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23555' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 16px;
    transition: transform 0.2s ease;
}

.nmh-fe-multiselect-trigger[aria-expanded="true"] .nmh-fe-multiselect-arrow {
    transform: rotate(180deg);
}

.nmh-fe-multiselect-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid var(--nmh-border);
    border-radius: var(--nmh-radius);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    z-index: 9999;
    max-height: 240px;
    overflow-y: auto;
}

.nmh-fe-multiselect-dropdown.nmh-fe-multiselect-open {
    display: block;
}

.nmh-fe-multiselect-option {
    display: flex !important;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 400 !important;
    color: var(--nmh-text-main);
    transition: background 0.15s;
    border-left: 3px solid transparent;
}

.nmh-fe-multiselect-option:hover {
    background-color: rgba(34, 113, 177, 0.06);
}

.nmh-fe-multiselect-option:has(input:checked) {
    background-color: rgba(34, 113, 177, 0.08);
    border-left-color: var(--nmh-primary);
    font-weight: 500 !important;
    color: var(--nmh-primary);
}

.nmh-fe-multiselect-option:has(input:checked):hover {
    background-color: rgba(34, 113, 177, 0.13);
}

.nmh-fe-multiselect-option input[type="checkbox"] {
    width: 18px !important;
    height: 18px !important;
    min-width: 18px;
    padding: 0 !important;
    margin: 0 !important;
    border: 2px solid var(--nmh-border) !important;
    border-radius: 3px !important;
    accent-color: var(--nmh-primary);
    cursor: pointer;
    flex-shrink: 0;
}

.nmh-fe-multiselect.nmh-fe-invalid .nmh-fe-multiselect-trigger {
    border-color: var(--nmh-error-text) !important;
    background-color: var(--nmh-error-bg) !important;
    box-shadow: 0 0 0 3px rgba(153, 27, 27, 0.1) !important;
}

/* Minimalist mode */
.nmh-fe-minimalist .nmh-fe-multiselect-trigger {
    border-top: none !important;
    border-left: none !important;
    border-right: none !important;
    border-bottom: 2px solid var(--nmh-border) !important;
    border-radius: 0 !important;
    background-color: transparent !important;
    padding-left: 0 !important;
}

.nmh-fe-minimalist .nmh-fe-multiselect-trigger:focus {
    box-shadow: none !important;
    border-bottom-color: var(--nmh-primary) !important;
}

/* Dark transparent mode */
.nmh-fe-on-dark .nmh-fe-multiselect-trigger {
    background-color: rgba(255, 255, 255, 0.08) !important;
    border-color: rgba(255, 255, 255, 0.25) !important;
    color: rgba(255, 255, 255, 0.95) !important;
}

.nmh-fe-on-dark .nmh-fe-multiselect-arrow {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='rgba(255,255,255,0.7)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
}

.nmh-fe-on-dark .nmh-fe-multiselect-dropdown {
    background: #2a2a2a;
    border-color: rgba(255, 255, 255, 0.2);
}

.nmh-fe-on-dark .nmh-fe-multiselect-option {
    color: rgba(255, 255, 255, 0.90);
}

.nmh-fe-on-dark .nmh-fe-multiselect-option:hover {
    background-color: rgba(255, 255, 255, 0.08);
}

.nmh-fe-on-dark .nmh-fe-multiselect-option:has(input:checked) {
    background-color: rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 1);
}

/* Label field (text/title without input) */
.nmh-fe-form-row.nmh-fe-field-label {
    margin-bottom: 6px;
    padding: 0;
    border: none !important;
    box-shadow: none !important;
    background: transparent !important;
}

.nmh-fe-label-field-text {
    margin: 0;
    padding: 0;
    color: var(--nmh-text-main);
    line-height: 1.3;
}

.nmh-fe-field-label-h3 .nmh-fe-label-field-text {
    font-size: 18px;
    font-weight: 700;
    margin-top: 12px;
}

.nmh-fe-field-label-h4 .nmh-fe-label-field-text {
    font-size: 15px;
    font-weight: 600;
    margin-top: 8px;
}

.nmh-fe-field-label-p .nmh-fe-label-field-text {
    font-size: 14px;
    font-weight: 400;
    color: var(--nmh-text-muted);
}

/* Terminal message */
.nmh-fe-terminal-message {
    background: #f0f8f0;
    border-left: 4px solid #4caf50;
    border-radius: 4px;
    padding: 20px 24px;
    margin: 16px 0 24px;
    font-size: 16px;
    line-height: 1.6;
    color: #333;
}

/* ============================================================
   TRANSPARENT FORM MODE
   .nmh-fe-on-dark  → white text  (placed on dark backgrounds)
   .nmh-fe-on-light → dark text   (placed on light backgrounds)
   ============================================================ */

/* --- Shared: remove form container background/shadow --- */
.nmh-fe-form-wrapper.nmh-fe-transparent .nmh-fe-form-container {
    background: transparent !important;
    box-shadow: none !important;
    border: none !important;
}

/* --- ON DARK: variable overrides cascade to all children --- */
.nmh-fe-form-wrapper.nmh-fe-transparent.nmh-fe-on-dark {
    --nmh-text-main:  rgba(255, 255, 255, 0.95);
    --nmh-text-muted: rgba(255, 255, 255, 0.60);
    --nmh-border:     rgba(255, 255, 255, 0.25);
    --nmh-bg-sec:     rgba(255, 255, 255, 0.08);
}

/* Labels */
.nmh-fe-form-wrapper.nmh-fe-transparent.nmh-fe-on-dark .nmh-fe-field-group label,
.nmh-fe-form-wrapper.nmh-fe-transparent.nmh-fe-on-dark .nmh-fe-acceptance-row label,
.nmh-fe-form-wrapper.nmh-fe-transparent.nmh-fe-on-dark .nmh-fe-acceptance-row label a,
.nmh-fe-form-wrapper.nmh-fe-transparent.nmh-fe-on-dark .nmh-fe-gdpr-text,
.nmh-fe-form-wrapper.nmh-fe-transparent.nmh-fe-on-dark .nmh-fe-gdpr-text a {
    color: rgba(255, 255, 255, 0.90) !important;
}

/* Input, select, textarea */
.nmh-fe-form-wrapper.nmh-fe-transparent.nmh-fe-on-dark .nmh-fe-form-row input,
.nmh-fe-form-wrapper.nmh-fe-transparent.nmh-fe-on-dark .nmh-fe-form-row select,
.nmh-fe-form-wrapper.nmh-fe-transparent.nmh-fe-on-dark .nmh-fe-form-row textarea {
    background-color: rgba(255, 255, 255, 0.08) !important;
    border-color: rgba(255, 255, 255, 0.25) !important;
    color: rgba(255, 255, 255, 0.95) !important;
}

.nmh-fe-form-wrapper.nmh-fe-transparent.nmh-fe-on-dark .nmh-fe-form-row input::placeholder,
.nmh-fe-form-wrapper.nmh-fe-transparent.nmh-fe-on-dark .nmh-fe-form-row textarea::placeholder {
    color: rgba(255, 255, 255, 0.40) !important;
}

.nmh-fe-form-wrapper.nmh-fe-transparent.nmh-fe-on-dark .nmh-fe-form-row input:focus,
.nmh-fe-form-wrapper.nmh-fe-transparent.nmh-fe-on-dark .nmh-fe-form-row select:focus,
.nmh-fe-form-wrapper.nmh-fe-transparent.nmh-fe-on-dark .nmh-fe-form-row textarea:focus {
    background-color: rgba(255, 255, 255, 0.14) !important;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.10) !important;
}

/* Select arrow — dark background */
.nmh-fe-form-wrapper.nmh-fe-transparent.nmh-fe-on-dark .nmh-fe-form-row select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='rgba(255,255,255,0.7)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") !important;
}

/* Minimalist underline on dark */
.nmh-fe-form-wrapper.nmh-fe-transparent.nmh-fe-on-dark .nmh-fe-form-container.nmh-fe-minimalist .nmh-fe-form-row input,
.nmh-fe-form-wrapper.nmh-fe-transparent.nmh-fe-on-dark .nmh-fe-form-container.nmh-fe-minimalist .nmh-fe-form-row select,
.nmh-fe-form-wrapper.nmh-fe-transparent.nmh-fe-on-dark .nmh-fe-form-container.nmh-fe-minimalist .nmh-fe-form-row textarea {
    border-bottom-color: rgba(255, 255, 255, 0.35) !important;
}

/* Step title + subtitle */
.nmh-fe-form-wrapper.nmh-fe-transparent.nmh-fe-on-dark .nmh-fe-step-title {
    color: var(--nmh-primary) !important;
    border-bottom-color: rgba(255, 255, 255, 0.15) !important;
}
.nmh-fe-form-wrapper.nmh-fe-transparent.nmh-fe-on-dark .nmh-fe-step-subtitle {
    color: rgba(255, 255, 255, 0.60) !important;
}

/* Progress bar track */
.nmh-fe-form-wrapper.nmh-fe-transparent.nmh-fe-on-dark .nmh-fe-progress-container {
    background: rgba(255, 255, 255, 0.15) !important;
}

/* Step nodes (circles indicator) */
.nmh-fe-form-wrapper.nmh-fe-transparent.nmh-fe-on-dark .nmh-fe-step-node-circle {
    background: rgba(255, 255, 255, 0.10) !important;
    border-color: rgba(255, 255, 255, 0.30) !important;
    color: rgba(255, 255, 255, 0.60) !important;
}
.nmh-fe-form-wrapper.nmh-fe-transparent.nmh-fe-on-dark .nmh-fe-step-node.active .nmh-fe-step-node-circle {
    background: rgba(255, 255, 255, 0.12) !important;
    border-color: var(--nmh-primary) !important;
    color: var(--nmh-primary) !important;
}
.nmh-fe-form-wrapper.nmh-fe-transparent.nmh-fe-on-dark .nmh-fe-step-node.completed .nmh-fe-step-node-circle {
    background: var(--nmh-primary) !important;
    border-color: var(--nmh-primary) !important;
    color: #ffffff !important;
}
.nmh-fe-form-wrapper.nmh-fe-transparent.nmh-fe-on-dark .nmh-fe-step-node-label {
    color: rgba(255, 255, 255, 0.50) !important;
}
.nmh-fe-form-wrapper.nmh-fe-transparent.nmh-fe-on-dark .nmh-fe-step-node.active .nmh-fe-step-node-label {
    color: var(--nmh-primary) !important;
}
.nmh-fe-form-wrapper.nmh-fe-transparent.nmh-fe-on-dark .nmh-fe-step-node.completed .nmh-fe-step-node-label {
    color: rgba(255, 255, 255, 0.65) !important;
}
.nmh-fe-form-wrapper.nmh-fe-transparent.nmh-fe-on-dark .nmh-fe-step-connector {
    background: rgba(255, 255, 255, 0.20) !important;
}

/* Image radio options */
.nmh-fe-form-wrapper.nmh-fe-transparent.nmh-fe-on-dark .nmh-fe-image-option label {
    background: rgba(255, 255, 255, 0.06) !important;
    border-color: rgba(255, 255, 255, 0.20) !important;
}
.nmh-fe-form-wrapper.nmh-fe-transparent.nmh-fe-on-dark .nmh-fe-image-option label:hover {
    background: rgba(255, 255, 255, 0.12) !important;
    border-color: var(--nmh-primary) !important;
}
.nmh-fe-form-wrapper.nmh-fe-transparent.nmh-fe-on-dark .nmh-fe-image-radio-label,
.nmh-fe-form-wrapper.nmh-fe-transparent.nmh-fe-on-dark .nmh-fe-image-option p {
    color: rgba(255, 255, 255, 0.90) !important;
}
.nmh-fe-form-wrapper.nmh-fe-transparent.nmh-fe-on-dark .nmh-fe-option-description {
    color: rgba(255, 255, 255, 0.55) !important;
}
.nmh-fe-form-wrapper.nmh-fe-transparent.nmh-fe-on-dark .nmh-fe-image-escape {
    background-color: rgba(255, 255, 255, 0.08) !important;
    border-color: rgba(255, 255, 255, 0.25) !important;
    color: rgba(255, 255, 255, 0.75) !important;
}

/* Choice options (radio / checkbox group) */
.nmh-fe-form-wrapper.nmh-fe-transparent.nmh-fe-on-dark .nmh-fe-choice-option label {
    background: rgba(255, 255, 255, 0.06) !important;
    border-color: rgba(255, 255, 255, 0.20) !important;
    color: rgba(255, 255, 255, 0.90) !important;
}
.nmh-fe-form-wrapper.nmh-fe-transparent.nmh-fe-on-dark .nmh-fe-choice-option label:hover {
    background: rgba(255, 255, 255, 0.12) !important;
}

/* Navigation buttons — outline style on dark */
.nmh-fe-form-wrapper.nmh-fe-transparent.nmh-fe-on-dark .nmh-fe-prev-btn {
    background: transparent !important;
    border: 1px solid rgba(255, 255, 255, 0.35) !important;
    color: rgba(255, 255, 255, 0.80) !important;
}
.nmh-fe-form-wrapper.nmh-fe-transparent.nmh-fe-on-dark .nmh-fe-prev-btn:hover {
    background: rgba(255, 255, 255, 0.08) !important;
    border-color: rgba(255, 255, 255, 0.60) !important;
}

/* Error states — keep readable on dark */
.nmh-fe-form-wrapper.nmh-fe-transparent.nmh-fe-on-dark .nmh-fe-form-row .nmh-fe-invalid {
    background-color: rgba(153, 27, 27, 0.35) !important;
    border-color: #ff6b6b !important;
}
.nmh-fe-form-wrapper.nmh-fe-transparent.nmh-fe-on-dark .nmh-fe-error-msg {
    color: #ff9999 !important;
}

/* GDPR toggle en modo oscuro */
.nmh-fe-form-wrapper.nmh-fe-transparent.nmh-fe-on-dark .nmh-fe-gdpr-toggle {
    color: rgba(255, 255, 255, 0.40) !important;
}
.nmh-fe-form-wrapper.nmh-fe-transparent.nmh-fe-on-dark .nmh-fe-gdpr-toggle:hover {
    color: rgba(255, 255, 255, 0.70) !important;
}

/* Summary list */
.nmh-fe-form-wrapper.nmh-fe-transparent.nmh-fe-on-dark .nmh-fe-summary-list {
    border-color: rgba(255, 255, 255, 0.15) !important;
}
.nmh-fe-form-wrapper.nmh-fe-transparent.nmh-fe-on-dark .nmh-fe-summary-item {
    border-bottom-color: rgba(255, 255, 255, 0.08) !important;
}
.nmh-fe-form-wrapper.nmh-fe-transparent.nmh-fe-on-dark .nmh-fe-summary-item:nth-child(odd) {
    background: rgba(255, 255, 255, 0.05) !important;
}
.nmh-fe-form-wrapper.nmh-fe-transparent.nmh-fe-on-dark .nmh-fe-summary-label {
    color: rgba(255, 255, 255, 0.90) !important;
}
.nmh-fe-form-wrapper.nmh-fe-transparent.nmh-fe-on-dark .nmh-fe-summary-value {
    color: rgba(255, 255, 255, 0.65) !important;
}

/* Response message (éxito / error tras envío) */
.nmh-fe-form-wrapper.nmh-fe-transparent.nmh-fe-on-dark .nmh-fe-response-msg.success {
    background: rgba(22, 101, 52, 0.40) !important;
    color: #86efac !important;
    border-color: rgba(134, 239, 172, 0.40) !important;
}
.nmh-fe-form-wrapper.nmh-fe-transparent.nmh-fe-on-dark .nmh-fe-response-msg.error {
    background: rgba(153, 27, 27, 0.40) !important;
    color: #fca5a5 !important;
    border-color: rgba(252, 165, 165, 0.40) !important;
}

/* Terminal message on dark */
.nmh-fe-form-wrapper.nmh-fe-transparent.nmh-fe-on-dark .nmh-fe-terminal-message {
    background: rgba(22, 101, 52, 0.30) !important;
    border-left-color: #4ade80 !important;
    color: rgba(255, 255, 255, 0.90) !important;
}

/* --- ON LIGHT: only strip the container background, text stays dark --- */
.nmh-fe-form-wrapper.nmh-fe-transparent.nmh-fe-on-light .nmh-fe-form-row input:focus,
.nmh-fe-form-wrapper.nmh-fe-transparent.nmh-fe-on-light .nmh-fe-form-row select:focus,
.nmh-fe-form-wrapper.nmh-fe-transparent.nmh-fe-on-light .nmh-fe-form-row textarea:focus {
    background-color: #ffffff !important;
}