/* ============================================================================
   FORMS — canonical .uk-input system + deprecated .input shims
   ============================================================================
   ⚠️  DEPRECATED MIGRATION SHIMS  ⚠️
   ----------------------------------------------------------------------------
   Every rule in this file lists TWO class names: the canonical .uk-* name and
   the legacy unprefixed shim (e.g. ".uk-input, .input { … }"). The canonical
   name is what new code uses. The unprefixed name (.input, .form-row,
   .form-field, .form-examples, .form-example-chip, .form-note, .form-lead,
   .form-error, .input-segmented) exists ONLY to keep the live tool pages
   rendering during the namespace migration.

       Replacement      ──  use the .uk-* name in new markup.
       Live consumers   ──  /http, /ping, /dns, /whois, /ssl, /port, /ip.
       Remove when      ──  each tool page swaps its blade class names from
                            .input/.form-row/etc. to .uk-input/.uk-form-row/etc.
                            At that point, strip the legacy selector from the
                            relevant rule. When every rule in this file lists
                            only .uk-* selectors, the migration is done.

   Legacy parallel classes from production CSS (.newsletter-input, .tool-input)
   continue to live in their own files until they are migrated separately.
   ============================================================================ */

/* ============================================
   Base input
   ============================================ */
.uk-input,
.input {
    width: 100%;
    padding: 0.625rem 1rem;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    color: var(--color-text);
    font-family: var(--font-sans);
    font-size: var(--font-md);
    line-height: var(--line-normal);
    outline: 2px solid transparent;
    outline-offset: 2px;
    transition: var(--transition-fast);
}

.uk-input::placeholder,
.input::placeholder {
    color: var(--color-text-muted);
}

.uk-input:hover:not(:disabled):not(:focus),
.input:hover:not(:disabled):not(:focus) {
    border-color: var(--color-border-light);
}

.uk-input:focus,
.input:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(var(--color-primary-rgb), 0.15);
}

.uk-input:focus-visible,
.input:focus-visible {
    outline-color: var(--color-primary);
}

.uk-input:disabled,
.input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ============================================
   Sizes
   ============================================ */
.uk-input--sm,
.input--sm {
    padding: 0.4rem 0.75rem;
    font-size: var(--font-sm);
    border-radius: var(--radius-md);
}

.uk-input--lg,
.input--lg {
    padding: 0.875rem 1.25rem;
    font-size: var(--font-base);
}

/* ============================================
   Modifiers
   ============================================ */
.uk-input--mono,
.input--mono {
    font-family: var(--font-mono);
}

.uk-input--error,
.input--error,
.uk-input[aria-invalid="true"],
.input[aria-invalid="true"] {
    border-color: var(--color-error);
}

.uk-input--error:focus,
.input--error:focus,
.uk-input[aria-invalid="true"]:focus,
.input[aria-invalid="true"]:focus {
    border-color: var(--color-error);
    box-shadow: 0 0 0 3px rgba(var(--color-error-rgb), 0.15);
}

/* ============================================
   Textarea — same look as .uk-input, just multi-line,
   Textarea — same look as .input, just multi-line
   ============================================ */
textarea.uk-input,
textarea.input {
    resize: vertical;
    min-height: 6rem;
    line-height: var(--line-relaxed);
}

/* ============================================
   Form field — label + input + helper/error
   ============================================ */
.uk-form-field,
.form-field {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.uk-form-field-label,
.form-field-label {
    font-size: var(--font-sm);
    font-weight: 500;
    color: var(--color-text-secondary);
    line-height: var(--line-normal);
}

.uk-form-field-label .uk-form-field-required,
.form-field-label .form-field-required {
    color: var(--color-error);
    margin-left: 2px;
}

.uk-form-field-helper,
.form-field-helper {
    font-size: var(--font-xs);
    color: var(--color-text-muted);
    line-height: var(--line-normal);
}

.uk-form-field-error,
.form-field-error {
    font-size: var(--font-xs);
    color: var(--color-error);
    line-height: var(--line-normal);
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

.uk-form-field-error svg,
.form-field-error svg {
    width: var(--icon-xs);
    height: var(--icon-xs);
    flex-shrink: 0;
}

/* ============================================
   Form row — inline group of fields + button
   Simple case: <input class="input"> + <button class="btn">
   Multi-field case: several <.uk-form-field> wrappers + <button class="btn">,
   Multi-field case: several <.form-field> wrappers + <button class="btn">,
   each .uk-form-field sized via .uk-form-field--grow / --sm / --md.,
   each .form-field sized via .form-field--grow / --sm / --md.
   ============================================ */
.uk-form-row,
.form-row {
    display: flex;
    gap: var(--space-sm);
    align-items: end;
}

.uk-form-row > .uk-input,
.form-row > .input {
    flex: 1;
    min-width: 0;
}

.uk-form-row > .uk-form-field,
.form-row > .form-field {
    min-width: 0;
}

.uk-form-row > .uk-btn,
.form-row > .btn {
    flex-shrink: 0;
}

/* Bump gap when the row contains labeled fields — separates field-pairs
   visually from the label-to-input gap inside each .uk-form-field */,
   visually from the label-to-input gap inside each .form-field */
.uk-form-row:has(> .uk-form-field),
.form-row:has(> .form-field) {
    gap: var(--space-md);
}

/* ============================================
   Form field — sizing modifiers for use inside .uk-form-row,
   Form field — sizing modifiers for use inside .form-row
   ============================================ */
.uk-form-field--grow,
.form-field--grow {
    flex: 1 1 220px;
}

.uk-form-field--sm,
.form-field--sm {
    /* Sized to fit a 5-digit port plus the .uk-input-number spinner column */
    flex: 0 0 10ch;
}

.uk-form-field--md,
.form-field--md {
    flex: 0 0 14ch;
}

@media (max-width: 480px) {
    .uk-form-row,
    .form-row {
        flex-direction: column;
        align-items: stretch;
    }

    .uk-form-row > .uk-btn,
    .form-row > .btn {
        width: 100%;
    }

    .uk-form-row > .uk-form-field,
    .form-row > .form-field,
    .uk-form-row > .uk-form-field--grow,
    .form-row > .form-field--grow,
    .uk-form-row > .uk-form-field--sm,
    .form-row > .form-field--sm,
    .uk-form-row > .uk-form-field--md,
    .form-row > .form-field--md {
        flex: 1 1 auto;
        width: 100%;
    }
}

/* ============================================
   Segmented control — form-shape (flat, input-height)
   For in-form choices (TCP/UDP, On/Off, etc.). Distinct
   from .pricing-toggle-pill / .frequency-pills which are
   prominent pill-shaped marketing toggles.
   ============================================ */
.uk-input-segmented,
.input-segmented {
    display: inline-flex;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: var(--transition-fast);
}

.uk-input-segmented:hover,
.input-segmented:hover {
    border-color: var(--color-border-light);
}

.uk-input-segmented:focus-within,
.input-segmented:focus-within {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(var(--color-primary-rgb), 0.15);
}

.uk-input-segmented-btn,
.input-segmented-btn {
    padding: 0.625rem 1rem;
    background: transparent;
    border: 0;
    color: var(--color-text-secondary);
    font-family: inherit;
    font-size: var(--font-md);
    font-weight: 500;
    line-height: var(--line-normal);
    cursor: pointer;
    transition: var(--transition-fast);
    white-space: nowrap;
}

.uk-input-segmented-btn:not(:last-child),
.input-segmented-btn:not(:last-child) {
    border-right: 1px solid var(--color-border);
}

.uk-input-segmented-btn:not(.active):hover,
.input-segmented-btn:not(.active):hover {
    background: rgba(var(--color-primary-rgb), 0.05);
    color: var(--color-text);
}

.uk-input-segmented-btn.active,
.input-segmented-btn.active {
    background: var(--color-primary);
    color: #fff;
    font-weight: 600;
}

/* Sizes — match .input--sm / .input--lg */
.uk-input-segmented--sm .uk-input-segmented-btn,
.input-segmented--sm .input-segmented-btn {
    padding: 0.4rem 0.75rem;
    font-size: var(--font-sm);
}
.uk-input-segmented--sm,
.input-segmented--sm {
    border-radius: var(--radius-md);
}

.uk-input-segmented--lg .uk-input-segmented-btn,
.input-segmented--lg .input-segmented-btn {
    padding: 0.875rem 1.25rem;
    font-size: var(--font-base);
}

/* Inside .form-row, the segmented control should not stretch */
.uk-form-row > .uk-input-segmented,
.form-row > .input-segmented {
    flex: 0 0 auto;
}

/* ============================================
   Select-next — fully custom dropdown
   Uses <select class="uk-select"> as the source of truth.
   forms-select.js builds the visible widget alongside it and
   hides the native <select>. Form submission keeps working.
   ============================================ */
select.uk-select {
    /* Hide the native control once the JS enhancer has wrapped it.
       Keep it as a focusable form-submit source via opacity/position
       trick — we set [data-uk-select-enhanced] from JS so unenhanced
       selects (no JS) still render natively as a graceful fallback. */
}
select.uk-select[data-uk-select-enhanced="1"] {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
    pointer-events: none;
}

.uk-select-wrap {
    position: relative;
    display: inline-flex;
    flex-direction: column;
    width: 100%;
}

.uk-select-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-md);
    width: 100%;
    text-align: left;
    cursor: pointer;
    /* .uk-input class is added by JS so we inherit padding/border/etc. */,
    /* .input class is added by JS so we inherit padding/border/etc. */
}

.uk-select-trigger:focus-visible {
    outline-color: var(--color-primary);
}

.uk-select-trigger[disabled] {
    cursor: not-allowed;
    opacity: 0.5;
}

.uk-select-value {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.uk-select-value.is-placeholder {
    color: var(--color-text-muted);
}

.uk-select-chevron {
    flex-shrink: 0;
    width: 14px;
    height: 14px;
    color: var(--color-text-secondary);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), color var(--transition-fast);
}

.uk-select-trigger:hover:not([disabled]) .uk-select-chevron,
.uk-select-trigger:focus-visible:not([disabled]) .uk-select-chevron {
    color: var(--color-primary);
}

.uk-select-wrap[data-state="open"] .uk-select-chevron,
.uk-select-wrap[data-state="closing"] .uk-select-chevron {
    transform: rotate(180deg);
    color: var(--color-primary);
}

.uk-select-panel {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    /* No `right: 0` — let the panel grow under content when an option
       is wider than the trigger (mirrors native <select> behaviour).
       min-width keeps it at least as wide as the trigger; max-width
       caps it so a single very long option doesn't blow out the row. */
    min-width: 100%;
    max-width: 24rem;
    width: max-content;
    z-index: 50;
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    overflow: hidden; /* clip inner scroll content to the rounded shape */
    box-shadow:
        0 10px 28px rgba(0, 0, 0, 0.35),
        0 0 0 1px rgba(var(--color-primary-rgb), 0.04),
        0 6px 24px rgba(var(--color-primary-rgb), 0.08);
    opacity: 0;
    transform: translateY(-6px) scale(0.98);
    transform-origin: top center;
    transition: opacity 0.16s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.16s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: none;
}

.uk-select-wrap[data-state="open"] .uk-select-panel {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.uk-select-wrap[data-state="closing"] .uk-select-panel {
    opacity: 0;
    transform: translateY(-6px) scale(0.98);
    pointer-events: none;
}

/* The actual scroll surface — native scrollbar hidden across all
   engines (Firefox, Chromium, Safari, legacy Edge / IE). The list
   stays fully scrollable via wheel / trackpad / keyboard, and a
   custom "plump" scrollbar (.uk-select-scrollbar + thumb, built
   from forms-select.js) overlays the right edge with full visual
   control — no native end buttons exist in this rendering path. */
.uk-select-list {
    max-height: 18rem;
    overflow-y: auto;
    padding: var(--space-xs);
    /* padding-right gets bumped by JS only when the custom scrollbar
       is actually shown — otherwise option labels use the full width. */
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.uk-select-list[data-scrollbar="visible"] {
    padding-right: calc(var(--space-xs) + 10px);
}
.uk-select-list::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}

/* ---- Plump custom scrollbar — overlays the right edge of the
   panel. Track is a faint tinted rail; thumb is primary-tinted and
   "puffs up" on hover via scaleX. Drag the thumb to scroll, click
   the track to jump. Designed to be lifted into a generic
   .uk-scrollbar-plump rule once we apply it elsewhere on the site. ---- */
.uk-select-scrollbar {
    position: absolute;
    top: var(--space-sm);
    right: 5px;
    bottom: var(--space-sm);
    width: 6px;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.04);
    z-index: 1;
    cursor: pointer;
    transition: transform 0.15s cubic-bezier(0.16, 1, 0.3, 1),
                background 0.15s ease;
    transform-origin: center;
}

.uk-select-scrollbar[hidden] {
    display: none;
}

.uk-select-scrollbar:hover,
.uk-select-scrollbar:has(.uk-select-scrollbar-thumb.is-dragging) {
    background: rgba(255, 255, 255, 0.07);
    transform: scaleX(1.6);
}

.uk-select-scrollbar-thumb {
    position: absolute;
    left: 0;
    right: 0;
    min-height: 28px;
    background: rgba(var(--color-primary-rgb), 0.45);
    border-radius: var(--radius-full);
    cursor: grab;
    touch-action: none;
    transition: background-color 0.15s ease;
}

.uk-select-scrollbar-thumb:hover,
.uk-select-scrollbar:hover .uk-select-scrollbar-thumb {
    background: rgba(var(--color-primary-rgb), 0.65);
}

.uk-select-scrollbar-thumb.is-dragging {
    background: rgba(var(--color-primary-rgb), 0.8);
    cursor: grabbing;
}

.uk-select-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-md);
    width: 100%;
    padding: 0.5rem 0.75rem;
    background: transparent;
    border: 0;
    border-radius: var(--radius-lg);
    color: var(--color-text);
    font-family: inherit;
    font-size: var(--font-md);
    line-height: var(--line-normal);
    text-align: left;
    cursor: pointer;
    transition: background-color 0.12s ease, color 0.12s ease;
}

.uk-select-option + .uk-select-option {
    margin-top: 1px;
}

.uk-select-option:hover:not(:disabled),
.uk-select-option:focus-visible:not(:disabled) {
    background: rgba(var(--color-primary-rgb), 0.1);
    color: var(--color-primary);
    outline: none;
}

.uk-select-option[aria-selected="true"] {
    background: rgba(var(--color-primary-rgb), 0.14);
    color: var(--color-primary);
    font-weight: 600;
}

.uk-select-option[aria-selected="true"]:hover {
    background: rgba(var(--color-primary-rgb), 0.2);
}

.uk-select-option:disabled {
    color: var(--color-text-muted);
    cursor: not-allowed;
}

.uk-select-option-label {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.uk-select-check {
    flex-shrink: 0;
    width: 14px;
    height: 14px;
    color: var(--color-primary);
    opacity: 0;
    transform: scale(0.6);
    transition: opacity 0.18s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

.uk-select-option[aria-selected="true"] .uk-select-check {
    opacity: 1;
    transform: scale(1);
}

/* Live in a .form-row gracefully */
.uk-form-row > .uk-select-wrap,
.form-row > .uk-select-wrap {
    flex: 1 1 auto;
}

/* ============================================
   Number input — fully custom spinner
   <input type="number" class="input uk-input-number">
   forms-number.js wraps the input with a slim spinner
   column on the right edge — two stacked chevron buttons,
   primary-tinted on hover, with hold-to-repeat acceleration
   and at-limit dimming. Native browser spinners are hidden
   in every engine. The input itself remains the source of
   truth: form submission, ↑/↓ keyboard, mouse wheel and
   typing all keep working unchanged. Sizes inherit from
   the input's .uk-input--sm / .uk-input--lg modifiers via the,
   the input's .input--sm / .input--lg modifiers via the
   wrap's data-size attribute.
   ============================================ */

/* Hide native spinners across engines */
input[type="number"].uk-input-number {
    -moz-appearance: textfield;
    appearance: textfield;
}
input[type="number"].uk-input-number::-webkit-inner-spin-button,
input[type="number"].uk-input-number::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.uk-input-number-wrap {
    position: relative;
    display: block;
    width: 100%;
}

/* Reserve room on the right for the spinner column. The native
   value text gets a slimmer left padding too, so a 5-digit port
   still fits comfortably inside .uk-form-field--sm (10ch). */,
   still fits comfortably inside .form-field--sm (10ch). */
.uk-input-number-wrap > .uk-input-number {
    padding-right: 1.875rem;
}

.uk-input-number-wrap[data-size="sm"] > .uk-input-number {
    padding-right: 1.625rem;
}

.uk-input-number-wrap[data-size="lg"] > .uk-input-number {
    padding-right: 2.125rem;
}

/* The spinner column — sits inside the input's border, splits
   into two equal-height chevron buttons. The column itself is
   transparent; only the buttons take pointer events. */
.uk-input-number-spinner {
    position: absolute;
    top: 1px;
    right: 1px;
    bottom: 1px;
    width: 1.5rem;
    display: flex;
    flex-direction: column;
    pointer-events: none;
}

.uk-input-number-wrap[data-size="sm"] .uk-input-number-spinner {
    width: 1.25rem;
}

.uk-input-number-wrap[data-size="lg"] .uk-input-number-spinner {
    width: 1.75rem;
}

.uk-input-number-btn {
    flex: 1 1 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 0;
    padding: 0;
    margin: 0;
    color: var(--color-text-muted);
    cursor: pointer;
    pointer-events: auto;
    transition: background-color 0.12s ease, color 0.12s ease, transform 0.08s ease, opacity 0.15s ease;
}

/* Hug the input's inner corners so the hover backdrop fills the
   matching radius. Account for the 1px input border. */
.uk-input-number-btn--up {
    border-radius: 0 calc(var(--radius-lg) - 1px) 0 0;
}
.uk-input-number-btn--down {
    border-radius: 0 0 calc(var(--radius-lg) - 1px) 0;
}

.uk-input-number-wrap[data-size="sm"] .uk-input-number-btn--up {
    border-radius: 0 calc(var(--radius-md) - 1px) 0 0;
}
.uk-input-number-wrap[data-size="sm"] .uk-input-number-btn--down {
    border-radius: 0 0 calc(var(--radius-md) - 1px) 0;
}

/* Awaken the chevrons whenever the input is hovered or focused
   anywhere. Keeps them present-but-restrained at idle. */
.uk-input-number-wrap:hover .uk-input-number-btn,
.uk-input-number-wrap:focus-within .uk-input-number-btn {
    color: var(--color-text-secondary);
}

/* Hover the specific button: primary-tinted backdrop + chevron */
.uk-input-number-btn:hover:not([data-at-limit]):not([disabled]) {
    background: rgba(var(--color-primary-rgb), 0.12);
    color: var(--color-primary);
}

/* Active / held — deeper tint and a tiny push-down. data-pressed
   mirrors :active so the visual stays during pointer-capture or
   while the cursor briefly drifts off the button mid-hold. */
.uk-input-number-btn[data-pressed],
.uk-input-number-btn:active:not([data-at-limit]):not([disabled]) {
    background: rgba(var(--color-primary-rgb), 0.2);
    color: var(--color-primary);
    transform: scale(0.9);
}

.uk-input-number-btn:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: -2px;
    z-index: 1;
}

.uk-input-number-btn[data-at-limit] {
    color: var(--color-text-muted);
    opacity: 0.3;
    cursor: not-allowed;
}

.uk-input-number-btn[disabled] {
    cursor: not-allowed;
    opacity: 0.4;
}

.uk-input-number-btn svg {
    width: 11px;
    height: 11px;
    stroke-width: 2.5;
}

.uk-input-number-wrap[data-size="sm"] .uk-input-number-btn svg {
    width: 10px;
    height: 10px;
}

.uk-input-number-wrap[data-size="lg"] .uk-input-number-btn svg {
    width: 12px;
    height: 12px;
}

/* Whole input disabled — fade the spinner together with the input */
.uk-input-number-wrap:has(.uk-input-number:disabled) .uk-input-number-spinner {
    opacity: 0.5;
    pointer-events: none;
}

/* Live in .form-row gracefully */
.uk-form-row > .uk-input-number-wrap,
.form-row > .uk-input-number-wrap {
    flex: 1 1 auto;
    min-width: 0;
}

/* ============================================
   Form examples — "Try: …" chip row
   Sits under a form to offer one-click prefill of canned
   inputs. Chips are pill-shaped, mono-typed, light-touch
   in idle and primary-tinted on hover with a small lift.
   forms-examples.js wires up generic prefill via
   data-fill-{name} attributes that target inputs in the
   wrap's [data-form="#id"] (or the closest <form>).
   ============================================ */
.uk-form-examples,
.form-examples {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-sm);
    margin-top: var(--space-md);
    font-size: var(--font-sm);
}

.uk-form-examples-label,
.form-examples-label {
    font-weight: 500;
    color: var(--color-text-secondary);
    margin-right: var(--space-xs);
    line-height: var(--line-normal);
}

.uk-form-example-chip,
.form-example-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.3rem 0.85rem;
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid rgba(var(--color-primary-rgb), 0.18);
    border-radius: var(--radius-full);
    color: var(--color-text-secondary);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    line-height: var(--line-normal);
    cursor: pointer;
    transition: transform 0.15s cubic-bezier(0.16, 1, 0.3, 1),
                background-color 0.15s ease,
                border-color 0.15s ease,
                color 0.15s ease,
                box-shadow 0.2s ease;
}

.uk-form-example-chip:hover:not(:disabled),
.form-example-chip:hover:not(:disabled) {
    transform: translateY(-1px);
    background: rgba(var(--color-primary-rgb), 0.1);
    border-color: rgba(var(--color-primary-rgb), 0.5);
    color: var(--color-primary);
    box-shadow: 0 6px 14px rgba(var(--color-primary-rgb), 0.15);
}

.uk-form-example-chip:active:not(:disabled),
.form-example-chip:active:not(:disabled) {
    transform: translateY(0);
    background: rgba(var(--color-primary-rgb), 0.16);
    box-shadow: 0 2px 6px rgba(var(--color-primary-rgb), 0.2);
}

.uk-form-example-chip:focus-visible,
.form-example-chip:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

.uk-form-example-chip:disabled,
.form-example-chip:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Tone — optional semantic colouring via the chip border (and full
   tone wash on hover). Use <button class="form-example-chip"
   data-tone="success | warning | danger | info">…</button>. Chips
   without data-tone keep the neutral primary-tinted look. */
.uk-form-example-chip[data-tone="success"] { border-color: rgba(var(--color-success-rgb), 0.32); },
.form-example-chip[data-tone="success"] { border-color: rgba(var(--color-success-rgb), 0.32); }
.uk-form-example-chip[data-tone="warning"] { border-color: rgba(var(--color-warning-rgb), 0.32); },
.form-example-chip[data-tone="warning"] { border-color: rgba(var(--color-warning-rgb), 0.32); }
.uk-form-example-chip[data-tone="danger"]  { border-color: rgba(var(--color-error-rgb),   0.32); },
.form-example-chip[data-tone="danger"]  { border-color: rgba(var(--color-error-rgb),   0.32); }
.uk-form-example-chip[data-tone="info"]    { border-color: rgba(var(--color-info-rgb),    0.32); },
.form-example-chip[data-tone="info"]    { border-color: rgba(var(--color-info-rgb),    0.32); }

.uk-form-example-chip[data-tone="success"]:hover:not(:disabled),
.form-example-chip[data-tone="success"]:hover:not(:disabled) {
    background: rgba(var(--color-success-rgb), 0.1);
    border-color: rgba(var(--color-success-rgb), 0.6);
    color: var(--color-success);
    box-shadow: 0 6px 14px rgba(var(--color-success-rgb), 0.15);
}
.uk-form-example-chip[data-tone="warning"]:hover:not(:disabled),
.form-example-chip[data-tone="warning"]:hover:not(:disabled) {
    background: rgba(var(--color-warning-rgb), 0.1);
    border-color: rgba(var(--color-warning-rgb), 0.6);
    color: var(--color-warning);
    box-shadow: 0 6px 14px rgba(var(--color-warning-rgb), 0.15);
}
.uk-form-example-chip[data-tone="danger"]:hover:not(:disabled),
.form-example-chip[data-tone="danger"]:hover:not(:disabled) {
    background: rgba(var(--color-error-rgb), 0.1);
    border-color: rgba(var(--color-error-rgb), 0.6);
    color: var(--color-error);
    box-shadow: 0 6px 14px rgba(var(--color-error-rgb), 0.15);
}
.uk-form-example-chip[data-tone="info"]:hover:not(:disabled),
.form-example-chip[data-tone="info"]:hover:not(:disabled) {
    background: rgba(var(--color-info-rgb), 0.1);
    border-color: rgba(var(--color-info-rgb), 0.6);
    color: var(--color-info);
    box-shadow: 0 6px 14px rgba(var(--color-info-rgb), 0.15);
}

/* Chip with active state — used while the prefill is "current",
   so the user can see which example they last clicked. JS toggles
   it on click. */
.uk-form-example-chip.is-active,
.form-example-chip.is-active {
    background: rgba(var(--color-primary-rgb), 0.14);
    border-color: rgba(var(--color-primary-rgb), 0.55);
    color: var(--color-primary);
}

/* ============================================
   Form note — privacy / context callout under a form
   Soft elevated row with a small icon column (padlock by
   default — the privacy note that lives on every /tools/*
   page) and body text on the right. Faint primary-tinted
   backdrop and border. Replaces .tool-privacy-note.
   ============================================ */
.uk-form-note,
.form-note {
    display: flex;
    align-items: flex-start;
    gap: var(--space-sm);
    margin-top: var(--space-md);
    padding: 0.6rem 0.875rem;
    background: rgba(var(--color-primary-rgb), 0.05);
    border: 1px solid rgba(var(--color-primary-rgb), 0.16);
    border-radius: var(--radius-lg);
    color: var(--color-text-secondary);
    font-size: var(--font-sm);
    line-height: var(--line-normal);
    transition: border-color 0.2s ease, background-color 0.2s ease;
}

.uk-form-note:hover,
.form-note:hover,
.uk-form-note:focus-within,
.form-note:focus-within {
    border-color: rgba(var(--color-primary-rgb), 0.28);
    background: rgba(var(--color-primary-rgb), 0.07);
}

.uk-form-note-icon,
.form-note-icon {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    margin-top: 2px;
    color: var(--color-primary);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

/* When the link inside the note is hovered or focused, the lock
   "ticks" — small rotation that hints the icon is alive. */
.uk-form-note:hover .uk-form-note-icon,
.form-note:hover .form-note-icon,
.uk-form-note:focus-within .uk-form-note-icon,
.form-note:focus-within .form-note-icon {
    transform: rotate(-6deg);
}

.uk-form-note-body,
.form-note-body {
    flex: 1 1 auto;
    min-width: 0;
}

.uk-form-note-body strong,
.form-note-body strong {
    color: var(--color-text);
    font-weight: 600;
    margin-right: 4px;
}

.uk-form-note-body a,
.form-note-body a {
    color: var(--color-primary);
    text-decoration: none;
    border-bottom: 1px solid rgba(var(--color-primary-rgb), 0.4);
    transition: color 0.15s ease, border-color 0.15s ease;
}

.uk-form-note-body a:hover,
.form-note-body a:hover,
.uk-form-note-body a:focus-visible,
.form-note-body a:focus-visible {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
}

/* Tone variants — default tint is primary (privacy). Other tones
   re-skin the same shape with status-colour backdrops, borders,
   and icon colour. Use sparingly; .uk-form-note is meant for static,
   and icon colour. Use sparingly; .form-note is meant for static
   informational notes, not for runtime feedback (use Alerts for
   that). */
.uk-form-note--info,
.form-note--info {
    background: rgba(var(--color-info-rgb), 0.06);
    border-color: rgba(var(--color-info-rgb), 0.2);
}
.uk-form-note--info .uk-form-note-icon { color: var(--color-info); },
.form-note--info .form-note-icon { color: var(--color-info); }
.uk-form-note--info .uk-form-note-body a,
.form-note--info .form-note-body a {
    color: var(--color-info);
    border-bottom-color: rgba(var(--color-info-rgb), 0.4);
}
.uk-form-note--info .uk-form-note-body a:hover { border-bottom-color: var(--color-info); },
.form-note--info .form-note-body a:hover { border-bottom-color: var(--color-info); }

.uk-form-note--warning,
.form-note--warning {
    background: rgba(var(--color-warning-rgb), 0.06);
    border-color: rgba(var(--color-warning-rgb), 0.22);
}
.uk-form-note--warning .uk-form-note-icon { color: var(--color-warning); },
.form-note--warning .form-note-icon { color: var(--color-warning); }
.uk-form-note--warning .uk-form-note-body a,
.form-note--warning .form-note-body a {
    color: var(--color-warning);
    border-bottom-color: rgba(var(--color-warning-rgb), 0.45);
}
.uk-form-note--warning .uk-form-note-body a:hover { border-bottom-color: var(--color-warning); },
.form-note--warning .form-note-body a:hover { border-bottom-color: var(--color-warning); }

.uk-form-note--success,
.form-note--success {
    background: rgba(var(--color-success-rgb), 0.06);
    border-color: rgba(var(--color-success-rgb), 0.2);
}
.uk-form-note--success .uk-form-note-icon { color: var(--color-success); },
.form-note--success .form-note-icon { color: var(--color-success); }
.uk-form-note--success .uk-form-note-body a,
.form-note--success .form-note-body a {
    color: var(--color-success);
    border-bottom-color: rgba(var(--color-success-rgb), 0.4);
}
.uk-form-note--success .uk-form-note-body a:hover { border-bottom-color: var(--color-success); },
.form-note--success .form-note-body a:hover { border-bottom-color: var(--color-success); }

/* ============================================
   Form error — runtime error slot under a form
   Single-element container that consumer JS fills via
   textContent (no inner structure required). The warning
   icon lives in ::before so it survives every textContent
   update — paired with margin-left padding so the message
   text flows around the icon. Replaces .tool-error.
   Initial visibility via style="display: none" on the
   element; consumer toggles display: block to reveal.
   ============================================ */
.uk-form-error,
.form-error {
    margin-top: var(--space-md);
    padding: 0.65rem 0.95rem 0.65rem 2.5rem;
    position: relative;
    background: rgba(var(--color-error-rgb), 0.08);
    border: 1px solid rgba(var(--color-error-rgb), 0.28);
    border-radius: var(--radius-lg);
    color: var(--color-error);
    font-size: var(--font-sm);
    line-height: var(--line-normal);
    box-shadow: 0 4px 12px rgba(var(--color-error-rgb), 0.08);
}

/* Warning-triangle icon — danger-coloured stroke baked into
   the data URL so the icon survives any textContent updates
   from consumer JS (.tool-error JS just sets el.textContent). */
.uk-form-error::before,
.form-error::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0.85rem;
    width: 16px;
    height: 16px;
    margin-top: -8px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23D32F2F' stroke-width='2.25' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10.29 3.86 1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z'/%3E%3Cline x1='12' y1='9' x2='12' y2='13'/%3E%3Cline x1='12' y1='17' x2='12.01' y2='17'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 16px 16px;
}

/* Empty error stays out of the way even if a stylesheet override
   accidentally removes display:none — keeps the form layout clean. */
.uk-form-error:empty,
.form-error:empty {
    display: none;
}

/* ============================================
   Form lead — short intro paragraph above a form
   The "what this tool does" / "what to expect" line that
   sets context before the input. Token-driven typography,
   constrained measure for readability, brighter colour
   on inline <strong> highlights. Replaces the two diverging
   definitions of .tool-check-description (style.css small-muted
   on home, tools.css md-secondary on /tools/*).
   ============================================ */
.uk-form-lead,
.form-lead {
    margin: 0 0 var(--space-md) 0;
    max-width: 60ch;
    color: var(--color-text-secondary);
    font-size: var(--font-md);
    line-height: var(--line-normal);
}

.uk-form-lead strong,
.form-lead strong {
    color: var(--color-text);
    font-weight: 600;
}

.uk-form-lead a,
.form-lead a {
    color: var(--color-primary);
    text-decoration: none;
    border-bottom: 1px solid rgba(var(--color-primary-rgb), 0.4);
    transition: border-color 0.15s ease;
}

.uk-form-lead a:hover,
.form-lead a:hover,
.uk-form-lead a:focus-visible,
.form-lead a:focus-visible {
    border-bottom-color: var(--color-primary);
}

/* Compact variant — for the home-page tool tabs where 5 descriptions
   are toggled in the same vertical slot and the rest of the card is
   tight. Smaller font, muted instead of secondary. */
.uk-form-lead--compact,
.form-lead--compact {
    font-size: var(--font-sm);
    color: var(--color-text-muted);
}
