.epc-fmp-wrapper {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    max-width: 600px;
    margin: 1.5rem auto;
    padding: 1.5rem 1.75rem;
    border-radius: 0.75rem;
    background: #ffffff;
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.08);
    box-sizing: border-box;
}

/* Color themes via CSS variables */
.epc-fmp-wrapper {
    --epc-fmp-primary: #1d4ed8;
    --epc-fmp-primary-soft: rgba(37, 99, 235, 0.08);
    --epc-fmp-primary-border: rgba(37, 99, 235, 0.35);
    --epc-fmp-text: #0f172a;
    --epc-fmp-muted: #64748b;
}

/* Blue (default) */
.epc-fmp-theme-blue {
    --epc-fmp-primary: #1d4ed8;
    --epc-fmp-primary-soft: rgba(37, 99, 235, 0.08);
    --epc-fmp-primary-border: rgba(37, 99, 235, 0.35);
}

/* Green */
.epc-fmp-theme-green {
    --epc-fmp-primary: #15803d;
    --epc-fmp-primary-soft: rgba(22, 163, 74, 0.08);
    --epc-fmp-primary-border: rgba(22, 163, 74, 0.35);
}

/* Purple */
.epc-fmp-theme-purple {
    --epc-fmp-primary: #7c3aed;
    --epc-fmp-primary-soft: rgba(124, 58, 237, 0.08);
    --epc-fmp-primary-border: rgba(124, 58, 237, 0.35);
}

/* Orange */
.epc-fmp-theme-orange {
    --epc-fmp-primary: #ea580c;
    --epc-fmp-primary-soft: rgba(234, 88, 12, 0.08);
    --epc-fmp-primary-border: rgba(234, 88, 12, 0.35);
}

/* Dark */
.epc-fmp-theme-dark {
    --epc-fmp-primary: #0ea5e9;
    --epc-fmp-primary-soft: rgba(15, 23, 42, 0.75);
    --epc-fmp-primary-border: rgba(148, 163, 184, 0.5);
    background: #020617;
    color: #e5e7eb;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.75);
}

/* Typography */
.epc-fmp-label {
    display: block;
    font-weight: 600;
    color: var(--epc-fmp-text);
    margin-bottom: 0.4rem;
}

.epc-fmp-label-sub {
    font-weight: 400;
    color: var(--epc-fmp-muted);
    font-size: 0.9rem;
}

/* Form layout */
.epc-fmp-input-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    align-items: center;
}

.epc-fmp-input {
    flex: 1 1 260px;
    min-width: 0;
    padding: 0.7rem 0.9rem;
    font-size: 1rem;
    border-radius: 999px;
    border: 1px solid var(--epc-fmp-primary-border);
    background: #f8fafc;
    color: var(--epc-fmp-text);
    box-sizing: border-box;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
    height: auto !important;        /* override theme height */
    min-height: 40px !important;    /* normal field height */
    max-height: 48px !important;    /* prevents giant box */
    line-height: 1.2 !important;    /* keeps text centered vertically */
    padding: 0.6rem 0.9rem !important;
    white-space: nowrap !important; /* prevent wrapping into tall lines */
    overflow: hidden !important;    /* prevent accidental multi-line behavior */
    resize: none !important;        /* mobile safari trick */
    -webkit-line-clamp: 1;
    display: block;
}

.epc-fmp-input:focus {
    border-color: var(--epc-fmp-primary);
    background: #ffffff;
    box-shadow: 0 0 0 3px var(--epc-fmp-primary-soft);
}

.epc-fmp-button {
    flex: 0 0 auto;
    padding: 0.7rem 1.3rem;
    border-radius: 999px;
    border: none;
    font-weight: 600;
    font-size: 0.98rem;
    cursor: pointer;
    background: var(--epc-fmp-primary);
    color: #ffffff;
    white-space: nowrap;
    transition: transform 0.1s ease, box-shadow 0.1s ease, background 0.1s ease;
    box-shadow: 0 10px 20px rgba(15, 23, 42, 0.2);
}

.epc-fmp-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 26px rgba(15, 23, 42, 0.25);
    filter: brightness(1.03);
}

.epc-fmp-button:active {
    transform: translateY(0);
    box-shadow: 0 8px 16px rgba(15, 23, 42, 0.2);
}

/* Message area */
.epc-fmp-message {
    margin-top: 0.8rem;
    font-size: 0.95rem;
    color: var(--epc-fmp-muted);
}

/* Results */
.epc-fmp-results {
    margin-top: 1.4rem;
    padding-top: 1rem;
    border-top: 1px dashed rgba(148, 163, 184, 0.7);
}

.epc-fmp-results-title {
    margin: 0 0 0.4rem;
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--epc-fmp-text);
}

.epc-fmp-results-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.epc-fmp-results-list li {
    padding: 0.25rem 0;
    font-size: 0.98rem;
}

/* Responsive tweaks */
@media (max-width: 480px) {
    .epc-fmp-wrapper {
        margin: 1rem;
        padding: 1.1rem 1.1rem;
    }

    .epc-fmp-input-row {
        flex-direction: column;
        align-items: stretch;
    }

    .epc-fmp-input {
        border-radius: 6px !important;
        width: 100%;
        height: 44px !important;      /* iOS standard field height */
        max-height: 44px !important;
        font-size: 16px !important;   /* prevents iOS zoom-on-input */
    }

    .epc-fmp-button {
        width: 100%;
        text-align: center;
        justify-content: center;
    }
}


/* Optional Caucus Location block */
.epc-fmp-caucus {
  margin-top: 1em;
}
