:root {
    --aini-ink: #06392F;
    --aini-accent: #E8A33D;
    --aini-neon: #2EE6A6;
    --aini-sage: #6E8D7B;
    --aini-muted: #44675A;
    --aini-neutral: #5B7E73;
    --aini-cream: #f8f4e8;

    --aini-glass: rgba(16, 26, 23, 0.72);
    --aini-glass-strong: rgba(11, 19, 17, 0.88);
    --aini-glass-border: rgba(255, 255, 255, 0.08);

    --aini-backdrop:
        radial-gradient(1000px 700px at 15% -8%, rgba(46, 230, 166, 0.16) 0%, rgba(46, 230, 166, 0) 55%),
        radial-gradient(900px 800px at 100% 12%, rgba(139, 124, 246, 0.12) 0%, rgba(139, 124, 246, 0) 55%),
        radial-gradient(1100px 900px at 50% 118%, rgba(0, 0, 0, 0.65) 0%, rgba(0, 0, 0, 0) 60%),
        linear-gradient(165deg, #060b09 0%, #0a1512 32%, #0d1a16 62%, #0f211b 100%);

    /* Compatibility aliases used by existing dashboard templates */
    --primary: var(--aini-neon);
    --navy: var(--aini-ink);
    --navy-dark: #031510;
    --blue: #38BDF8;
    --amber: var(--aini-accent);
    --amber-dark: #B87F1E;
    --success: var(--aini-neon);
    --danger: #FF5C5C;
    --warning: #F2C14E;
    --purple: #8B7CF6;

    --bg-page: #0d1714;
    --bg-surface: #121d19;
    --border: #21322b;
    --text-primary: #EAF2EE;
    --text-muted: #93AEA1;
    --text-light: #6D8D7F;

    --font-display: Georgia, "Times New Roman", serif;
    --font-body: "Plus Jakarta Sans", "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;

    --font-size-base: 17px;
    --font-size-sm: 15px;
    --line-height-base: 1.58;

    --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.4), 0 1px 1px rgba(0, 0, 0, 0.3);
    --shadow-hover: 0 16px 32px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(46, 230, 166, 0.1);
    --shadow-panel: 0 20px 48px rgba(0, 0, 0, 0.55);
    --shadow-sidebar: 2px 0 20px rgba(0, 0, 0, 0.5);
    --glass-blur: 0px;
    --glass-radius: 14px;
    --focus-ring: #e5c158;
    --focus-ring-soft: rgba(229, 193, 88, 0.28);
}

/* Optional light variant, reachable via the in-app theme toggle */
[data-theme="light"] {
    --aini-glass: rgba(255, 250, 241, 0.86);
    --aini-glass-strong: rgba(255, 250, 241, 0.92);
    --aini-glass-border: rgba(255, 250, 241, 0.6);
    --aini-backdrop:
        radial-gradient(1100px 720px at 12% -8%, rgba(213, 161, 29, 0.22) 0%, rgba(213, 161, 29, 0) 58%),
        radial-gradient(900px 900px at 92% 8%, rgba(110, 141, 123, 0.28) 0%, rgba(110, 141, 123, 0) 55%),
        radial-gradient(1200px 1000px at 50% 115%, rgba(2, 20, 16, 0.55) 0%, rgba(2, 20, 16, 0) 60%),
        linear-gradient(160deg, #041d17 0%, #06392F 32%, #135347 60%, #1E5649 82%, #2E6858 100%);

    --primary: var(--aini-ink);
    --blue: #1A6A5C;
    --amber-dark: #9E7512;
    --success: #2E8A68;
    --danger: #A44A38;
    --warning: #C99528;
    --purple: #3C7B6C;

    --bg-page: #eef0e7;
    --bg-surface: #ffffff;
    --border: #d2d8cd;
    --text-primary: #072F27;
    --text-muted: #244C40;
    --text-light: #3A6257;

    --shadow-card: 0 1px 3px 0 rgba(16, 56, 58, 0.09), 0 1px 2px -1px rgba(16, 56, 58, 0.06);
    --shadow-hover: 0 12px 24px rgba(16, 56, 58, 0.15);
    --shadow-panel: 0 16px 40px rgba(16, 56, 58, 0.2);
    --shadow-sidebar: 2px 0 12px rgba(16, 56, 58, 0.15);
    --focus-ring: #0f7662;
    --focus-ring-soft: rgba(15, 118, 98, 0.28);
}

/* ==========================================================================
   AiniSpace PUBLIC MARKETING SITE — Figma-matched brand tokens.
   Scoped to `body.aini-public` (set only in templates/base.html, the public
   layout) so the internal dashboard/portal app — which shares this same
   stylesheet and the `.aini-shell` class but never carries `.aini-public` —
   keeps its existing dark-teal/glass appearance untouched.
   ========================================================================== */
body.aini-public {
    --aini-ink: #07080a;
    --aini-accent: #e5c158;
    --aini-accent-dark: #c7a23f;
    --aini-neon: #10b981;
    --aini-sage: #88909a;
    --aini-muted: #6b7078;
    --aini-neutral: #88909a;
    --aini-cream: #d4d9e2;

    /* Flat, thin-bordered surfaces — the Figma cards are NOT blurred glass */
    --aini-card-bg: #161a20;
    --aini-card-bg-soft: #121418;
    --aini-glass: #161a20;
    --aini-glass-strong: #121418;
    --aini-glass-border: rgba(255, 255, 255, 0.08);

    --aini-backdrop: #07080a;

    --primary: var(--aini-accent);
    --navy: var(--aini-ink);
    --navy-dark: #000000;
    --amber: var(--aini-accent);
    --amber-dark: var(--aini-accent-dark);
    --success: var(--aini-neon);

    --bg-page: #07080a;
    --bg-surface: #161a20;
    --border: rgba(255, 255, 255, 0.08);
    --text-primary: #ffffff;
    --text-muted: #88909a;
    --text-light: #6b7078;

    --font-display: "Cormorant Garamond", Georgia, "Times New Roman", serif;
    --font-body: "Geist", "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
    --font-size-base: 16px;
    --line-height-base: 1.6;

    --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.4), 0 1px 1px rgba(0, 0, 0, 0.3);
    --shadow-hover: 0 16px 32px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(229, 193, 88, 0.12);
    --shadow-panel: 0 12px 32px rgba(0, 0, 0, 0.45);
    --glass-blur: 0px;
    --glass-radius: 14px;
    --focus-ring: #e5c158;
    --focus-ring-soft: rgba(229, 193, 88, 0.28);

    background: var(--bg-page);
    font-family: var(--font-body);
}

body.aini-public h1,
body.aini-public h2,
body.aini-public h3 {
    font-family: var(--font-display);
    font-weight: 400;
    letter-spacing: -0.01em;
}

/* Small uppercase tracked "— LABEL" eyebrow used above every section heading */
body.aini-public .aini-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-body);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--aini-accent);
    margin-bottom: 14px;
}

body.aini-public .aini-eyebrow::before {
    content: "";
    display: inline-block;
    width: 22px;
    height: 1px;
    background: var(--aini-accent);
}

body.aini-public .aini-section-title {
    font-family: var(--font-display);
    font-weight: 400;
    color: #ffffff;
    line-height: 1.15;
}

/* Flat, thin-bordered card — replaces the old neumorphic/glass-blur surfaces */
body.aini-public .aini-card {
    background: var(--aini-card-bg);
    border: 1px solid var(--aini-glass-border);
    border-radius: var(--glass-radius);
    box-shadow: var(--shadow-card);
}

body.aini-public .aini-card--popular {
    border-color: var(--aini-accent);
    box-shadow: 0 0 0 1px var(--aini-accent), var(--shadow-hover);
}

/* Pill buttons */
body.aini-public .btn-aini-primary,
body.aini-public .btn-aini-accent {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 26px;
    border-radius: 999px;
    background: var(--aini-accent);
    border: 1px solid var(--aini-accent);
    color: #1a1408;
    font-weight: 700;
    font-size: 14px;
    text-decoration: none;
    transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}

body.aini-public .btn-aini-primary:hover,
body.aini-public .btn-aini-accent:hover,
body.aini-public .btn-aini-primary:focus,
body.aini-public .btn-aini-accent:focus {
    background: var(--aini-accent-dark);
    border-color: var(--aini-accent-dark);
    color: #1a1408;
    transform: translateY(-1px);
    box-shadow: var(--shadow-hover);
    text-decoration: none;
}

body.aini-public .btn-aini-outline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 26px;
    border-radius: 999px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.24);
    color: #ffffff;
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    transition: border-color .15s ease, background .15s ease;
}

body.aini-public .btn-aini-outline:hover,
body.aini-public .btn-aini-outline:focus {
    border-color: var(--aini-accent);
    background: rgba(229, 193, 88, 0.08);
    color: #ffffff;
    text-decoration: none;
}

/* Small status/data chip — only ever bound to real model fields, never fabricated */
body.aini-public .aini-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    background: rgba(255, 255, 255, 0.08);
    color: #d4d9e2;
    border: 1px solid rgba(255, 255, 255, 0.12);
}

body.aini-public .aini-badge--accent {
    background: rgba(229, 193, 88, 0.14);
    color: var(--aini-accent);
    border-color: rgba(229, 193, 88, 0.35);
}

body.aini-public .aini-badge--muted {
    background: rgba(255, 255, 255, 0.05);
    color: #88909a;
}

/* Decorative static map graphic (listings + contact pages) */
body.aini-public .aini-map-graphic {
    position: relative;
    border-radius: var(--glass-radius);
    border: 1px solid rgba(229, 193, 88, 0.22);
    background-color: #0c1016;
    background-image:
        radial-gradient(circle at 30% 35%, rgba(229, 193, 88, 0.22), transparent 55%),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 800 400'%3E%3Cg stroke='%23e5c158' stroke-width='1.6' fill='none' opacity='0.42' stroke-linecap='round'%3E%3Cpath d='M-20,340 L120,300 L260,250 L400,200 L560,140 L700,90 L820,58'/%3E%3Cpath d='M20,420 L150,330 L280,270 L420,210 L580,150 L750,80 L820,55'/%3E%3Cpath d='M-20,178 L140,190 L300,205 L460,215 L620,225 L820,236'/%3E%3Cpath d='M-20,55 L160,110 L320,160 L440,200 L560,240 L680,290 L820,342'/%3E%3Cpath d='M262,-20 L280,80 L300,160 L332,240 L362,320 L392,420'/%3E%3Cpath d='M522,-20 L500,90 L470,170 L440,250 L410,330 L392,420'/%3E%3Cpath d='M-20,252 L100,240 L220,230 L340,220 L460,215 L580,205 L700,195 L820,186'/%3E%3Cpath d='M600,-20 L620,100 L640,200 L650,300 L656,420'/%3E%3Cpath d='M100,-20 L112,120 L96,240 L130,420'/%3E%3Cpath d='M-20,380 L60,360 L180,120 L260,-20'/%3E%3C/g%3E%3C/svg%3E");
    background-size: auto, cover;
    background-repeat: no-repeat, no-repeat;
    overflow: hidden;
}

body.aini-public .aini-map-graphic .aini-map-pin {
    position: absolute;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--aini-accent);
    box-shadow: 0 0 0 5px rgba(229, 193, 88, 0.24), 0 0 16px rgba(229, 193, 88, 0.75);
}

body.aini-public .aini-map-graphic .aini-map-label {
    position: absolute;
    left: 18px;
    bottom: 16px;
    color: rgba(255, 255, 255, 0.55);
    font-family: var(--font-body);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    line-height: 1.5;
}

body.aini-public .aini-map-graphic .aini-map-label span {
    display: block;
    font-size: 9px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.32);
    letter-spacing: 0.1em;
}

/* Real, navigable embedded map (OpenStreetMap) — dark-mode color filter applied
   to the map tiles so it still reads as part of the AiniSpace theme. */
body.aini-public .aini-map-embed {
    position: relative;
    border-radius: var(--glass-radius);
    border: 1px solid var(--aini-glass-border);
    overflow: hidden;
    height: 320px;
}

body.aini-public .aini-map-embed iframe {
    width: 100%;
    height: 100%;
    border: 0;
    filter: invert(92%) hue-rotate(180deg) brightness(0.95) contrast(0.92) saturate(1.1);
}

body.aini-public .map-caption a {
    color: var(--aini-accent);
    text-decoration: none;
}

body.aini-public .map-caption a:hover {
    text-decoration: underline;
}

/* Shared section-header block: eyebrow + serif title + muted lede, used on every page */
body.aini-public .hn-section-head {
    max-width: 640px;
    margin-bottom: 40px;
}

body.aini-public .hn-section-head p {
    color: #88909a;
    font-size: .95rem;
    margin-top: 8px;
}

/* Shared "trusted integrations" pill, reused on the landing, about and pricing pages */
body.aini-public .hn-trust-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border: 1px solid var(--aini-glass-border);
    border-radius: 999px;
    color: #d4d9e2;
    font-size: .85rem;
}

html {
    font-size: var(--font-size-base);
}

body {
    font-size: var(--font-size-base) !important;
    font-family: "Plus Jakarta Sans", "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    color: var(--text-primary);
    line-height: var(--line-height-base);
}

/* Accessibility baseline: strong, consistent keyboard focus visibility */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[role="button"]:focus-visible,
[tabindex]:focus-visible {
    outline: 3px solid var(--focus-ring);
    outline-offset: 2px;
    box-shadow: 0 0 0 4px var(--focus-ring-soft);
}

a:not(:focus-visible),
button:not(:focus-visible),
input:not(:focus-visible),
select:not(:focus-visible),
textarea:not(:focus-visible),
[role="button"]:not(:focus-visible),
[tabindex]:not(:focus-visible) {
    outline: none;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--text-primary);
}

p,
li,
label,
input,
select,
textarea,
button,
.form-control,
.form-select,
.text-muted,
small,
.small {
    font-size: var(--font-size-sm);
}

.text-muted,
small,
.small {
    color: var(--text-muted) !important;
}

body.aini-shell {
    background: var(--aini-backdrop);
    background-attachment: fixed;
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center top;
}

.aini-glass,
.glass-panel {
    background: var(--aini-glass);
    border: 1px solid var(--aini-glass-border);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    box-shadow: var(--shadow-panel);
    color: var(--text-primary);
}

.aini-glass a,
.glass-panel a {
    color: var(--primary);
}

.aini-glass a:hover,
.glass-panel a:hover {
    color: var(--aini-neon);
}

.aini-glass-strong {
    background: var(--aini-glass-strong);
    border: 1px solid var(--aini-glass-border);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

/* Platform-wide glassmorphism surfaces */
body.aini-shell .inside-banner,
body.aini-shell .spacer,
body.aini-shell .about,
body.aini-shell .testimonials,
body.aini-shell .recommended,
body.aini-shell .properties-listing,
body.aini-shell .hot-properties,
body.aini-shell .search-form,
body.aini-shell .well,
body.aini-shell .card,
body.aini-shell .table-card,
body.aini-shell .p-card,
body.aini-shell .metric-card,
body.aini-shell .stat-card,
body.aini-shell .page-header,
body.aini-shell .search-bar,
body.aini-shell .welcome-banner,
body.aini-shell .modal-content,
body.aini-shell .top-header,
body.aini-shell .p-topbar,
body.aini-shell .sidebar,
body.aini-shell .p-sidebar {
    background: var(--aini-glass) !important;
    border: 1px solid var(--aini-glass-border) !important;
    border-radius: var(--glass-radius);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    box-shadow: var(--shadow-panel);
}

body.aini-shell .top-header,
body.aini-shell .p-topbar,
body.aini-shell .sidebar,
body.aini-shell .p-sidebar,
body.aini-shell .welcome-banner {
    background: var(--aini-glass-strong) !important;
}

body.aini-shell .top-header,
body.aini-shell .p-topbar {
    border-radius: 0;
}

body.aini-shell .sidebar,
body.aini-shell .p-sidebar {
    border-radius: 0;
}

body.aini-shell .table,
body.aini-shell .table th,
body.aini-shell .table td,
body.aini-shell .table-striped > tbody > tr:nth-of-type(odd) {
    background-color: transparent !important;
}

body.aini-shell .form-control,
body.aini-shell .form-select,
body.aini-shell input,
body.aini-shell select,
body.aini-shell textarea {
    background: var(--aini-glass) !important;
    border: 1px solid var(--aini-glass-border) !important;
    color: var(--text-primary) !important;
}

body.aini-shell .form-control:focus,
body.aini-shell .form-select:focus,
body.aini-shell input:focus,
body.aini-shell select:focus,
body.aini-shell textarea:focus {
    box-shadow: 0 0 0 3px var(--focus-ring-soft) !important;
    border-color: var(--aini-neon) !important;
}

.aini-accent {
    color: var(--aini-accent);
}

.btn-aini-accent {
    background: var(--aini-accent);
    border: 1px solid var(--aini-accent);
    color: #1d1a12;
    font-weight: 700;
}

.btn-aini-accent:hover,
.btn-aini-accent:focus {
    background: #c38f10;
    border-color: #c38f10;
    color: #1d1a12;
}

@media (max-width: 768px) {
    :root {
        --font-size-base: 16px;
        --font-size-sm: 15px;
    }
}

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