/* NXP Easy Forms — theme overlays.
 *
 * Each theme is a modifier class on the form wrapper:
 *   <div class="nxp-easy-form nxp-easy-form--theme-<preset>">
 * Rules here only override surface treatment (fields, labels,
 * buttons, surfaces). Baseline chrome stays in frontend.css; themes
 * never restate it. Light/dark/auto is driven by the
 * data-nxp-form-theme attribute, so every light rule is paired with
 * explicit dark + auto-via-prefers-color-scheme variants.
 *
 * Brand color cascades var(--nxp-brand, var(--nxp-easy-form-button-bg,
 * #3b82f6)): per-form brand_color becomes the inline --nxp-brand,
 * component brand_accent_color is the fallback before the literal floor.
 *
 * Submit selectors include both .nxp-easy-form__button (production)
 * and .nxp-form-submit (preview) so themes render in the admin
 * preview surface and on visitor-facing forms alike. Loaded on the
 * site by FrontendAssetHelper and in admin by HtmlView. */


/* ===== MATERIAL — filled background + accent underline on focus ===== */

.nxp-easy-form.nxp-easy-form--theme-material {
    --mat-input-bg: #eef2f7;
    --mat-input-text: #111827;
    --mat-label-color: #4b5563;
    --mat-border-idle: #cbd5e1;
    --mat-required-color: #dc2626;
    --mat-error-color: #dc2626;
    --mat-placeholder-color: #9ca3af;
    --mat-button-text: #ffffff;
    --mat-button-hover-overlay: rgba(0, 0, 0, 0.08);
    --mat-range-track: #e5e7eb;
}

.nxp-easy-form.nxp-easy-form--theme-material[data-nxp-form-theme="dark"] {
    --mat-input-bg: #2a2a2a;
    --mat-input-text: #ffffff;
    --mat-label-color: #9ca3af;
    --mat-border-idle: #4b5563;
    --mat-required-color: #ef4444;
    --mat-error-color: #ef4444;
    --mat-placeholder-color: #6b7280;
    --mat-button-hover-overlay: rgba(255, 255, 255, 0.12);
    --mat-range-track: #3a3a3a;
}

@media (prefers-color-scheme: dark) {
    .nxp-easy-form.nxp-easy-form--theme-material[data-nxp-form-theme="auto"] {
        --mat-input-bg: #2a2a2a;
        --mat-input-text: #ffffff;
        --mat-label-color: #9ca3af;
        --mat-border-idle: #4b5563;
        --mat-required-color: #ef4444;
        --mat-error-color: #ef4444;
        --mat-placeholder-color: #6b7280;
        --mat-button-hover-overlay: rgba(255, 255, 255, 0.12);
        --mat-range-track: #3a3a3a;
    }
}

.nxp-easy-form.nxp-easy-form--theme-material .nxp-easy-form__group {
    margin-bottom: 20px;
}

.nxp-easy-form.nxp-easy-form--theme-material .nxp-easy-form__label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--mat-label-color);
    margin-bottom: 2px;
    letter-spacing: -0.01em;
}

/* Focused field colors its label with the accent — the canonical
   Material focused-label cue. A state color, never error/required. */
.nxp-easy-form.nxp-easy-form--theme-material .nxp-easy-form__group:focus-within .nxp-easy-form__label {
    color: var(--nxp-brand, var(--nxp-easy-form-button-bg, #3b82f6));
}

.nxp-easy-form.nxp-easy-form--theme-material .nxp-easy-form__required-marker {
    color: var(--mat-required-color);
    font-size: 0.9em;
    margin-left: 2px;
}

/* Signature filled treatment: bottom-only 2px border, top-rounded
   only; the bottom border carries the focus accent. */
.nxp-easy-form.nxp-easy-form--theme-material .nxp-easy-form__input,
.nxp-easy-form.nxp-easy-form--theme-material .nxp-easy-form__textarea,
.nxp-easy-form.nxp-easy-form--theme-material .nxp-easy-form__select {
    width: 100%;
    background: var(--mat-input-bg);
    color: var(--mat-input-text);
    border: 0;
    border-bottom: 2px solid var(--mat-border-idle);
    border-radius: 6px 6px 0 0;
    padding: 14px 14px 10px;
    font-size: 1rem;
    font-weight: 400;
    transition: background-color 150ms ease, border-color 150ms ease;
    box-sizing: border-box;
    outline: none;
}

/* Hover surfaces a faint elevation — the Material "hover ink" gesture. */
.nxp-easy-form.nxp-easy-form--theme-material .nxp-easy-form__input:hover:not(:focus),
.nxp-easy-form.nxp-easy-form--theme-material .nxp-easy-form__textarea:hover:not(:focus),
.nxp-easy-form.nxp-easy-form--theme-material .nxp-easy-form__select:hover:not(:focus) {
    background: color-mix(in srgb, var(--mat-input-bg) 92%, black);
}

.nxp-easy-form.nxp-easy-form--theme-material .nxp-easy-form__input::placeholder,
.nxp-easy-form.nxp-easy-form--theme-material .nxp-easy-form__textarea::placeholder {
    color: var(--mat-placeholder-color);
}

/* Focus accent: 3px brand bottom border, thicker than the 2px idle. */
.nxp-easy-form.nxp-easy-form--theme-material .nxp-easy-form__input:focus,
.nxp-easy-form.nxp-easy-form--theme-material .nxp-easy-form__textarea:focus,
.nxp-easy-form.nxp-easy-form--theme-material .nxp-easy-form__select:focus {
    border-bottom-width: 3px;
    border-bottom-color: var(--nxp-brand,
                          var(--nxp-easy-form-button-bg, #3b82f6));
    /* compensate for the +1px so the input doesn't visually jump */
    padding-bottom: 9px;
}

/* Error keys on aria-invalid on the control: the __error message slot
   renders on every group, so an :has(.__error) selector would match
   universally. */
.nxp-easy-form.nxp-easy-form--theme-material .nxp-easy-form__input[aria-invalid="true"],
.nxp-easy-form.nxp-easy-form--theme-material .nxp-easy-form__textarea[aria-invalid="true"],
.nxp-easy-form.nxp-easy-form--theme-material .nxp-easy-form__select[aria-invalid="true"] {
    border-bottom-color: var(--mat-error-color);
}

.nxp-easy-form.nxp-easy-form--theme-material .nxp-easy-form__error {
    color: var(--mat-error-color);
    font-size: 0.875rem;
    margin-top: 4px;
}

.nxp-easy-form.nxp-easy-form--theme-material .nxp-easy-form__textarea {
    min-height: 96px;
    resize: vertical;
}

/* Submit: filled brand button, soft shadow, slight tracking — the
   Material "contained" button gesture. */
.nxp-easy-form.nxp-easy-form--theme-material .nxp-easy-form__button:not(.nxp-easy-form__geolocation-capture),
.nxp-easy-form.nxp-easy-form--theme-material .nxp-form-submit {
    background: var(--nxp-brand,
                    var(--nxp-easy-form-button-bg, #3b82f6));
    color: var(--mat-button-text);
    border: 0;
    border-radius: 6px;
    padding: 12px 28px;
    font-size: 0.9375rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1),
                0 1px 2px rgba(0, 0, 0, 0.06);
    transition: background-color 150ms ease, box-shadow 150ms ease;
}

.nxp-easy-form.nxp-easy-form--theme-material .nxp-easy-form__button:not(.nxp-easy-form__geolocation-capture):hover,
.nxp-easy-form.nxp-easy-form--theme-material .nxp-form-submit:hover {
    background: color-mix(
        in srgb,
        var(--nxp-brand, var(--nxp-easy-form-button-bg, #3b82f6)) 88%,
        black
    );
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.12),
                0 2px 4px rgba(0, 0, 0, 0.08);
}

.nxp-easy-form.nxp-easy-form--theme-material .nxp-easy-form__button:not(.nxp-easy-form__geolocation-capture):focus-visible,
.nxp-easy-form.nxp-easy-form--theme-material .nxp-form-submit:focus-visible {
    outline: 2px solid var(--nxp-brand,
                            var(--nxp-easy-form-button-bg, #3b82f6));
    outline-offset: 2px;
}

.nxp-easy-form.nxp-easy-form--theme-material .nxp-easy-form__button:not(.nxp-easy-form__geolocation-capture):disabled,
.nxp-easy-form.nxp-easy-form--theme-material .nxp-form-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Tie native radio / checkbox / range to the brand color. */
.nxp-easy-form.nxp-easy-form--theme-material input[type="radio"],
.nxp-easy-form.nxp-easy-form--theme-material input[type="checkbox"],
.nxp-easy-form.nxp-easy-form--theme-material input[type="range"] {
    accent-color: var(--nxp-brand,
                       var(--nxp-easy-form-button-bg, #3b82f6));
}


/* ===== CLEAN — 1px bordered fields + accent focus ring =====
 * Premium-SaaS look (Stripe / Linear / Vercel / shadcn). The
 * modifier class is .nxp-easy-form--theme-clean; legacy `outline`
 * storage maps through at ThemeNormalizer and ThemeOverlayResolver. */

.nxp-easy-form.nxp-easy-form--theme-clean {
    --cln-input-bg: transparent;
    --cln-input-text: #111827;
    --cln-label-color: #374151;
    --cln-border-idle: rgba(15, 23, 42, 0.12);
    --cln-required-color: #dc2626;
    --cln-error-color: #dc2626;
    --cln-placeholder-color: #9ca3af;
    --cln-button-text: #ffffff;
}

.nxp-easy-form.nxp-easy-form--theme-clean[data-nxp-form-theme="dark"] {
    --cln-input-text: #ffffff;
    --cln-label-color: #e5e7eb;
    --cln-border-idle: rgba(255, 255, 255, 0.14);
    --cln-required-color: #ef4444;
    --cln-error-color: #ef4444;
    --cln-placeholder-color: #6b7280;
}

@media (prefers-color-scheme: dark) {
    .nxp-easy-form.nxp-easy-form--theme-clean[data-nxp-form-theme="auto"] {
        --cln-input-text: #ffffff;
        --cln-label-color: #e5e7eb;
        --cln-border-idle: rgba(255, 255, 255, 0.14);
        --cln-required-color: #ef4444;
        --cln-error-color: #ef4444;
        --cln-placeholder-color: #6b7280;
    }
}

.nxp-easy-form.nxp-easy-form--theme-clean .nxp-easy-form__group {
    margin-bottom: 22px;
}

.nxp-easy-form.nxp-easy-form--theme-clean .nxp-easy-form__label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--cln-label-color);
    margin-bottom: 7px;
    letter-spacing: -0.01em;
}

/* Focused field colors its label with the accent — a state cue that
   pairs with the brand focus border/ring. Never error/required. */
.nxp-easy-form.nxp-easy-form--theme-clean .nxp-easy-form__group:focus-within .nxp-easy-form__label {
    color: var(--nxp-brand, var(--nxp-easy-form-button-bg, #3b82f6));
}

.nxp-easy-form.nxp-easy-form--theme-clean .nxp-easy-form__required-marker {
    color: var(--cln-required-color);
    font-size: 0.9em;
    margin-left: 2px;
}

/* Inputs: transparent fill, soft 1px border, 8px radius. Focus pairs
   a brand-tinted ring with the border tinting to brand. */
.nxp-easy-form.nxp-easy-form--theme-clean .nxp-easy-form__input,
.nxp-easy-form.nxp-easy-form--theme-clean .nxp-easy-form__textarea,
.nxp-easy-form.nxp-easy-form--theme-clean .nxp-easy-form__select {
    width: 100%;
    background: var(--cln-input-bg);
    color: var(--cln-input-text);
    border: 1px solid var(--cln-border-idle);
    border-radius: 8px;
    padding: 12px 14px;
    font-size: 1rem;
    font-weight: 400;
    transition: border-color 150ms ease, box-shadow 150ms ease;
    box-sizing: border-box;
    outline: none;
}

.nxp-easy-form.nxp-easy-form--theme-clean .nxp-easy-form__input::placeholder,
.nxp-easy-form.nxp-easy-form--theme-clean .nxp-easy-form__textarea::placeholder {
    color: var(--cln-placeholder-color);
}

.nxp-easy-form.nxp-easy-form--theme-clean .nxp-easy-form__input:focus,
.nxp-easy-form.nxp-easy-form--theme-clean .nxp-easy-form__textarea:focus,
.nxp-easy-form.nxp-easy-form--theme-clean .nxp-easy-form__select:focus {
    border-color: var(--nxp-brand,
                        var(--nxp-easy-form-button-bg, #3b82f6));
    box-shadow: 0 0 0 3px color-mix(
        in srgb,
        var(--nxp-brand, var(--nxp-easy-form-button-bg, #3b82f6)) 22%,
        transparent
    );
}

.nxp-easy-form.nxp-easy-form--theme-clean .nxp-easy-form__input[aria-invalid="true"],
.nxp-easy-form.nxp-easy-form--theme-clean .nxp-easy-form__textarea[aria-invalid="true"],
.nxp-easy-form.nxp-easy-form--theme-clean .nxp-easy-form__select[aria-invalid="true"] {
    border-color: var(--cln-error-color);
}

.nxp-easy-form.nxp-easy-form--theme-clean .nxp-easy-form__error {
    color: var(--cln-error-color);
    font-size: 0.875rem;
    margin-top: 4px;
}

.nxp-easy-form.nxp-easy-form--theme-clean .nxp-easy-form__textarea {
    min-height: 96px;
    resize: vertical;
}

/* Submit: filled brand, subtle shadow, radius matched to the input
   (8px) so field and button feel like one system. */
.nxp-easy-form.nxp-easy-form--theme-clean .nxp-easy-form__button:not(.nxp-easy-form__geolocation-capture),
.nxp-easy-form.nxp-easy-form--theme-clean .nxp-form-submit {
    background: var(--nxp-brand,
                    var(--nxp-easy-form-button-bg, #3b82f6));
    color: var(--cln-button-text);
    border: 0;
    border-radius: 8px;
    padding: 12px 28px;
    font-size: 0.9375rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08),
                0 1px 2px rgba(0, 0, 0, 0.04);
    transition: background-color 150ms ease, box-shadow 150ms ease,
                transform 150ms ease;
}

.nxp-easy-form.nxp-easy-form--theme-clean .nxp-easy-form__button:not(.nxp-easy-form__geolocation-capture):hover,
.nxp-easy-form.nxp-easy-form--theme-clean .nxp-form-submit:hover {
    background: color-mix(
        in srgb,
        var(--nxp-brand, var(--nxp-easy-form-button-bg, #3b82f6)) 88%,
        black
    );
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1),
                0 2px 4px rgba(0, 0, 0, 0.06);
}

.nxp-easy-form.nxp-easy-form--theme-clean .nxp-easy-form__button:not(.nxp-easy-form__geolocation-capture):focus-visible,
.nxp-easy-form.nxp-easy-form--theme-clean .nxp-form-submit:focus-visible {
    box-shadow: 0 0 0 3px color-mix(
        in srgb,
        var(--nxp-brand, var(--nxp-easy-form-button-bg, #3b82f6)) 35%,
        transparent
    );
}

.nxp-easy-form.nxp-easy-form--theme-clean .nxp-easy-form__button:not(.nxp-easy-form__geolocation-capture):disabled,
.nxp-easy-form.nxp-easy-form--theme-clean .nxp-form-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.nxp-easy-form.nxp-easy-form--theme-clean input[type="radio"],
.nxp-easy-form.nxp-easy-form--theme-clean input[type="checkbox"],
.nxp-easy-form.nxp-easy-form--theme-clean input[type="range"] {
    accent-color: var(--nxp-brand,
                       var(--nxp-easy-form-button-bg, #3b82f6));
}


/* ===== CARD — each field group as a soft-shadow card =====
 * Typeform / Calendly / Greenhouse aesthetic. Best for short-to-
 * medium forms; the card chrome compounds visual weight in long ones. */

/* --card-surface is the outer panel the cards sit on; without it the
   white cards blend into a white host page. */
.nxp-easy-form.nxp-easy-form--theme-card {
    --card-surface: #f9fafb;
    --card-bg: #ffffff;
    --card-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    --card-border: rgba(0, 0, 0, 0.06);
    --card-input-text: #111827;
    --card-label-color: #111827;
    --card-help-color: #6b7280;
    --card-border-idle: #d1d5db;
    --card-error-color: #ef4444;
    --card-placeholder-color: #9ca3af;
    --card-button-text: #ffffff;
}

.nxp-easy-form.nxp-easy-form--theme-card[data-nxp-form-theme="dark"] {
    --card-surface: #0f0f0f;
    --card-bg: #1f1f1f;
    --card-shadow: 0 4px 12px rgba(0, 0, 0, 0.45);
    --card-border: rgba(255, 255, 255, 0.06);
    --card-input-text: #ffffff;
    --card-label-color: #ffffff;
    --card-help-color: #9ca3af;
    --card-border-idle: #4b5563;
    --card-error-color: #ef4444;
    --card-placeholder-color: #6b7280;
}

@media (prefers-color-scheme: dark) {
    .nxp-easy-form.nxp-easy-form--theme-card[data-nxp-form-theme="auto"] {
        --card-surface: #0f0f0f;
        --card-bg: #1f1f1f;
        --card-shadow: 0 4px 12px rgba(0, 0, 0, 0.45);
        --card-border: rgba(255, 255, 255, 0.06);
        --card-input-text: #ffffff;
        --card-label-color: #ffffff;
        --card-help-color: #9ca3af;
        --card-border-idle: #4b5563;
        --card-error-color: #ef4444;
        --card-placeholder-color: #6b7280;
    }
}

/* Outer panel. No max-width: a form mounted in a narrow module
   shouldn't get a wider panel than its container. */
.nxp-easy-form.nxp-easy-form--theme-card {
    background: var(--card-surface);
    padding: 24px;
    border-radius: 16px;
}

.nxp-easy-form.nxp-easy-form--theme-card .nxp-easy-form__group {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    box-shadow: var(--card-shadow);
    padding: 20px;
    margin-bottom: 14px;
    transition: box-shadow 150ms ease;
}

.nxp-easy-form.nxp-easy-form--theme-card .nxp-easy-form__group:last-of-type {
    margin-bottom: 0;
}

/* Separate the CTA from the last card so it reads as the closing step. */
.nxp-easy-form.nxp-easy-form--theme-card .nxp-easy-form__actions {
    margin-top: 20px;
}

/* Error: red left-border accent on the card. Keyed on aria-invalid
   rather than :has(.__error), which would match every group because
   FieldChrome renders the error slot on all of them. */
.nxp-easy-form.nxp-easy-form--theme-card .nxp-easy-form__group:has(
    .nxp-easy-form__input[aria-invalid="true"],
    .nxp-easy-form__textarea[aria-invalid="true"],
    .nxp-easy-form__select[aria-invalid="true"]
) {
    border-left: 2px solid var(--card-error-color);
}

.nxp-easy-form.nxp-easy-form--theme-card .nxp-easy-form__label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--card-label-color);
    margin-bottom: 8px;
}

/* Focused field colors its label with the accent — a state cue that
   pairs with the brand focus underline. Never error/required. */
.nxp-easy-form.nxp-easy-form--theme-card .nxp-easy-form__group:focus-within .nxp-easy-form__label {
    color: var(--nxp-brand, var(--nxp-easy-form-button-bg, #3b82f6));
}

/* Required marker becomes a "Required" pill: FieldChrome emits the
   translated label as data-required-label, the asterisk stays in the
   DOM (aria-hidden) but collapses to font-size 0 so only the pill shows. */
.nxp-easy-form.nxp-easy-form--theme-card .nxp-easy-form__required-marker {
    display: inline-block;
    background: var(--nxp-brand,
                    var(--nxp-easy-form-button-bg, #3b82f6));
    border-radius: 12px;
    margin-left: 8px;
    vertical-align: middle;
    font-size: 0;
    line-height: 0;
}

.nxp-easy-form.nxp-easy-form--theme-card .nxp-easy-form__required-marker::after {
    content: attr(data-required-label);
    display: inline-block;
    color: #ffffff;
    font-size: 0.7rem;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: 0.01em;
    padding: 3px 9px;
}

/* Inputs stay minimal — the card chrome carries the visual weight. */
.nxp-easy-form.nxp-easy-form--theme-card .nxp-easy-form__input,
.nxp-easy-form.nxp-easy-form--theme-card .nxp-easy-form__textarea,
.nxp-easy-form.nxp-easy-form--theme-card .nxp-easy-form__select {
    width: 100%;
    background: transparent;
    color: var(--card-input-text);
    border: 0;
    border-bottom: 1px solid var(--card-border-idle);
    border-radius: 0;
    padding: 8px 0;
    font-size: 1rem;
    font-weight: 400;
    transition: border-color 150ms ease, border-width 150ms ease;
    box-sizing: border-box;
    outline: none;
}

.nxp-easy-form.nxp-easy-form--theme-card .nxp-easy-form__input::placeholder,
.nxp-easy-form.nxp-easy-form--theme-card .nxp-easy-form__textarea::placeholder {
    color: var(--card-placeholder-color);
}

.nxp-easy-form.nxp-easy-form--theme-card .nxp-easy-form__input:focus,
.nxp-easy-form.nxp-easy-form--theme-card .nxp-easy-form__textarea:focus,
.nxp-easy-form.nxp-easy-form--theme-card .nxp-easy-form__select:focus {
    border-bottom-width: 2px;
    border-bottom-color: var(--nxp-brand,
                            var(--nxp-easy-form-button-bg, #3b82f6));
}

.nxp-easy-form.nxp-easy-form--theme-card .nxp-easy-form__input[aria-invalid="true"],
.nxp-easy-form.nxp-easy-form--theme-card .nxp-easy-form__textarea[aria-invalid="true"],
.nxp-easy-form.nxp-easy-form--theme-card .nxp-easy-form__select[aria-invalid="true"] {
    border-bottom-color: var(--card-error-color);
    border-bottom-width: 2px;
}

.nxp-easy-form.nxp-easy-form--theme-card .nxp-easy-form__error {
    color: var(--card-error-color);
    font-size: 0.75rem;
    margin-top: 8px;
}

.nxp-easy-form.nxp-easy-form--theme-card .nxp-easy-form__textarea {
    min-height: 96px;
    resize: vertical;
}

.nxp-easy-form.nxp-easy-form--theme-card .nxp-easy-form__hint {
    color: var(--card-help-color);
    font-size: 0.75rem;
    margin-top: 8px;
}

/* Submit: larger and full-width inside its card — the Card theme's
   deliberate exception to the cross-theme button, for an "important
   form" CTA. */
.nxp-easy-form.nxp-easy-form--theme-card .nxp-easy-form__button:not(.nxp-easy-form__geolocation-capture),
.nxp-easy-form.nxp-easy-form--theme-card .nxp-form-submit {
    width: 100%;
    background: var(--nxp-brand,
                    var(--nxp-easy-form-button-bg, #3b82f6));
    color: var(--card-button-text);
    border: 0;
    border-radius: 8px;
    padding: 16px 24px;
    font-size: 1.0625rem;
    font-weight: 500;
    letter-spacing: -0.01em;
    cursor: pointer;
    transition: background-color 150ms ease, box-shadow 150ms ease;
}

.nxp-easy-form.nxp-easy-form--theme-card .nxp-easy-form__button:not(.nxp-easy-form__geolocation-capture):hover,
.nxp-easy-form.nxp-easy-form--theme-card .nxp-form-submit:hover {
    background: color-mix(
        in srgb,
        var(--nxp-brand, var(--nxp-easy-form-button-bg, #3b82f6)) 88%,
        black
    );
}

.nxp-easy-form.nxp-easy-form--theme-card .nxp-easy-form__button:not(.nxp-easy-form__geolocation-capture):focus-visible,
.nxp-easy-form.nxp-easy-form--theme-card .nxp-form-submit:focus-visible {
    box-shadow: 0 0 0 3px color-mix(
        in srgb,
        var(--nxp-brand, var(--nxp-easy-form-button-bg, #3b82f6)) 30%,
        transparent
    );
}

.nxp-easy-form.nxp-easy-form--theme-card .nxp-easy-form__button:not(.nxp-easy-form__geolocation-capture):disabled,
.nxp-easy-form.nxp-easy-form--theme-card .nxp-form-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.nxp-easy-form.nxp-easy-form--theme-card input[type="radio"],
.nxp-easy-form.nxp-easy-form--theme-card input[type="checkbox"],
.nxp-easy-form.nxp-easy-form--theme-card input[type="range"] {
    accent-color: var(--nxp-brand,
                       var(--nxp-easy-form-button-bg, #3b82f6));
}


/* ===== UNDERLINE — no border, single bottom line, accent on focus =====
 * Editorial / minimalist (Medium / Substack / NYT comment box).
 * Token colors hit WCAG AA: label #374151 ~9.5:1, placeholder
 * #6b7280 ~4.7:1, underline #9ca3af ~3.1:1 (non-text) on white. */

.nxp-easy-form.nxp-easy-form--theme-underline {
    --und-input-text: #111827;
    --und-label-color: #374151;
    --und-border-idle: #9ca3af;
    --und-required-color: #dc2626;
    --und-error-color: #dc2626;
    --und-placeholder-color: #6b7280;
}

.nxp-easy-form.nxp-easy-form--theme-underline[data-nxp-form-theme="dark"] {
    --und-input-text: #f3f4f6;
    --und-label-color: #d1d5db;
    --und-border-idle: #6b7280;
    --und-required-color: #ef4444;
    --und-error-color: #ef4444;
    --und-placeholder-color: #9ca3af;
}

@media (prefers-color-scheme: dark) {
    .nxp-easy-form.nxp-easy-form--theme-underline[data-nxp-form-theme="auto"] {
        --und-input-text: #f3f4f6;
        --und-label-color: #d1d5db;
        --und-border-idle: #6b7280;
        --und-required-color: #ef4444;
        --und-error-color: #ef4444;
        --und-placeholder-color: #9ca3af;
    }
}

.nxp-easy-form.nxp-easy-form--theme-underline .nxp-easy-form__group {
    margin-bottom: 24px;
}

/* All-caps muted labels. Tracking kept at 0.06em and overflow-wrap
   anywhere so long German / French labels don't overflow the column. */
.nxp-easy-form.nxp-easy-form--theme-underline .nxp-easy-form__label {
    display: block;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--und-label-color);
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

/* Focused field colors its label with the accent — an editorial focus
   cue on the otherwise-muted uppercase label. Never error/required. */
.nxp-easy-form.nxp-easy-form--theme-underline .nxp-easy-form__group:focus-within .nxp-easy-form__label {
    color: var(--nxp-brand, var(--nxp-easy-form-button-bg, #3b82f6));
}

.nxp-easy-form.nxp-easy-form--theme-underline .nxp-easy-form__required-marker {
    color: var(--und-required-color);
    font-size: 0.9em;
    margin-left: 2px;
}

/* Inputs: no border or fill; single bottom line becomes 2px accent
   on focus. */
.nxp-easy-form.nxp-easy-form--theme-underline .nxp-easy-form__input,
.nxp-easy-form.nxp-easy-form--theme-underline .nxp-easy-form__textarea,
.nxp-easy-form.nxp-easy-form--theme-underline .nxp-easy-form__select {
    width: 100%;
    background: transparent;
    color: var(--und-input-text);
    border: 0;
    border-bottom: 1px solid var(--und-border-idle);
    border-radius: 0;
    padding: 6px 0;
    font-size: 1rem;
    font-weight: 400;
    transition: border-color 150ms ease, border-width 150ms ease;
    box-sizing: border-box;
    outline: none;
}

.nxp-easy-form.nxp-easy-form--theme-underline .nxp-easy-form__input::placeholder,
.nxp-easy-form.nxp-easy-form--theme-underline .nxp-easy-form__textarea::placeholder {
    color: var(--und-placeholder-color);
}

.nxp-easy-form.nxp-easy-form--theme-underline .nxp-easy-form__input:focus,
.nxp-easy-form.nxp-easy-form--theme-underline .nxp-easy-form__textarea:focus,
.nxp-easy-form.nxp-easy-form--theme-underline .nxp-easy-form__select:focus {
    border-bottom-width: 2px;
    border-bottom-color: var(--nxp-brand,
                            var(--nxp-easy-form-button-bg, #3b82f6));
}

.nxp-easy-form.nxp-easy-form--theme-underline .nxp-easy-form__input[aria-invalid="true"],
.nxp-easy-form.nxp-easy-form--theme-underline .nxp-easy-form__textarea[aria-invalid="true"],
.nxp-easy-form.nxp-easy-form--theme-underline .nxp-easy-form__select[aria-invalid="true"] {
    border-bottom-color: var(--und-error-color);
    border-bottom-width: 2px;
}

.nxp-easy-form.nxp-easy-form--theme-underline .nxp-easy-form__error {
    color: var(--und-error-color);
    font-size: 0.75rem;
    margin-top: 4px;
}

.nxp-easy-form.nxp-easy-form--theme-underline .nxp-easy-form__textarea {
    min-height: 96px;
    resize: vertical;
}

/* Submit: filled-brand pill, visibly primary while keeping the
   editorial silhouette. */
.nxp-easy-form.nxp-easy-form--theme-underline .nxp-easy-form__button:not(.nxp-easy-form__geolocation-capture),
.nxp-easy-form.nxp-easy-form--theme-underline .nxp-form-submit {
    background: var(--nxp-brand,
                    var(--nxp-easy-form-button-bg, #3b82f6));
    color: #ffffff;
    border: 0;
    border-radius: 9999px;
    padding: 10px 28px;
    font-size: 0.875rem;
    font-weight: 600;
    letter-spacing: 0.025em;
    cursor: pointer;
    transition: background-color 150ms ease, box-shadow 150ms ease;
}

.nxp-easy-form.nxp-easy-form--theme-underline .nxp-easy-form__button:not(.nxp-easy-form__geolocation-capture):hover,
.nxp-easy-form.nxp-easy-form--theme-underline .nxp-form-submit:hover {
    background: color-mix(
        in srgb,
        var(--nxp-brand, var(--nxp-easy-form-button-bg, #3b82f6)) 88%,
        black
    );
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.nxp-easy-form.nxp-easy-form--theme-underline .nxp-easy-form__button:not(.nxp-easy-form__geolocation-capture):focus-visible,
.nxp-easy-form.nxp-easy-form--theme-underline .nxp-form-submit:focus-visible {
    outline: 2px solid var(--nxp-brand,
                            var(--nxp-easy-form-button-bg, #3b82f6));
    outline-offset: 2px;
}

.nxp-easy-form.nxp-easy-form--theme-underline .nxp-easy-form__button:not(.nxp-easy-form__geolocation-capture):disabled,
.nxp-easy-form.nxp-easy-form--theme-underline .nxp-form-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.nxp-easy-form.nxp-easy-form--theme-underline input[type="radio"],
.nxp-easy-form.nxp-easy-form--theme-underline input[type="checkbox"],
.nxp-easy-form.nxp-easy-form--theme-underline input[type="range"] {
    accent-color: var(--nxp-brand,
                       var(--nxp-easy-form-button-bg, #3b82f6));
}
