/* Midas public site.
   Palette is lifted from the Magnum mark: the three bars (saffron, copper, cobalt)
   and the letterforms (blue, red, yellow, green). Ink is the logo's navy, not black.
   Gold is Midas's own colour and is used sparingly: price figures and the one
   primary action per screen. */
:root {
  --ink: #101c3f;
  --ink-2: #3a4566;
  --ink-3: #6b7592;
  --paper: #ffffff;
  --mist: #f0f3f9;
  --line: #d9dfeb;
  --cobalt: #1d4fc4;
  --cobalt-deep: #173e9c;
  --red: #c42a1f;
  --saffron: #f2b705;
  --gold-text: #8a6400;
  --copper: #d9662b;
  --green: #2c8a3c;
  --radius-s: 4px;
  --radius-m: 10px;
  --shadow: 0 1px 2px rgba(16, 28, 63, .06), 0 8px 24px rgba(16, 28, 63, .08);
  --ui: "Albert Sans", system-ui, sans-serif;
  --display: "Bodoni Moda", "Didot", Georgia, serif;
  --serif: "Source Serif 4", Georgia, serif;
  --gutter: clamp(16px, 4vw, 48px);
  --max: 1240px;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
main:focus { outline: none; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 16px/1.55 var(--ui); font-feature-settings: "tnum" 0;
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: var(--cobalt); text-underline-offset: 3px; }
h1, h2, h3, h4 { margin: 0 0 .4em; line-height: 1.12; letter-spacing: -.01em; }
p { margin: 0 0 1em; }
:focus-visible { outline: 3px solid var(--saffron); outline-offset: 2px; border-radius: 2px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: #fff; padding: 8px 12px; z-index: 99; }
.skip:focus { left: 8px; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.muted { color: var(--ink-3); }
.num { font-variant-numeric: tabular-nums; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ------------------------------------------------------------ top bar */
.topbar {
  position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: 24px;
  padding: 10px var(--gutter); background: rgba(255, 255, 255, .94);
  backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand img { width: 34px; height: auto; }
.brand-word { font: 700 26px/1 var(--display); letter-spacing: .01em; }
.brand-by { font-size: 13px; color: var(--ink-3); padding-top: 6px; }
.mainnav { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.mainnav a:not(.btn) { color: var(--ink-2); text-decoration: none; padding: 8px 12px; border-radius: var(--radius-s); font-weight: 500; }
.mainnav a:not(.btn):hover, .mainnav a[aria-current="page"] { color: var(--ink); background: var(--mist); }
#navauth { margin-left: 10px; display: flex; gap: 8px; }
.nav-toggle { display: none; margin-left: auto; background: none; border: 1px solid var(--line); border-radius: var(--radius-s); padding: 8px 12px; font: inherit; color: var(--ink); }
@media (max-width: 900px) {
  .nav-toggle { display: block; }
  .mainnav { display: none; position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; align-items: stretch;
    background: #fff; border-bottom: 1px solid var(--line); padding: 8px var(--gutter) 16px; }
  .mainnav.open { display: flex; }
  #navauth { margin: 8px 0 0; }
}

/* ------------------------------------------------------------ buttons & forms */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: 600 15px/1 var(--ui); padding: 13px 20px; border-radius: var(--radius-s);
  border: 1px solid var(--ink); background: var(--ink); color: #fff; text-decoration: none; cursor: pointer;
}
.btn:hover { background: var(--cobalt-deep); border-color: var(--cobalt-deep); }
.btn:disabled { opacity: .55; cursor: progress; }
.btn-gold { background: var(--saffron); border-color: var(--saffron); color: var(--ink); }
.btn-gold:hover { background: #ffc81f; border-color: #ffc81f; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: var(--mist); border-color: var(--ink-3); }
.btn-danger { background: #fff; color: var(--red); border-color: #efc2be; }
.btn-danger:hover { background: #fdf0ef; border-color: var(--red); }
.btn-small { padding: 8px 14px; font-size: 14px; }
.icon-btn { background: none; border: 0; font-size: 18px; cursor: pointer; color: var(--ink-3); padding: 6px; }

label.field { display: grid; gap: 6px; font-size: 14px; font-weight: 600; color: var(--ink-2); }
label.field small { font-weight: 400; color: var(--ink-3); }
input, select, textarea {
  font: 16px/1.4 var(--ui); color: var(--ink); background: #fff; width: 100%;
  border: 1px solid var(--line); border-radius: var(--radius-s); padding: 11px 12px;
}
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--cobalt); box-shadow: 0 0 0 3px rgba(29, 79, 196, .15); }
.form-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.form-grid .full { grid-column: 1 / -1; }
.checks { display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.check { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius-s); font-weight: 400; cursor: pointer; }
.check input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--cobalt); flex: none; }
.check:has(input:checked) { border-color: var(--cobalt); background: #f3f6fd; }
.check b { display: block; font-weight: 600; }

/* ------------------------------------------------------------ home hero */
.hero { position: relative; padding: clamp(40px, 7vw, 88px) 0 56px; overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: clamp(24px, 5vw, 72px); align-items: center; }
.hero h1 { font: 500 clamp(44px, 6.4vw, 88px)/.98 var(--display); letter-spacing: -.02em; margin-bottom: 22px; }
.hero .lede { font-size: clamp(17px, 1.6vw, 20px); color: var(--ink-2); max-width: 36ch; margin-bottom: 28px; }
.searchbox { display: grid; grid-template-columns: auto 1fr auto; background: #fff; border: 1px solid var(--ink); border-radius: var(--radius-s); max-width: 620px; box-shadow: var(--shadow); }
.searchbox select, .searchbox input { border: 0; border-radius: 0; padding: 16px; }
.searchbox select { border-right: 1px solid var(--line); width: auto; font-weight: 600; }
.searchbox .btn { border-radius: 0 3px 3px 0; margin: -1px -1px -1px 0; }
.hero-quick { margin-top: 16px; display: flex; flex-wrap: wrap; gap: 8px; font-size: 14px; }
.hero-quick a { color: var(--ink-2); border: 1px solid var(--line); border-radius: 99px; padding: 5px 12px; text-decoration: none; }
.hero-quick a:hover { border-color: var(--ink-3); color: var(--ink); }
.hero-cover { position: relative; justify-self: center; width: min(420px, 100%); }
@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-cover { width: min(340px, 86%); }
  .searchbox { grid-template-columns: 1fr; }
  .searchbox select { border-right: 0; border-bottom: 1px solid var(--line); }
  .searchbox .btn { border-radius: 0 0 3px 3px; margin: 0 -1px -1px; }
}

/* ------------------------------------------------------------ rate ticker: the city's rate card */
.ratecard { border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink); background: var(--ink); color: #fff; }
.ratecard-inner { display: flex; align-items: stretch; overflow-x: auto; scrollbar-width: none; }
.ratecard-inner::-webkit-scrollbar { display: none; }
.ratecard h2 { font: 600 13px/1.25 var(--ui); padding: 14px 20px 14px var(--gutter); margin: 0; border-right: 1px solid rgba(255,255,255,.18); min-width: 150px; flex: none; }
.ratecard h2 small { display: block; font-weight: 400; color: #aab4d4; }
.rate { flex: none; padding: 12px 20px; border-right: 1px solid rgba(255,255,255,.12); text-decoration: none; color: #fff; }
.rate:hover { background: rgba(255,255,255,.06); }
.rate span { display: block; font-size: 12.5px; color: #aab4d4; }
.rate b { font: 600 17px/1.3 var(--ui); font-variant-numeric: tabular-nums; }
.rate i { font-style: normal; font-size: 12.5px; margin-left: 6px; color: #7fd48d; }
.rate i.down { color: #ff9d94; }

/* ------------------------------------------------------------ sections */
.section { padding: clamp(48px, 7vw, 96px) 0; }
.section.tint { background: var(--mist); }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 28px; flex-wrap: wrap; }
.section-head h2 { font: 500 clamp(30px, 3.6vw, 46px)/1.05 var(--display); margin: 0; }
.section-head p { margin: 6px 0 0; color: var(--ink-2); max-width: 60ch; }
.page-head { padding: clamp(36px, 6vw, 72px) 0 28px; border-bottom: 1px solid var(--line); margin-bottom: 32px; }
.page-head h1 { font: 500 clamp(38px, 5vw, 64px)/1 var(--display); letter-spacing: -.015em; }
.page-head p { color: var(--ink-2); max-width: 62ch; font-size: 18px; margin: 10px 0 0; }

/* ------------------------------------------------------------ listings */
.listing-grid { display: grid; gap: 28px 24px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.listing { color: inherit; text-decoration: none; display: grid; gap: 10px; }
.listing-media { aspect-ratio: 4 / 3; border-radius: var(--radius-s); overflow: hidden; background: var(--mist); position: relative; }
.listing-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.listing:hover .listing-media img { transform: scale(1.03); }
.listing-media .tag { position: absolute; left: 10px; top: 10px; }
.listing h3 { font: 600 17px/1.3 var(--ui); margin: 0; }
.listing .price { font: 600 22px/1 var(--ui); color: var(--ink); font-variant-numeric: tabular-nums; }
.listing .meta { font-size: 14px; color: var(--ink-3); display: flex; flex-wrap: wrap; gap: 4px 14px; }
.tag { display: inline-block; font-size: 12px; font-weight: 600; padding: 3px 8px; border-radius: 3px; background: #fff; color: var(--ink); }
.tag.demo { background: #fff4cf; color: #6a4d00; }
.tag.rent { background: #e5f3e7; color: #1f6a2c; }
/* Illustrated placeholder for listings without photos: the Magnum bars in the listing's own proportions */
.ph-art { width: 100%; height: 100%; display: grid; place-items: end center; background: linear-gradient(180deg, #e9eef8, #f7f9fc); }
.ph-art svg { width: 70%; height: 80%; }

.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; margin-bottom: 28px; padding: 16px; background: var(--mist); border-radius: var(--radius-m); }
.filters label { display: grid; gap: 4px; font-size: 13px; font-weight: 600; color: var(--ink-2); flex: 1 1 150px; }
.filters .btn { flex: none; }

/* property detail */
.prop-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(300px, 1fr); gap: 40px; align-items: start; }
.prop-gallery { display: grid; gap: 8px; grid-template-columns: repeat(4, 1fr); }
.prop-gallery > :first-child { grid-column: 1 / -1; aspect-ratio: 16 / 10; }
.prop-gallery > * { border-radius: var(--radius-s); overflow: hidden; aspect-ratio: 4/3; background: var(--mist); }
.prop-gallery img { width: 100%; height: 100%; object-fit: cover; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); border-top: 1px solid var(--line); margin: 24px 0; }
.facts div { padding: 14px 0; border-bottom: 1px solid var(--line); }
.facts dt { font-size: 13px; color: var(--ink-3); }
.facts dd { margin: 2px 0 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.side-card { position: sticky; top: 84px; border: 1px solid var(--line); border-radius: var(--radius-m); padding: 24px; background: #fff; box-shadow: var(--shadow); }
.side-card .price { font: 600 34px/1 var(--ui); margin: 4px 0 6px; }
@media (max-width: 860px) { .prop-grid { grid-template-columns: 1fr; } .side-card { position: static; } }

/* ------------------------------------------------------------ market */
.market-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 32px; align-items: start; }
@media (max-width: 960px) { .market-layout { grid-template-columns: 1fr; } }
.rate-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.rate-table th { text-align: left; font-size: 13px; font-weight: 600; color: var(--ink-3); padding: 10px 12px; border-bottom: 1px solid var(--ink); white-space: nowrap; }
.rate-table td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.rate-table tr { cursor: pointer; }
.rate-table tbody tr:hover, .rate-table tr[aria-selected="true"] { background: var(--mist); }
.rate-table .r { text-align: right; }
.rate-table .spark { color: var(--cobalt); }
.zone { font-size: 12px; font-weight: 600; padding: 2px 7px; border-radius: 3px; }
.zone-North { background: #e8eefc; color: var(--cobalt-deep); }
.zone-South { background: #fdeceb; color: #9c2118; }
.zone-East { background: #fff4d1; color: #6a4d00; }
.zone-West { background: #e5f3e7; color: #1f6a2c; }
.zone-Central { background: #efe9f8; color: #4b2d86; }
.up { color: var(--green); } .down { color: var(--red); }
.table-scroll { overflow-x: auto; }
.loc-panel { position: sticky; top: 84px; border: 1px solid var(--line); border-radius: var(--radius-m); padding: 22px; }
.loc-panel h3 { font: 500 30px/1.05 var(--display); }
.bigchart { width: 100%; height: auto; color: var(--cobalt); }
.source-note { font-size: 13px; color: var(--ink-3); border-left: 3px solid var(--saffron); padding: 4px 0 4px 12px; margin-top: 18px; }

/* ------------------------------------------------------------ editorial blocks */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(24px, 5vw, 72px); align-items: center; }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; } }
.prose { font: 18px/1.7 var(--serif); max-width: 66ch; }
.prose h2 { font: 500 34px/1.1 var(--display); margin-top: 1.4em; }
.steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 0; counter-reset: s; }
.steps li { counter-increment: s; display: grid; grid-template-columns: 48px 1fr; gap: 12px; padding: 18px 0; border-top: 1px solid var(--line); }
.steps li::before { content: counter(s); font: 500 30px/1 var(--display); color: var(--cobalt); }
.steps b { display: block; margin-bottom: 2px; }
.service-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 0; border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.service-grid div { padding: 22px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.service-grid b { display: block; font-size: 17px; margin-bottom: 4px; }
.bars-motif { display: flex; gap: 6px; align-items: end; height: 28px; margin-bottom: 14px; }
.bars-motif i { width: 10px; display: block; }
.bars-motif i:nth-child(1) { height: 70%; background: linear-gradient(90deg, #ff9500, #ffe500); }
.bars-motif i:nth-child(2) { height: 55%; background: linear-gradient(90deg, #b8401a, #f69450, #b8401a); }
.bars-motif i:nth-child(3) { height: 100%; background: linear-gradient(90deg, #1b2fcf, #8aa4ff, #1b2fcf); }
.quote-block { font: italic 400 clamp(24px, 3vw, 36px)/1.25 var(--display); border-left: 4px solid var(--red); padding-left: 24px; margin: 0; }
.empty { padding: 40px; text-align: center; border: 1px dashed var(--line); border-radius: var(--radius-m); color: var(--ink-2); }

/* ------------------------------------------------------------ auth */
.auth-wrap { max-width: 460px; margin: 56px auto; padding: 0 var(--gutter); }
.auth-wrap.wide { max-width: 860px; }
.auth-card { border: 1px solid var(--line); border-radius: var(--radius-m); padding: clamp(22px, 4vw, 36px); box-shadow: var(--shadow); }
.auth-card h1 { font: 500 38px/1.05 var(--display); }

/* ------------------------------------------------------------ footer, toasts, modal */
.sitefoot { background: var(--mist); border-top: 1px solid var(--line); margin-top: 64px; }
.foot-inner { max-width: var(--max); margin: 0 auto; padding: 48px var(--gutter) 24px; display: grid; grid-template-columns: 240px 1fr; gap: 48px; }
.foot-logo { width: 200px; mix-blend-mode: multiply; }
.foot-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 24px; }
.foot-cols h3 { font-size: 14px; margin-bottom: 10px; }
.foot-cols a, .foot-cols span { display: block; color: var(--ink-2); text-decoration: none; padding: 3px 0; font-size: 15px; }
.foot-cols a:hover { color: var(--ink); text-decoration: underline; }
.foot-legal { max-width: var(--max); margin: 0 auto; padding: 16px var(--gutter) 28px; font-size: 13px; color: var(--ink-3); border-top: 1px solid var(--line); }
@media (max-width: 700px) { .foot-inner { grid-template-columns: 1fr; } }
body.in-portal .sitefoot { display: none; }

#toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); display: grid; gap: 8px; z-index: 100; width: min(460px, calc(100% - 32px)); }
.toast { background: var(--ink); color: #fff; padding: 12px 16px; border-radius: var(--radius-s); box-shadow: var(--shadow); font-size: 15px; }
.toast.error { background: #8f1d15; }
.toast.ok { background: #1f6a2c; }
dialog.modal { border: 0; border-radius: var(--radius-m); padding: 0; width: min(640px, calc(100% - 32px)); box-shadow: 0 20px 60px rgba(16,28,63,.3); color: var(--ink); }
dialog.modal::backdrop { background: rgba(16, 28, 63, .45); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.modal-head h2 { margin: 0; font-size: 20px; }
.modal-body { padding: 22px; max-height: 75vh; overflow: auto; }
