/* Branch Locator — public page. Matches the app's Discoveryland palette
   (forest green + logo orange, Plus Jakarta Sans). */
:root {
    --bl-green-dark: #132418;
    --bl-green: #1e3827;
    --bl-green-text: #1a7a4a;
    --bl-green-soft: #eaf5ee;
    --bl-orange: #e88323;
    --bl-orange-hover: #d1721b;
    --bl-orange-soft: #fff3e6;
    --bl-ink: #1f2430;
    --bl-muted: #6b7280;
    --bl-border: #e3e8e4;
    --bl-bg: #f5f8f6;
    --bl-card: #ffffff;
    --bl-blue: #1d4ed8;
}

* { box-sizing: border-box; }

body.bl-body {
    margin: 0;
    font-family: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
    color: var(--bl-ink);
    background: var(--bl-bg);
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ── Top bar ── */
.bl-topbar {
    background: var(--bl-green-dark);
    color: #fff;
}
.bl-topbar-inner {
    max-width: 1180px;
    margin: 0 auto;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}
.bl-brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: #fff; }
.bl-brand img { height: 38px; width: auto; background: #fff; border-radius: 8px; padding: 3px; }
.bl-brand-name { font-weight: 800; font-size: 1rem; line-height: 1.1; }
.bl-brand-sub { font-size: 0.72rem; color: #a8bfae; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.bl-site-link { color: #a8bfae; font-size: 0.85rem; text-decoration: none; font-weight: 600; }
.bl-site-link:hover { color: #fff; }

/* ── Hero ── */
.bl-hero {
    background: linear-gradient(135deg, var(--bl-green-dark) 0%, var(--bl-green) 60%, #2a5238 100%);
    color: #fff;
    padding: 44px 20px 92px;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.bl-hero::before, .bl-hero::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    background: rgba(232, 131, 35, 0.12);
}
.bl-hero::before { width: 320px; height: 320px; right: -80px; top: -120px; }
.bl-hero::after  { width: 220px; height: 220px; left: -60px; bottom: -110px; background: rgba(51, 145, 70, 0.18); }
.bl-hero-inner { position: relative; max-width: 720px; margin: 0 auto; z-index: 1; }
.bl-eyebrow {
    display: inline-flex; align-items: center; gap: 6px;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.18);
    padding: 5px 14px; border-radius: 999px;
    font-size: 0.75rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
    color: #ffd9b0;
    margin-bottom: 16px;
}
.bl-hero h1 { margin: 0 0 12px; font-size: clamp(1.7rem, 4vw, 2.5rem); font-weight: 800; line-height: 1.2; }
.bl-hero h1 span { color: var(--bl-orange); }
.bl-hero p { margin: 0 auto; max-width: 540px; color: #cfe0d4; font-size: 1rem; line-height: 1.6; }

/* ── Search card ── */
.bl-wrap { max-width: 1180px; width: 100%; margin: 0 auto; padding: 0 20px 48px; flex: 1 0 auto; }
.bl-search {
    background: var(--bl-card);
    border: 1px solid var(--bl-border);
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(19, 36, 24, 0.12);
    padding: 20px;
    margin-top: -56px;
    position: relative;
    z-index: 2;
}
.bl-label { font-size: 0.72rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--bl-muted); margin-bottom: 8px; }
.bl-search-row { display: flex; gap: 10px; flex-wrap: wrap; }
.bl-input-wrap { position: relative; flex: 1 1 320px; }
.bl-input-wrap i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--bl-muted); font-size: 1.05rem; }
.bl-input-wrap input {
    width: 100%;
    height: 48px;
    padding: 0 14px 0 42px;
    border: 1.5px solid var(--bl-border);
    border-radius: 10px;
    font: inherit;
    font-size: 0.95rem;
    color: var(--bl-ink);
    background: #fff;
    outline: none;
    transition: border-color .15s, box-shadow .15s;
}
.bl-input-wrap input:focus { border-color: var(--bl-orange); box-shadow: 0 0 0 3px rgba(232,131,35,.18); }
.bl-btn {
    height: 48px;
    padding: 0 20px;
    border-radius: 10px;
    border: 1.5px solid transparent;
    font: inherit;
    font-weight: 700;
    font-size: 0.92rem;
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    cursor: pointer;
    transition: background .15s, border-color .15s, color .15s, transform .05s;
    white-space: nowrap;
}
.bl-btn:active { transform: translateY(1px); }
.bl-btn-primary { background: var(--bl-orange); color: #fff; }
.bl-btn-primary:hover { background: var(--bl-orange-hover); }
.bl-btn-outline { background: #fff; color: var(--bl-green-text); border-color: var(--bl-green-text); }
.bl-btn-outline:hover { background: var(--bl-green-soft); }

#loading { display: none; margin-top: 14px; font-size: 0.88rem; color: var(--bl-muted); align-items: center; gap: 10px; }
.bl-spinner { width: 18px; height: 18px; border: 2.5px solid var(--bl-border); border-top-color: var(--bl-orange); border-radius: 50%; animation: bl-spin .7s linear infinite; }
@keyframes bl-spin { to { transform: rotate(360deg); } }
#errorMsg {
    display: none; margin-top: 14px;
    background: #fef2f2; border: 1px solid #fecaca; color: #b91c1c;
    padding: 10px 14px; border-radius: 10px; font-size: 0.88rem; font-weight: 600;
}

/* ── Results layout ── */
.bl-results {
    display: grid;
    grid-template-columns: minmax(320px, 440px) 1fr;
    gap: 20px;
    margin-top: 24px;
    align-items: start;
}
.bl-list-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 12px; }
.bl-list-title { font-weight: 800; font-size: 1.05rem; }
.bl-list-count { font-size: 0.8rem; color: var(--bl-muted); font-weight: 600; }
.bl-list { display: flex; flex-direction: column; gap: 10px; max-height: 640px; overflow-y: auto; padding-right: 4px; }

.bl-card {
    background: var(--bl-card);
    border: 1.5px solid var(--bl-border);
    border-radius: 14px;
    padding: 14px 16px;
    display: flex;
    gap: 14px;
    cursor: pointer;
    transition: border-color .15s, box-shadow .15s, transform .1s;
}
.bl-card:hover { border-color: var(--bl-green-text); box-shadow: 0 6px 18px rgba(19,36,24,.08); }
.bl-card.is-active { border-color: var(--bl-orange); box-shadow: 0 0 0 3px rgba(232,131,35,.15); }
.bl-card.is-nearest { background: linear-gradient(0deg, #fff, var(--bl-orange-soft)); border-color: #f5c898; }
.bl-rank {
    flex: 0 0 34px; height: 34px; border-radius: 50%;
    background: var(--bl-green-soft); color: var(--bl-green-text);
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 0.9rem;
}
.is-nearest .bl-rank { background: var(--bl-orange); color: #fff; }
.bl-pin-ico { flex: 0 0 34px; height: 34px; border-radius: 10px; background: var(--bl-green-soft); color: var(--bl-green-text); display: flex; align-items: center; justify-content: center; font-size: 1.05rem; }
.bl-card-body { flex: 1; min-width: 0; }
.bl-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.bl-name { font-weight: 800; font-size: 0.98rem; line-height: 1.3; }
.bl-tag { display: inline-block; margin-top: 4px; background: var(--bl-orange); color: #fff; font-size: 0.66rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; padding: 2px 8px; border-radius: 999px; }
.bl-dist { flex: 0 0 auto; background: var(--bl-green-soft); color: var(--bl-green-text); font-weight: 800; font-size: 0.8rem; padding: 4px 10px; border-radius: 999px; white-space: nowrap; }
.is-nearest .bl-dist { background: #fde3c4; color: #92400e; }
.bl-addr { color: var(--bl-muted); font-size: 0.83rem; line-height: 1.5; margin-top: 4px; }
.bl-actions { margin-top: 10px; }
.bl-dir {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 0.8rem; font-weight: 700; color: var(--bl-green-text);
    text-decoration: none; padding: 5px 12px; border: 1.5px solid #cfe3d6; border-radius: 8px;
}
.bl-dir:hover { background: var(--bl-green-soft); border-color: var(--bl-green-text); }

/* ── Map ── */
.bl-map-card {
    background: var(--bl-card);
    border: 1px solid var(--bl-border);
    border-radius: 16px;
    overflow: hidden;
    position: sticky;
    top: 16px;
    box-shadow: 0 4px 16px rgba(19,36,24,.06);
}
#map { width: 100%; height: 640px; background: #e5ece7; }
.bl-legend { display: flex; flex-wrap: wrap; gap: 14px; padding: 10px 16px; border-top: 1px solid var(--bl-border); font-size: 0.75rem; color: var(--bl-muted); font-weight: 600; }
.bl-legend span { display: inline-flex; align-items: center; gap: 6px; }
.bl-legend-pin { color: var(--bl-blue); font-size: 1rem; line-height: 1; }
.bl-legend-logo { width: 18px; height: 18px; object-fit: contain; }
.bl-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }

/* ── Footer ── */
.bl-footer { flex-shrink: 0; text-align: center; color: var(--bl-muted); font-size: 0.8rem; padding: 20px; border-top: 1px solid var(--bl-border); background: #fff; }
.bl-footer a { color: var(--bl-green-text); text-decoration: none; font-weight: 700; }

/* ── Responsive ── */
@media (max-width: 900px) {
    .bl-results { grid-template-columns: 1fr; }
    .bl-map-card { position: static; order: -1; }
    #map { height: 340px; }
    .bl-list { max-height: none; }
    .bl-btn { flex: 1 1 100%; }
    .bl-hero { padding-bottom: 80px; }
}

/* ── Visitor gate ── */
.bl-gate-note { margin: -2px 0 14px; color: var(--bl-muted); font-size: 0.9rem; }
.bl-gate-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.bl-field-label { display: block; font-size: 0.78rem; font-weight: 700; color: var(--bl-ink); margin-bottom: 6px; }
.bl-field {
    width: 100%; height: 46px; padding: 0 14px;
    border: 1.5px solid var(--bl-border); border-radius: 10px;
    font: inherit; font-size: 0.93rem; color: var(--bl-ink); background: #fff; outline: none;
    transition: border-color .15s, box-shadow .15s;
}
.bl-field:focus { border-color: var(--bl-orange); box-shadow: 0 0 0 3px rgba(232,131,35,.18); }
.bl-field-err { color: #b91c1c; font-size: 0.78rem; font-weight: 600; min-height: 0; margin-top: 4px; }
.bl-field-err:empty { display: none; }
.bl-gate-submit { margin-top: 16px; }
.bl-field-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ── Visitor popup ── */
.bl-modal-backdrop {
    position: fixed; inset: 0; z-index: 1000;
    background: rgba(19, 36, 24, 0.55);
    backdrop-filter: blur(2px);
    align-items: center; justify-content: center;
    padding: 16px;
    overflow-y: auto;
}
.bl-modal {
    position: relative;
    width: 100%; max-width: 520px;
    background: #fff; border-radius: 18px;
    padding: 28px 26px 24px;
    box-shadow: 0 24px 60px rgba(0,0,0,.3);
    animation: bl-pop .18s ease-out;
    margin: auto;
}
@keyframes bl-pop { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
.bl-modal-close {
    position: absolute; top: 12px; right: 12px;
    width: 34px; height: 34px; border-radius: 50%;
    border: none; background: var(--bl-bg); color: var(--bl-muted);
    cursor: pointer; font-size: 0.95rem;
}
.bl-modal-close:hover { background: var(--bl-border); color: var(--bl-ink); }
.bl-modal-icon {
    width: 46px; height: 46px; border-radius: 14px;
    background: var(--bl-orange-soft); color: var(--bl-orange);
    display: flex; align-items: center; justify-content: center; font-size: 1.3rem;
    margin-bottom: 12px;
}
.bl-modal-title { margin: 0 0 6px; font-size: 1.25rem; font-weight: 800; }
.bl-modal .bl-gate-grid { grid-template-columns: 1fr; }
.bl-modal .bl-gate-submit { width: 100%; }
@media (max-width: 560px) { .bl-modal { padding: 24px 18px 20px; } }

/* Security check — same look as the login form's captcha */
.bl-captcha {
    display: flex; align-items: center; gap: 14px;
    height: 46px; padding: 0 14px;
    border: 1.5px solid var(--bl-border); border-radius: 10px;
    background: #fff;
    transition: border-color .15s, box-shadow .15s;
}
.bl-captcha:focus-within { border-color: var(--bl-orange); box-shadow: 0 0 0 3px rgba(232,131,35,.18); }
.bl-captcha-q { font-weight: 800; font-size: 1.05rem; color: var(--bl-green-text); white-space: nowrap; }
.bl-captcha input {
    flex: 1; min-width: 0; height: 100%;
    border: none; outline: none; background: transparent;
    font: inherit; font-size: 0.95rem; color: var(--bl-ink);
}
.bl-captcha input::placeholder { color: #9ca3af; font-weight: 700; }

.bl-field.is-invalid, .bl-captcha.is-invalid { border-color: #dc2626; }
.bl-field.is-invalid:focus, .bl-captcha.is-invalid:focus-within { box-shadow: 0 0 0 3px rgba(220,38,38,.15); }

.bl-modal-sm { max-width: 400px; }
.bl-limit-note { margin-top: 10px; font-size: 0.78rem; color: var(--bl-muted); font-weight: 600; }
.bl-limit-note:empty { display: none; }
.bl-credit { margin-top: 6px; font-size: 0.78rem; }

/* Nearest-branch marker bounce (replaces the classic Marker Animation.BOUNCE,
   which AdvancedMarkerElement doesn't support) */
@keyframes bl-marker-bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-14px); }
}
.bl-marker-bounce { animation: bl-marker-bounce 0.7s ease-in-out 4; }
