/* AdsSpaceHub V2-6A.1 · Midnight Design System
   Central visual layer. Dark is the default; light is a cool slate alternative. */

:root,
html[data-ash-theme="light"]{
  --ash-brand:#2563eb;
  --ash-brand-600:#1d4ed8;
  --ash-brand-700:#1e40af;
  --ash-accent:#22b8cf;
  --ash-accent-soft:#e4f7fb;
  --ash-brand-soft:#e8f0ff;
  --ash-ink:#14213a;
  --ash-muted:#64748b;
  --ash-border:#d8e2ee;
  --ash-border-strong:#c5d2e1;
  --ash-bg:#edf3f8;
  --ash-bg-elevated:#f4f7fb;
  --ash-surface:#f8fbfd;
  --ash-surface-soft:#f0f5f9;
  --ash-surface-muted:#e9f0f6;
  --ash-sidebar:#10223c;
  --ash-sidebar-2:#0b1830;
  --ash-success:#0e9f6e;
  --ash-warning:#d78b08;
  --ash-danger:#dc4b4b;
  --ash-info:#2186eb;
  --ash-text:var(--ash-ink);
  --ash-text-muted:var(--ash-muted);
  --ash-shadow:0 1px 2px rgba(31,52,76,.04),0 14px 36px rgba(31,52,76,.08);
  --ash-shadow-lg:0 24px 70px rgba(29,48,73,.14);
  --ash-radius:16px;
  --ash-radius-sm:11px;
  --market-ink:#14213a;
  --market-muted:#66778d;
  --market-line:#d8e2ee;
  --market-accent:#2563eb;
  --bs-body-bg:#edf3f8;
  --bs-body-color:#14213a;
  --bs-secondary-color:#64748b;
  --bs-tertiary-bg:#e9f0f6;
  --bs-border-color:#d8e2ee;
  color-scheme:light;
}

html[data-ash-theme="dark"]{
  --ash-brand:#4f8cff;
  --ash-brand-600:#3b78eb;
  --ash-brand-700:#2f66d4;
  --ash-accent:#38c4dd;
  --ash-accent-soft:#123a4b;
  --ash-brand-soft:#152f58;
  --ash-ink:#e8f0f8;
  --ash-muted:#91a4ba;
  --ash-border:#263a52;
  --ash-border-strong:#344b66;
  --ash-bg:#0f1b2d;
  --ash-bg-elevated:#132238;
  --ash-surface:#16263b;
  --ash-surface-soft:#1b2d45;
  --ash-surface-muted:#20344d;
  --ash-sidebar:#0a1628;
  --ash-sidebar-2:#10213a;
  --ash-success:#34d399;
  --ash-warning:#f3b64c;
  --ash-danger:#fb7185;
  --ash-info:#5aa2ff;
  --ash-text:var(--ash-ink);
  --ash-text-muted:var(--ash-muted);
  --ash-shadow:0 1px 2px rgba(0,0,0,.2),0 15px 36px rgba(2,8,23,.26);
  --ash-shadow-lg:0 28px 80px rgba(2,8,23,.38);
  --market-ink:#e8f0f8;
  --market-muted:#91a4ba;
  --market-line:#263a52;
  --market-accent:#4f8cff;
  --bs-body-bg:#0f1b2d;
  --bs-body-color:#e8f0f8;
  --bs-secondary-color:#91a4ba;
  --bs-tertiary-bg:#20344d;
  --bs-border-color:#263a52;
  color-scheme:dark;
}

html,body{min-height:100%;}
body.ash-body{background:var(--ash-bg)!important;color:var(--ash-ink)!important;transition:background-color .2s ease,color .2s ease;}
a{color:var(--ash-brand)}
a:hover{color:var(--ash-brand-600)}

/* App shell */
.ash-sidebar{background:linear-gradient(180deg,var(--ash-sidebar) 0%,var(--ash-sidebar-2) 100%)!important;border-right:1px solid rgba(148,163,184,.10)}
.ash-sidebar-brand{border-bottom-color:rgba(148,163,184,.12)!important}
.ash-brand-mark{background:linear-gradient(145deg,#4f8cff,#2563eb 55%,#22b8cf)!important;box-shadow:0 10px 26px rgba(37,99,235,.26)!important}
.ash-brand-copy span{color:#72a7ff!important}
.ash-nav-label{color:#758aa4!important}
.ash-nav-link{color:#aebfd2!important}
.ash-nav-link:hover{background:rgba(96,165,250,.10)!important;color:#f7fbff!important}
.ash-nav-link.is-active{background:linear-gradient(90deg,rgba(59,130,246,.25),rgba(34,184,207,.08))!important;box-shadow:inset 3px 0 0 #5aa2ff!important;color:#fff!important}
.ash-nav-link.is-active i{color:#76adff}
.ash-nav-badge{background:rgba(79,140,255,.16)!important;color:#9ec2ff!important;border:1px solid rgba(79,140,255,.18)}
.ash-sidebar-footer{border-top-color:rgba(148,163,184,.12)!important}
.ash-user-card:hover{background:rgba(96,165,250,.08)!important}

.ash-main{background:
  radial-gradient(circle at 95% 0%,color-mix(in srgb,var(--ash-brand) 7%,transparent),transparent 28rem),
  var(--ash-bg)}
.ash-topbar{background:color-mix(in srgb,var(--ash-bg-elevated) 88%,transparent)!important;border-bottom-color:var(--ash-border)!important;box-shadow:0 1px 0 rgba(148,163,184,.03)}
.ash-command-trigger{background:var(--ash-surface-soft)!important;border-color:var(--ash-border)!important;color:var(--ash-muted)!important}
.ash-command-trigger kbd{background:var(--ash-surface)!important;border-color:var(--ash-border)!important;color:var(--ash-muted)!important}
.ash-icon-button{color:var(--ash-muted)!important}
.ash-icon-button:hover{background:var(--ash-brand-soft)!important;color:var(--ash-brand)!important}
.ash-profile-button{color:var(--ash-ink)!important}
.ash-content{padding-top:32px}
.ash-page-heading h1{font-weight:780;letter-spacing:-.035em}
.ash-page-heading p,.ash-breadcrumbs{color:var(--ash-muted)!important}

/* Surfaces */
.ash-card,.ash-kpi,.card,.dropdown-menu,.modal-content,
.ash-subpanel,.ash-wizard-nav,.ash-wizard-content{
  background:var(--ash-surface)!important;
  color:var(--ash-ink)!important;
  border-color:var(--ash-border)!important;
}
.ash-card,.ash-kpi,.card{box-shadow:var(--ash-shadow)!important}
.ash-card-header,.card-header,.card-footer{border-color:var(--ash-border)!important;background:transparent!important}
.ash-kpi-icon{background:var(--ash-brand-soft)!important;color:var(--ash-brand)!important}
.ash-status{background:var(--ash-surface-soft)!important}

/* Bootstrap component harmonization */
.btn{border-radius:10px;font-weight:650;transition:transform .16s ease,box-shadow .16s ease,background-color .16s ease}
.btn-primary,.btn-dark{background:linear-gradient(135deg,var(--ash-brand),var(--ash-brand-600))!important;border-color:transparent!important;color:#fff!important;box-shadow:0 7px 18px rgba(37,99,235,.18)}
.btn-primary:hover,.btn-dark:hover{transform:translateY(-1px);box-shadow:0 10px 24px rgba(37,99,235,.28)}
.btn-outline-dark,.btn-outline-secondary{border-color:var(--ash-border-strong)!important;color:var(--ash-ink)!important;background:color-mix(in srgb,var(--ash-surface) 80%,transparent)!important}
.btn-outline-dark:hover,.btn-outline-secondary:hover{background:var(--ash-surface-muted)!important;border-color:var(--ash-brand)!important;color:var(--ash-brand)!important}
.form-control,.form-select,input:not([type=checkbox]):not([type=radio]),textarea,select{
  background-color:var(--ash-surface-soft)!important;
  border-color:var(--ash-border)!important;
  color:var(--ash-ink)!important;
}
.form-control::placeholder,input::placeholder,textarea::placeholder{color:color-mix(in srgb,var(--ash-muted) 82%,transparent)!important}
.form-control:focus,.form-select:focus,input:focus,textarea:focus,select:focus{border-color:var(--ash-brand)!important;box-shadow:0 0 0 .2rem color-mix(in srgb,var(--ash-brand) 18%,transparent)!important;background-color:var(--ash-surface)!important}
.form-label,.form-text,.text-body-secondary{color:var(--ash-muted)!important}
.table{--bs-table-bg:transparent;--bs-table-color:var(--ash-ink);--bs-table-border-color:var(--ash-border);color:var(--ash-ink)!important}
.table>:not(caption)>*>*{background:transparent!important;border-bottom-color:var(--ash-border)!important}
.table tbody tr:hover>*{background:var(--ash-surface-soft)!important}
.dropdown-item{color:var(--ash-ink)!important}.dropdown-item:hover{background:var(--ash-surface-soft)!important}
.dropdown-divider{border-color:var(--ash-border)!important}

/* Public navigation */
.ash-public-nav{position:sticky;top:0;z-index:1030;background:color-mix(in srgb,var(--ash-bg-elevated) 91%,transparent)!important;border-bottom:1px solid var(--ash-border);backdrop-filter:blur(18px)}
.ash-public-nav .ash-brand{color:var(--ash-ink)!important}
.ash-public-sections{background:var(--ash-surface-soft)!important;border-color:var(--ash-border)!important;box-shadow:none!important}
.ash-public-section{color:var(--ash-muted)!important}
.ash-public-section:hover{background:var(--ash-surface-muted)!important;color:var(--ash-ink)!important}
.ash-public-section.is-active{background:linear-gradient(135deg,var(--ash-brand),var(--ash-brand-600))!important;color:#fff!important;box-shadow:0 7px 16px rgba(37,99,235,.20)!important}

/* Auth */
.auth-shell{min-height:calc(100vh - 74px);display:grid;align-items:center;background:
  radial-gradient(circle at 18% 20%,color-mix(in srgb,var(--ash-brand) 11%,transparent),transparent 28rem),
  radial-gradient(circle at 82% 70%,color-mix(in srgb,var(--ash-accent) 8%,transparent),transparent 24rem)}
.auth-card{max-width:540px;border-radius:20px!important;box-shadow:var(--ash-shadow-lg)!important}

/* Marketplace visual system */
.market-hero{background:
  linear-gradient(90deg,rgba(8,20,39,.91),rgba(12,28,49,.50)),
  url('https://images.unsplash.com/photo-1497366754035-f200968a6e72?auto=format&fit=crop&w=1800&q=80') center/cover!important;
  box-shadow:var(--ash-shadow-lg)!important;border:1px solid color-mix(in srgb,var(--ash-border) 72%,transparent)}
.market-hero h1{max-width:780px;text-shadow:0 2px 18px rgba(3,12,27,.28)}
.market-hero p{color:#c5d3e4!important}
.eyebrow{color:var(--ash-brand)!important}
.market-hero .eyebrow{color:#7db3ff!important}
.hero-search{background:color-mix(in srgb,var(--ash-surface) 96%,transparent)!important;border:1px solid color-mix(in srgb,var(--ash-border) 78%,transparent);box-shadow:0 18px 44px rgba(2,8,23,.24)!important}
.hero-search input{background:transparent!important;color:var(--ash-ink)!important}
.hero-search i{color:var(--ash-brand)!important}
.hero-search button{background:linear-gradient(135deg,var(--ash-brand),var(--ash-brand-600))!important}
.market-stats .container,.market-page-head,.market-toolbar,.market-filters,.market-map-shell{
  background:var(--ash-surface)!important;border-color:var(--ash-border)!important;box-shadow:var(--ash-shadow)!important}
.market-stats div{border-right-color:var(--ash-border)!important}
.market-card{background:var(--ash-surface)!important;border-color:var(--ash-border)!important;box-shadow:0 8px 24px rgba(15,35,58,.06)!important}
.market-card:hover{border-color:color-mix(in srgb,var(--ash-brand) 38%,var(--ash-border))!important;box-shadow:0 18px 46px rgba(15,35,58,.14)!important}
.market-card-media{background:var(--ash-surface-muted)!important}
.market-badge{background:rgba(11,28,49,.88)!important;backdrop-filter:blur(8px)}
.favorite-btn{background:color-mix(in srgb,var(--ash-surface) 90%,transparent)!important;color:var(--ash-ink)!important;border:1px solid color-mix(in srgb,var(--ash-border) 72%,transparent)!important;backdrop-filter:blur(10px)}
.favorite-btn.is-favorite{color:#fb7185!important}
.market-card-footer{border-color:var(--ash-border)!important}
.market-card-location,.market-card p,.market-stats span,.market-toolbar span{color:var(--ash-muted)!important}
.market-filters input,.market-filters select,.market-toolbar select{background:var(--ash-surface-soft)!important;border-color:var(--ash-border)!important;color:var(--ash-ink)!important}
.market-pagination a{background:var(--ash-surface)!important;border-color:var(--ash-border)!important;color:var(--ash-ink)!important}
.market-pagination a.active{background:var(--ash-brand)!important;color:#fff!important;border-color:var(--ash-brand)!important}
.market-empty{border-color:var(--ash-border)!important;background:var(--ash-surface)!important}
.how-section{background:linear-gradient(145deg,#10233e,#132a46 64%,#10283b)!important;border:1px solid rgba(127,168,215,.16);box-shadow:var(--ash-shadow-lg)}
.how-grid article{background:rgba(255,255,255,.035);border-color:rgba(151,181,216,.17)!important}
.how-grid i{color:#67a3ff!important}

/* Detail / inquiries / comparison */
.quote-card,.owner-card,.facts-grid div,.compare-table,.pref-empty,.inquiry-card,.inquiry-panel{
  background:var(--ash-surface)!important;border-color:var(--ash-border)!important;color:var(--ash-ink)!important}
.facts-grid div{background:var(--ash-surface-soft)!important}
.space-columns section{border-color:var(--ash-border)!important}
.lead-copy,.facts-grid span,.quote-card>span,.owner-card span{color:var(--ash-muted)!important}
.compare-table th,.compare-table td{border-color:var(--ash-border)!important}

/* Maps: reduce the harsh white-vs-dark contrast without making them black. */
html[data-ash-theme="dark"] .leaflet-container{background:#18304b!important}
html[data-ash-theme="dark"] .leaflet-tile-pane{filter:brightness(.78) saturate(.72) contrast(1.04)}
html[data-ash-theme="dark"] .leaflet-control-zoom a,
html[data-ash-theme="dark"] .leaflet-control-layers,
html[data-ash-theme="dark"] .leaflet-popup-content-wrapper,
html[data-ash-theme="dark"] .leaflet-popup-tip{background:#1b2f47!important;color:#e8f0f8!important;border-color:#344b66!important}

/* Theme icon: sun in dark, moon in light. */
#theme-toggle{border:1px solid var(--ash-border);background:var(--ash-surface-soft)!important;color:var(--ash-brand)!important}
#theme-toggle:hover{background:var(--ash-brand-soft)!important}

/* Avoid pure white/black islands from legacy/hotfix styles. */
html[data-ash-theme="dark"] .bg-white{background-color:var(--ash-surface)!important}
html[data-ash-theme="dark"] .text-dark{color:var(--ash-ink)!important}
html[data-ash-theme="dark"] .border{border-color:var(--ash-border)!important}

@media(max-width:991px){
  .ash-content{padding:22px 20px 36px}
  .market-hero{box-shadow:0 16px 44px rgba(2,8,23,.22)!important}
}
@media(max-width:575px){
  .ash-content{padding:18px 14px 32px}
  .ash-public-nav{position:relative}
  .auth-card{border-radius:16px!important}
}

/* V2-6A.1 Hotfix 01 · Light marketplace hero
   Keep the photograph, but remove the permanent dark island in light mode. */
html[data-ash-theme="light"] .market-hero{
  background:
    linear-gradient(90deg,rgba(238,245,252,.96) 0%,rgba(235,243,251,.88) 43%,rgba(224,236,248,.50) 100%),
    url('https://images.unsplash.com/photo-1497366754035-f200968a6e72?auto=format&fit=crop&w=1800&q=80') center/cover!important;
  color:#14213a!important;
  border-color:#cfdae7!important;
  box-shadow:0 20px 54px rgba(42,67,96,.13)!important;
}
html[data-ash-theme="light"] .market-hero h1{
  color:#10213d!important;
  text-shadow:none!important;
}
html[data-ash-theme="light"] .market-hero p{color:#53677f!important}
html[data-ash-theme="light"] .market-hero .eyebrow{color:#2563eb!important}
html[data-ash-theme="light"] .market-hero .hero-search{
  background:rgba(248,251,253,.94)!important;
  border-color:#cedae8!important;
  box-shadow:0 18px 42px rgba(42,67,96,.14)!important;
}
html[data-ash-theme="light"] .market-hero .hero-search input{color:#14213a!important}

/* V2-6A.1 Hotfix 03 · Light "Cómo funciona" section
   Remove the permanent dark island when Light theme is active. */
html[data-ash-theme="light"] .how-section{
  background:linear-gradient(145deg,#eaf2f9 0%,#eef5fa 55%,#e5eef7 100%)!important;
  color:#14213a!important;
  border-color:#d2deea!important;
  box-shadow:0 18px 48px rgba(42,67,96,.10)!important;
}
html[data-ash-theme="light"] .how-section .section-heading h2,
html[data-ash-theme="light"] .how-section h3{
  color:#14213a!important;
}
html[data-ash-theme="light"] .how-section .eyebrow{
  color:#2563eb!important;
}
html[data-ash-theme="light"] .how-grid article{
  background:rgba(248,251,253,.82)!important;
  border-color:#d4e0eb!important;
  box-shadow:0 8px 24px rgba(42,67,96,.06)!important;
}
html[data-ash-theme="light"] .how-grid article p{
  color:#60738a!important;
}
html[data-ash-theme="light"] .how-grid i{
  color:#2563eb!important;
}
