/* =====================================================================
   XpertMap — Design System
   Palette: Ink #0F1B3D · Brand #1E3A8A · Bright #2F5FD9 · Amber #F5A623
            Paper #F6F7FB · Slate #5B6479 · Line #E7EAF3
   Type: Sora (display) + Inter (body)
   ===================================================================== */

:root {
    --ink: #0F1B3D;
    --brand: #1E3A8A;
    --brand-bright: #2F5FD9;
    --brand-soft: #EAEFFC;
    --amber: #F5A623;
    --amber-soft: #FFF3DF;
    --paper: #F6F7FB;
    --surface: #FFFFFF;
    --slate: #5B6479;
    --slate-light: #8891A6;
    --line: #E7EAF3;
    --success: #16A34A;
    --success-soft: #E7F8EE;
    --danger: #DC2626;
    --danger-soft: #FDEAEA;
    --radius-sm: 10px;
    --radius: 16px;
    --radius-lg: 24px;
    --shadow-sm: 0 2px 8px rgba(15, 27, 61, 0.06);
    --shadow: 0 8px 24px rgba(15, 27, 61, 0.08);
    --shadow-lg: 0 20px 48px rgba(15, 27, 61, 0.14);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--paper);
    color: var(--ink);
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6, .font-display {
    font-family: 'Sora', sans-serif;
    color: var(--ink);
    letter-spacing: -0.01em;
}

a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-bright); }

.text-slate { color: var(--slate) !important; }
.text-brand { color: var(--brand) !important; }
.bg-paper { background: var(--paper) !important; }

::selection { background: var(--amber-soft); color: var(--ink); }

/* Skip to content (accessibility) */
.skip-link {
    position: absolute; left: -999px; top: 0; z-index: 2000;
    background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

/* Focus visibility */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
    outline: 3px solid var(--amber);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
}

/* =====================================================================
   Buttons
   ===================================================================== */

.btn { font-weight: 600; letter-spacing: 0.01em; border-radius: var(--radius-sm); padding: 0.6rem 1.25rem; transition: transform .15s ease, box-shadow .15s ease, background-color .15s ease, color .15s ease; }
.btn:active { transform: translateY(1px); }
.btn-primary { background-color: var(--brand); border-color: var(--brand); }
.btn-primary:hover, .btn-primary:focus { background-color: var(--brand-bright); border-color: var(--brand-bright); box-shadow: 0 8px 20px rgba(47,95,217,0.28); }
.btn-outline-primary { color: var(--brand); border-color: var(--brand); }
.btn-outline-primary:hover { background-color: var(--brand); border-color: var(--brand); }
.btn-amber { background-color: var(--amber); border-color: var(--amber); color: var(--ink); }
.btn-amber:hover { background-color: #e6960f; border-color: #e6960f; color: var(--ink); }
.btn-rounded, .rounded-pill.btn { border-radius: 50rem; }
.btn-lg { padding: 0.85rem 1.75rem; }
.btn-sm { padding: 0.35rem 0.9rem; font-size: 0.82rem; }
.btn-soft-primary { background: var(--brand-soft); color: var(--brand); border: 1px solid transparent; }
.btn-soft-primary:hover { background: var(--brand); color: #fff; }
.btn-ghost-light { background: rgba(255,255,255,0.12); color: #fff; border: 1px solid rgba(255,255,255,0.35); }
.btn-ghost-light:hover { background: rgba(255,255,255,0.22); color: #fff; }

/* =====================================================================
   Navbar
   ===================================================================== */

.xm-navbar { background: rgba(255,255,255,0.92); backdrop-filter: saturate(180%) blur(12px); border-bottom: 1px solid var(--line); z-index: 1030; }
.xm-navbar .navbar-brand { font-family: 'Sora', sans-serif; font-weight: 700; font-size: 1.5rem; color: var(--ink); display: flex; align-items: center; gap: 8px; }
.xm-navbar .navbar-brand .pin-mark { color: var(--amber); }
.xm-navbar .nav-link { font-weight: 500; color: var(--slate); padding: 0.5rem 0.9rem !important; border-radius: 50rem; transition: all .15s ease; }
.xm-navbar .nav-link:hover, .xm-navbar .nav-link.active { color: var(--brand); background: var(--brand-soft); }
.xm-navbar .navbar-toggler { border: none; box-shadow: none !important; }

/* =====================================================================
   Hero
   ===================================================================== */

.xm-hero {
    position: relative;
    background: radial-gradient(120% 140% at 15% 10%, #2650b8 0%, var(--ink) 62%);
    color: #fff;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    overflow: hidden;
    padding: 4.5rem 0 5rem;
}
.xm-hero .hero-dotgrid {
    position: absolute; inset: 0; opacity: 0.5; pointer-events: none;
    background-image: radial-gradient(rgba(255,255,255,0.18) 1.4px, transparent 1.4px);
    background-size: 22px 22px;
    mask-image: radial-gradient(ellipse 80% 80% at 70% 30%, black 30%, transparent 75%);
}
.xm-hero .hero-eyebrow {
    display: inline-flex; align-items: center; gap: 8px;
    background: rgba(245,166,35,0.16); color: var(--amber);
    border: 1px solid rgba(245,166,35,0.35);
    padding: 0.35rem 0.9rem; border-radius: 50rem; font-size: 0.8rem; font-weight: 600;
    letter-spacing: 0.03em; text-transform: uppercase;
}
.xm-hero h1 { font-size: clamp(1.9rem, 4vw, 3rem); line-height: 1.12; font-weight: 700; }
.xm-hero .lead { color: rgba(255,255,255,0.8); font-size: 1.1rem; }
.xm-search-card { background: #fff; border-radius: 50rem; padding: 8px; box-shadow: var(--shadow-lg); }
.xm-search-card input { border: 0; }
.xm-search-card select { border: 0; border-left: 1px solid var(--line); border-radius: 0; }
.xm-search-card input:focus, .xm-search-card select:focus { box-shadow: none; }
.hero-stats { display: flex; gap: 1.75rem; flex-wrap: wrap; margin-top: 2.25rem; }
.hero-stats .stat b { font-family: 'Sora', sans-serif; font-size: 1.5rem; display: block; }
.hero-stats .stat span { color: rgba(255,255,255,0.65); font-size: 0.82rem; }

.hero-map-art { position: relative; height: 100%; min-height: 320px; }

/* =====================================================================
   Category chips / cards
   ===================================================================== */

.cat-card {
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 1.5rem 1rem; text-align: center; height: 100%;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.cat-card:hover { transform: translateY(-5px); box-shadow: var(--shadow); border-color: transparent; }
.cat-card .cat-icon {
    width: 52px; height: 52px; border-radius: 14px; display: flex; align-items: center; justify-content: center;
    margin: 0 auto 0.75rem; font-size: 1.4rem;
}
.cat-card p { color: var(--ink); }

/* Rotating accent palette for category icons / card left-borders */
.accent-0 { background: var(--brand-soft); color: var(--brand); }
.accent-1 { background: var(--amber-soft); color: #b3760f; }
.accent-2 { background: var(--success-soft); color: var(--success); }
.accent-3 { background: #F3E8FF; color: #7C3AED; }
.accent-4 { background: #E0F7FA; color: #0891B2; }
.accent-border-0 { border-left: 4px solid var(--brand); }
.accent-border-1 { border-left: 4px solid var(--amber); }
.accent-border-2 { border-left: 4px solid var(--success); }
.accent-border-3 { border-left: 4px solid #7C3AED; }
.accent-border-4 { border-left: 4px solid #0891B2; }

/* =====================================================================
   Business card
   ===================================================================== */

.biz-card {
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
    height: 100%; overflow: hidden; transition: transform .18s ease, box-shadow .18s ease;
    position: relative;
}
.biz-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }

/* Logo avatar — unscoped so it sizes correctly wherever it's used
   (business cards, business.php hero, admin thumbs, etc), not just inside .biz-card */
.biz-logo-wrap {
    width: 56px; height: 56px; border-radius: 14px; overflow: hidden; flex-shrink: 0;
    background: var(--brand-soft); display: flex; align-items: center; justify-content: center;
}
.biz-logo-wrap img { display: block; width: 100%; height: 100%; object-fit: cover; }
.biz-logo-wrap .initials { font-family: 'Sora', sans-serif; font-weight: 700; color: var(--brand); }
.biz-card h5 { font-size: 1.05rem; font-weight: 700; margin-bottom: 2px; }
.biz-card .biz-tagline { color: var(--slate); font-size: 0.85rem; }
.biz-card .card-body { padding: 1.25rem; }
.featured-ribbon {
    position: absolute; top: 14px; right: -34px; transform: rotate(40deg);
    background: var(--amber); color: var(--ink); font-size: 0.68rem; font-weight: 700;
    padding: 3px 38px; letter-spacing: 0.04em; text-transform: uppercase; box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}
.badge-cat { background: var(--brand-soft); color: var(--brand); font-weight: 600; font-size: 0.72rem; padding: 0.35em 0.7em; border-radius: 50rem; }
.badge-status-pending { background: var(--amber-soft); color: #a2670a; }
.badge-status-approved { background: var(--success-soft); color: var(--success); }
.badge-status-rejected { background: var(--danger-soft); color: var(--danger); }
.open-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 5px; }
.open-dot.is-open { background: var(--success); }
.open-dot.is-closed { background: var(--danger); }

/* =====================================================================
   Sections / containers
   ===================================================================== */

.section-pad { padding: 3.5rem 0; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 1.75rem; flex-wrap: wrap; gap: 0.75rem; }
.section-head .eyebrow { color: var(--brand); font-weight: 700; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; }
.xm-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.xm-card-pad { padding: 2rem; }
@media (max-width: 576px) { .xm-card-pad { padding: 1.25rem; } }

/* Sticky filter sidebar */
.filter-panel { position: sticky; top: 92px; }

/* Forms */
.form-label { font-weight: 600; font-size: 0.88rem; color: var(--ink); }
.form-control, .form-select {
    border-radius: var(--radius-sm); border-color: var(--line); padding: 0.65rem 0.9rem;
}
.form-control:focus, .form-select:focus { border-color: var(--brand-bright); box-shadow: 0 0 0 4px rgba(47,95,217,0.12); }
.form-section-title { font-family: 'Sora', sans-serif; font-weight: 700; font-size: 1rem; color: var(--brand); margin: 1.75rem 0 0.75rem; padding-bottom: 0.5rem; border-bottom: 1px solid var(--line); }
.form-section-title:first-child { margin-top: 0; }
.otp-input { letter-spacing: 10px; font-size: 1.6rem; font-weight: 700; text-align: center; }

/* Alerts */
.alert-xm { border: 1px solid transparent; border-radius: var(--radius-sm); font-size: 0.92rem; }
.alert-xm.alert-success { background: var(--success-soft); color: #146c37; border-color: #bfe9cf; }
.alert-xm.alert-danger { background: var(--danger-soft); color: #a11f1f; border-color: #f3c6c6; }
.alert-xm.alert-warning { background: var(--amber-soft); color: #8a5c09; border-color: #f2dba8; }
.alert-xm.alert-info { background: var(--brand-soft); color: var(--brand); border-color: #cdd8f5; }

/* Pagination */
.xm-pagination .page-link { border: none; color: var(--slate); border-radius: 50rem; margin: 0 3px; font-weight: 600; }
.xm-pagination .page-item.active .page-link { background: var(--brand); color: #fff; }
.xm-pagination .page-item.disabled .page-link { color: var(--slate-light); background: transparent; }

/* Auth split screens */
.auth-wrap { min-height: calc(100vh - 88px); display: flex; align-items: center; }
.auth-side {
    background: radial-gradient(120% 140% at 20% 10%, #2650b8 0%, var(--ink) 65%);
    border-radius: var(--radius-lg); color: #fff; padding: 3rem; height: 100%;
    display: flex; flex-direction: column; justify-content: center; position: relative; overflow: hidden;
}
.auth-side .hero-dotgrid { position: absolute; inset: 0; opacity: 0.4;
    background-image: radial-gradient(rgba(255,255,255,0.18) 1.4px, transparent 1.4px); background-size: 22px 22px; }

/* Empty states */
.empty-state { text-align: center; padding: 3.5rem 1.5rem; }
.empty-state .icon-wrap {
    width: 84px; height: 84px; border-radius: 50%; background: var(--brand-soft); color: var(--brand);
    display: flex; align-items: center; justify-content: center; font-size: 2rem; margin: 0 auto 1.25rem;
}

/* Stat tile (dashboards) */
.stat-tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.35rem; display: flex; align-items: center; gap: 1rem; }
.stat-tile .stat-icon { width: 50px; height: 50px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 1.3rem; flex-shrink: 0; }
.stat-tile b { font-family: 'Sora', sans-serif; font-size: 1.5rem; display: block; line-height: 1.1; }
.stat-tile span { color: var(--slate); font-size: 0.82rem; }

/* Gallery lightbox thumbs */
.gallery-thumb { border-radius: 12px; overflow: hidden; aspect-ratio: 4/3; cursor: pointer; border: 1px solid var(--line); }
.gallery-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s ease; }
.gallery-thumb:hover img { transform: scale(1.06); }

/* Footer */
.xm-footer { background: var(--ink); color: rgba(255,255,255,0.7); }
.xm-footer h5, .xm-footer h6 { color: #fff; }
.xm-footer a { color: rgba(255,255,255,0.65); }
.xm-footer a:hover { color: var(--amber); }
.xm-footer .social-dot { width: 38px; height: 38px; border-radius: 50%; background: rgba(255,255,255,0.08); display: inline-flex; align-items: center; justify-content: center; transition: background .15s ease; }
.xm-footer .social-dot:hover { background: var(--amber); color: var(--ink); }

/* Utility */
.text-truncate-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.text-truncate-3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.shadow-hover { transition: box-shadow .18s ease, transform .18s ease; }
.shadow-hover:hover { box-shadow: var(--shadow); transform: translateY(-2px); }

/* =====================================================================
   Responsive tweaks
   ===================================================================== */

@media (max-width: 991.98px) {
    .filter-panel { position: static; margin-bottom: 1.5rem; }
}
@media (max-width: 767.98px) {
    .xm-hero { padding: 3rem 0 3.5rem; border-radius: 0 0 20px 20px; }
    .xm-search-card { border-radius: var(--radius); }
    .xm-search-card form { flex-direction: column; }
    .xm-search-card select { border-left: 0; border-top: 1px solid var(--line); }
    .section-pad { padding: 2.25rem 0; }
    .auth-side { display: none; }
    .hero-stats { gap: 1.1rem; }
    .hero-stats .stat b { font-size: 1.2rem; }
}
@media (max-width: 575.98px) {
    .xm-card-pad { padding: 1.1rem; }
    .featured-ribbon { right: -40px; top: 12px; font-size: 0.6rem; padding: 3px 42px; }
}