/* ============================================================
   form-controls.css  -  Lawnovus dropdowns and file pickers
   Same file in every app's public/css (web, portal, control, content);
   a test keeps the copies identical.

   Every <select> and every visible file input gets the Lawnovus look
   with no per-field classes. They stay real form elements, so keyboard
   use, screen readers, validation and form state keep working.
   ============================================================ */

:root {
    --fc-brand:       #2d7a5a;  /* emerald: text on mint */
    --fc-brand-mid:   #4dbe7c;  /* project green (green-color-overrides) */
    --fc-brand-soft:  #e6f7f0;  /* mint-light */
    --fc-brand-hover: #d3f0e2;
    --fc-ink:         #0f1923;
    --fc-ink-muted:   #8a9aaa;
    --fc-line:        #e2e8ee;
}

/* ── DROPDOWNS (closed): the field with a soft chevron, in every browser ── */
select:not([multiple]):not([size]) {
    -webkit-appearance: none;
    appearance: none;
    padding-right: 2.25rem !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238a9aaa' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 0.7rem center !important;
    background-size: 1rem !important;
    cursor: pointer;
}
select:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

/* ── DROPDOWNS (open): a rounded, shadowed menu with a green tick ──
   Chrome and Edge 135+ (customisable select). Firefox and Safari keep
   their own list, still with the styled closed field above. */
@supports (appearance: base-select) {
    select:not([multiple]):not([size]),
    select:not([multiple]):not([size])::picker(select) {
        appearance: base-select;
    }
    select:not([multiple]):not([size])::picker-icon {
        display: none;
    }
    select:not([multiple]):not([size])::picker(select) {
        margin-top: 6px;
        padding: 6px;
        border: 1px solid var(--fc-line);
        border-radius: 14px;
        background: rgba(255, 255, 255, 0.97);
        backdrop-filter: saturate(180%) blur(16px);
        box-shadow: 0 24px 48px -16px rgba(15, 25, 35, 0.28), 0 2px 6px rgba(15, 25, 35, 0.06);
        max-height: 320px;
        opacity: 0;
        transform: translateY(-4px);
        transition: opacity 150ms ease, transform 150ms ease, overlay 150ms allow-discrete, display 150ms allow-discrete;
    }
    select:not([multiple]):not([size]):open::picker(select) {
        opacity: 1;
        transform: translateY(0);
    }
    @starting-style {
        select:not([multiple]):not([size]):open::picker(select) {
            opacity: 0;
            transform: translateY(-4px);
        }
    }
    select:not([multiple]):not([size]) option {
        display: flex;
        align-items: center;
        gap: 8px;
        padding: 8px 10px;
        border-radius: 9px;
        font-size: 0.875rem;
        color: var(--fc-ink);
        cursor: pointer;
        transition: background-color 120ms ease;
    }
    select:not([multiple]):not([size]) option:hover,
    select:not([multiple]):not([size]) option:focus-visible {
        background: var(--fc-brand-soft);
        outline: none;
    }
    select:not([multiple]):not([size]) option:checked {
        color: var(--fc-brand);
        font-weight: 600;
    }
    select:not([multiple]):not([size]) option::checkmark {
        order: 1;
        margin-left: auto;
        color: var(--fc-brand-mid);
    }
    select:not([multiple]):not([size]) option:disabled {
        color: var(--fc-ink-muted);
        cursor: not-allowed;
    }
}

@media (prefers-reduced-motion: reduce) {
    select::picker(select) { transition: none; }
}

/* ── FILE PICKERS: "Choose File" as a mint Lawnovus button ── */
input[type="file"] {
    font-size: 0.875rem;
    color: var(--fc-ink-muted);
    cursor: pointer;
}
input[type="file"]::file-selector-button {
    margin-right: 0.875rem;
    padding: 0.45rem 1rem;
    border: 1.5px solid #bfe8d2;
    border-radius: 10px;
    background: var(--fc-brand-soft);
    color: var(--fc-brand);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.18s, border-color 0.18s;
}
input[type="file"]:hover::file-selector-button {
    background: var(--fc-brand-hover);
    border-color: var(--fc-brand-mid);
}
input[type="file"]:focus-visible {
    outline: none;
}
input[type="file"]:focus-visible::file-selector-button {
    box-shadow: 0 0 0 3px rgba(77, 190, 124, 0.25);
}
input[type="file"]:disabled,
input[type="file"]:disabled::file-selector-button {
    cursor: not-allowed;
    opacity: 0.6;
}
