/* ═══════════════════════════════════════════════════════════
   ALERT PROMPTS + GUEST ALERT PAGE (fix #4, docs/BUYER_CONTACT_AND_TRAFFIC_FIXES_PLAN.md §5)
   views/partials/alertPromptResults.ejs   — the card at the top of filtered results / on "no results"
   views/partials/alertPromptListing.ejs   — the car page's "Alert me about similar cars" + "Watch the price"
   views/guestAlerts.ejs                   — /alerts/new, the guest form result, confirm and unsubscribe pages

   Dark mode (FEATURE_BUILD_STANDARD §6.1): the cards are WHITE SURFACES IN BOTH THEMES (like .sidebar-card and the
   filter sidebar, public/css/theme.css), so everything inside re-declares literal light colours — never theme tokens.
   Spacing: 16px inset, 12px text → control, 8px between controls, 4px label → field, rows wrap, 44px tap targets.
═══════════════════════════════════════════════════════════ */

.ap-card,
[data-theme="dark"] .ap-card {
    background: #ffffff;
    color: #0d1526;
    border: 1.5px solid #c7d2fe;
    border-left: 4px solid #1d4ed8;
    border-radius: 10px;
    padding: 16px;
    margin: 0 0 16px;
    box-sizing: border-box;
    max-width: 100%;
}
.ap-card--listing { margin: 16px 0 0; }
/* Since Nov 14 2026 the car page's prompt sits among the content sections (after the Description, above the payment
   calculator); the column's own 20px gap spaces it, like the cards around it. */
.listing-sections > .ap-card--listing { margin: 0; }

.ap-title {
    margin: 0 0 4px;
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.35;
    color: #0d1526;
}
.ap-text {
    margin: 0 0 12px;
    font-size: 0.92rem;
    line-height: 1.5;
    color: #374151;
}
.ap-summary {
    margin: 0 0 12px;
    font-size: 0.88rem;
    line-height: 1.45;
    color: #1e293b;
    background: #f1f5f9;
    border-radius: 6px;
    padding: 8px 10px;
    overflow-wrap: anywhere;
}
.ap-small {
    margin: 12px 0 0;
    font-size: 0.82rem;
    line-height: 1.45;
    color: #475569;
}
.ap-card a:not(.ap-btn) { color: #1d4ed8; text-decoration: underline; }
.ap-card a:not(.ap-btn):focus-visible,
.ap-btn:focus-visible,
.ap-input:focus-visible,
.ap-select:focus-visible { outline: 3px solid #93c5fd; outline-offset: 2px; }

/* One form row: email field + frequency + button; wraps instead of squeezing. */
.ap-form { margin: 0; }
.ap-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 8px;
}
.ap-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1 1 220px;
    min-width: 0;
}
.ap-field--narrow { flex: 0 1 170px; }
.ap-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: #1e293b;
    text-transform: none;
    letter-spacing: 0;
}
.ap-input,
.ap-select,
[data-theme="dark"] .ap-input,
[data-theme="dark"] .ap-select {
    min-height: 44px;
    width: 100%;
    box-sizing: border-box;
    padding: 10px 12px;
    font-size: 0.95rem;
    color: #0d1526;
    background: #ffffff;
    border: 1.5px solid #94a3b8;
    border-radius: 8px;
    color-scheme: light;
}
.ap-input::placeholder { color: #64748b; opacity: 1; }

.ap-btn,
[data-theme="dark"] .ap-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 10px 18px;
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.2;
    color: #ffffff;
    background: #1d4ed8;
    border: 1.5px solid #1d4ed8;
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none;
    box-sizing: border-box;
    white-space: nowrap;
}
.ap-btn:hover { background: #1e40af; border-color: #1e40af; color: #ffffff; }
.ap-btn--ghost,
[data-theme="dark"] .ap-btn--ghost {
    color: #1d4ed8;
    background: #ffffff;
    border-color: #1d4ed8;
}
.ap-btn--ghost:hover { background: #eff6ff; color: #1e40af; }
.ap-btn--danger,
[data-theme="dark"] .ap-btn--danger { background: #b91c1c; border-color: #b91c1c; color: #ffffff; }
.ap-btn--danger:hover { background: #991b1b; border-color: #991b1b; }
.ap-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0;
}

/* "Watch the price": the heart, in words. */
.ap-watch {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin: 12px 0 0;
    padding: 12px 0 0;
    border-top: 1px solid #e2e8f0;
    font-size: 0.88rem;
    line-height: 1.45;
    color: #374151;
}
.ap-watch-icon { flex: 0 0 auto; width: 18px; height: 18px; margin-top: 1px; }

@media (max-width: 680px) {
    .ap-field, .ap-field--narrow { flex: 1 1 100%; }
    .ap-btn { width: 100%; }
}

/* ── /alerts pages (views/guestAlerts.ejs) — page prefix ga- ── */
/* The page surface follows the theme (light grey / navy — public/css/theme.css tokens); the card on it stays white. */
.ga-page {
    /* The shared navbar is position: fixed, 80px tall (public/css/navbar.css) — clear it, as .admin-wrapper does. */
    margin-top: 80px;
    width: 100%;
    min-height: calc(100vh - 80px);
    background: var(--bg-page, #f4f4f4);
}
.ga-wrap {
    max-width: 720px;
    margin: 0 auto;
    padding: 32px 16px 48px;
    box-sizing: border-box;
}
.ga-wrap .ap-card { margin: 0; }
.ga-h1 {
    margin: 0 0 8px;
    font-size: 1.5rem;
    font-weight: 800;
    line-height: 1.3;
    color: #0d1526;
}
.ga-msg {
    margin: 0 0 12px;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 0.92rem;
    line-height: 1.45;
    color: #7f1d1d;
    background: #fef2f2;
    border: 1px solid #fecaca;
}
.ga-ok {
    color: #14532d;
    background: #f0fdf4;
    border-color: #bbf7d0;
}
