/* ═══ investatIQ — Design System (Light / modern) ═══ */
:root {
  --bg: #F5F6FA;
  --card: #FFFFFF;
  --card-hover: #FBFBFE;
  --surface: #F2F4F9;
  --accent: #7A5AF8;
  --accent-light: #9B82FF;
  --accent-soft: #EDE9FE;
  --green: #12B76A;
  --green-dark: #039855;
  --red: #F04438;
  --orange: #F79009;
  --gold: #C98A00;
  --cyan: #0BA5EC;
  --purple: #8B5CF6;
  --text: #15181F;
  --text-muted: #5D6B7E;
  --text-dim: #98A2B3;
  --border: #EAECF2;
  --shadow-sm: 0 1px 2px rgba(16,24,40,.04), 0 1px 3px rgba(16,24,40,.03);
  --shadow: 0 2px 6px rgba(16,24,40,.04), 0 10px 28px rgba(16,24,40,.07);
  --shadow-lg: 0 24px 50px rgba(16,24,40,.16), 0 8px 20px rgba(16,24,40,.06);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* ─── Dark theme (auto via OS, or forced with data-theme) ─── */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0D1015; --card: #171C24; --card-hover: #1F2530; --surface: #1E242F;
    --accent-soft: #2A2547; --text: #EAEEF3; --text-muted: #9DAABC; --text-dim: #6C7889; --border: #29313D;
    --shadow-sm: 0 1px 3px rgba(0,0,0,.4); --shadow: 0 4px 18px rgba(0,0,0,.5); --shadow-lg: 0 24px 50px rgba(0,0,0,.6);
  }
}
:root[data-theme="dark"] {
  --bg: #0D1015; --card: #171C24; --card-hover: #1F2530; --surface: #1E242F;
  --accent-soft: #2A2547; --text: #EAEEF3; --text-muted: #9DAABC; --text-dim: #6C7889; --border: #29313D;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.4); --shadow: 0 4px 18px rgba(0,0,0,.5); --shadow-lg: 0 24px 50px rgba(0,0,0,.6);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Heebo', 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Arial, sans-serif;
  direction: rtl;
  min-height: 100vh;
  overscroll-behavior-y: none;
  -webkit-font-smoothing: antialiased;
}
.view { animation: viewIn .32s ease both; }
@keyframes viewIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.eyebrow { font-size: 11px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; color: var(--accent); display: block; }
/* Brand: "investatIQ" — the IQ is heavier + purple */
.iq { color: var(--accent); font-weight: 900; letter-spacing: -.01em; }
.brandmark { width: 32px; height: 32px; border-radius: 9px; background: linear-gradient(135deg, var(--accent), var(--accent-light)); display: inline-flex; align-items: center; justify-content: center; color: #fff; box-shadow: 0 4px 12px rgba(122,90,248,.32); flex: 0 0 auto; }
.brandmark .ic { width: 19px; height: 19px; }
input, select, textarea, button { font-family: inherit; }
a { color: var(--accent); text-decoration: none; }

/* ─── Layout ─── */
#app { max-width: 720px; margin: 0 auto; padding-bottom: calc(84px + var(--safe-bottom)); min-height: 100vh; }
.header { padding: 20px 18px 12px; position: sticky; top: 0; z-index: 20; background: linear-gradient(180deg, var(--bg) 72%, rgba(238,241,246,0)); }
.header h1 { font-size: 21px; font-weight: 800; margin: 0 0 3px; letter-spacing: -0.3px; }
.header .sub { font-size: 12.5px; color: var(--text-muted); }
.view { padding: 0 16px 24px; }
.app-footer { text-align: center; padding: 18px 8px 6px; margin-top: 10px; border-top: 1px solid var(--border); font-size: 12.5px; }
.app-footer .footer-links { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 2px 4px; }
.app-footer a { color: var(--accent); font-weight: 700; cursor: pointer; text-decoration: none; }
.app-footer a:hover { text-decoration: underline; }
.app-footer .fsep { color: var(--text-dim); margin: 0 5px; }

/* ─── Bottom Tab Bar (app feel, pill active) ─── */
.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 30;
  max-width: 720px; margin: 0 auto;
  display: grid; grid-template-columns: repeat(6, 1fr);
  gap: 2px; padding: 8px 5px calc(8px + var(--safe-bottom));
  background: var(--card); backdrop-filter: blur(14px);
  border-top: 1px solid var(--border);
  box-shadow: 0 -4px 20px rgba(16,24,40,.05);
}
.tabbar button {
  background: none; border: none; color: var(--text-dim);
  padding: 8px 1px; font-size: 10.5px; font-weight: 600; border-radius: 13px;
  display: flex; flex-direction: column; align-items: center; gap: 3px; cursor: pointer;
  transition: background .2s, color .2s;
}
.tabbar button .ico { font-size: 19px; line-height: 1; display: flex; }
.tabbar button .ico svg { width: 22px; height: 22px; display: block; }
.tabbar button.active { color: var(--accent); background: var(--accent-soft); }

/* ─── Cards ─── */
.card { background: var(--card); border: 1px solid var(--border); border-radius: 18px; padding: 18px; margin-bottom: 15px; box-shadow: var(--shadow-sm); }
.card.tight { padding: 15px; }
.surface { background: var(--surface); border-radius: 14px; }

/* ─── Badges ─── */
.badge { padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 700; white-space: nowrap; display: inline-block; }
.rank { width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 800; flex-shrink: 0; }

/* ─── Buttons ─── */
.btn { background: linear-gradient(135deg, var(--accent), var(--accent-light)); color: #fff; border: none; border-radius: 14px; padding: 13px 16px; font-size: 14px; font-weight: 700; cursor: pointer; box-shadow: 0 8px 20px rgba(122,90,248,.28); transition: transform .1s, box-shadow .2s, filter .15s; }
.btn:hover { filter: brightness(1.04); }
.btn.block { display: block; width: 100%; }
.btn.ghost { background: var(--surface); color: var(--text); border: 1px solid var(--border); box-shadow: none; }
.btn.ghost:hover { background: var(--card-hover); filter: none; }
.btn.green { background: var(--green); box-shadow: 0 6px 16px rgba(18,183,106,.22); }
.btn.red { background: var(--red); box-shadow: 0 6px 16px rgba(240,68,56,.20); }
.btn.sm { padding: 8px 13px; font-size: 12px; border-radius: 10px; box-shadow: none; }
.btn:active { transform: scale(.97); }
/* Google sign-in — adaptive inverse (graphite in light, off-white in dark); distinct from the purple primary/Pro CTA */
.btn-google { background: var(--text); color: var(--card); border: none; border-radius: 13px; padding: 13px 16px; font-size: 14px; font-weight: 700; cursor: pointer; width: 100%; display: flex; align-items: center; justify-content: center; gap: 10px; box-shadow: var(--shadow-sm); transition: transform .1s, filter .15s; font-family: inherit; }
.btn-google:hover { filter: brightness(1.08); }
.btn-google:active { transform: scale(.97); }
.btn-google .gwrap { background: #fff; border-radius: 50%; width: 26px; height: 26px; display: flex; align-items: center; justify-content: center; }

/* ─── Forms ─── */
.field { margin-bottom: 13px; }
.field label { display: block; font-size: 13px; color: var(--text-muted); margin-bottom: 6px; font-weight: 500; }
.field input, .field select, .field textarea {
  width: 100%; background: var(--card); border: 1.5px solid var(--border); border-radius: 13px;
  color: var(--text); padding: 12px 14px; font-size: 14px; transition: border-color .15s, box-shadow .15s;
}
.field input::placeholder, .field textarea::placeholder { color: var(--text-dim); }
.field textarea { resize: vertical; min-height: 62px; line-height: 1.6; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.toggle-row { display: flex; flex-wrap: wrap; gap: 7px; }
.toggle-row .chip {
  padding: 11px 14px; border-radius: 20px; font-size: 12.5px; cursor: pointer; font-weight: 600; min-height: 40px; display: inline-flex; align-items: center; gap: 6px;
  background: var(--surface); border: 1.5px solid var(--border); color: var(--text-muted); user-select: none; transition: all .15s;
}
.toggle-row .chip.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }

/* ─── Score visuals ─── */
.score-bar { height: 7px; border-radius: 6px; background: var(--surface); overflow: hidden; margin-top: 5px; }
.score-bar > span { display: block; height: 100%; border-radius: 6px; transition: width .3s; }
.metric { text-align: center; padding: 12px; }
.metric .lbl { font-size: 11.5px; color: var(--text-muted); margin-bottom: 4px; font-weight: 600; }
.metric .val { font-size: 20px; font-weight: 800; letter-spacing: -0.3px; font-variant-numeric: tabular-nums; }
.metric .sub { font-size: 11px; color: var(--text-dim); margin-top: 2px; font-variant-numeric: tabular-nums; }
.pcard .price, .price { font-variant-numeric: tabular-nums; }

/* ─── Property cards (photo-forward) ─── */
.pcard { background: var(--card); border: 1px solid var(--border); border-radius: 18px; overflow: hidden; margin-bottom: 14px; cursor: pointer; box-shadow: var(--shadow-sm); transition: transform .12s, box-shadow .2s; }
.pcard:active { transform: scale(.99); }
.pcard .photo { position: relative; height: 138px; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.pcard .photo img { width: 100%; height: 100%; object-fit: cover; }
.pcard .photo .ph-emoji { font-size: 44px; opacity: .9; }
.pcard .deal-float { position: absolute; top: 12px; inset-inline-start: 12px; width: 50px; height: 50px; border-radius: 15px; display: flex; flex-direction: column; align-items: center; justify-content: center; color: #fff; box-shadow: var(--shadow); backdrop-filter: blur(4px); }
.pcard .deal-float .n { font-size: 19px; font-weight: 800; line-height: 1; }
.pcard .deal-float .c { font-size: 8px; font-weight: 700; opacity: .9; }
.pcard .rank-float { position: absolute; top: 12px; inset-inline-end: 12px; background: rgba(255,255,255,.92); color: var(--text); font-weight: 800; font-size: 12px; padding: 5px 10px; border-radius: 20px; box-shadow: var(--shadow-sm); }
.pcard .status-float { position: absolute; bottom: 12px; inset-inline-start: 12px; background: rgba(255,255,255,.92); padding: 4px 11px; border-radius: 20px; font-size: 12px; font-weight: 700; box-shadow: var(--shadow-sm); }
.pcard .pbody { padding: 13px 15px 15px; }
.pcard .price { font-size: 22px; font-weight: 800; letter-spacing: -0.5px; }
.pcard .paddr { font-size: 14px; color: var(--text-muted); margin-top: 2px; display: flex; align-items: center; gap: 4px; }
.facts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 11px; }
.facts .f { background: var(--surface); border-radius: 8px; padding: 6px 10px; font-size: 12.5px; color: var(--text-muted); font-weight: 600; display: inline-flex; align-items: center; gap: 5px; }

.pill { font-size: 10px; padding: 3px 9px; border-radius: 20px; font-weight: 700; }

/* ─── Accordion ─── */
.acc-head { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.acc-head .ttl { flex: 1; font-weight: 700; font-size: 14px; }
.acc-arrow { color: var(--text-dim); font-size: 18px; transition: transform .2s; }
.acc-arrow.open { transform: rotate(180deg); }

/* ─── Misc ─── */
.muted { color: var(--text-muted); }
.dim { color: var(--text-dim); }
.small { font-size: 13.5px; }
.tiny { font-size: 12.5px; }
.center { text-align: center; }
.row-between { display: flex; justify-content: space-between; align-items: center; }
.gap8 { display: flex; gap: 8px; }
.mb8 { margin-bottom: 8px; } .mb12 { margin-bottom: 12px; } .mb16 { margin-bottom: 16px; }
.mt8 { margin-top: 8px; } .mt12 { margin-top: 12px; } .mt16 { margin-top: 16px; }
.divider { height: 1px; background: var(--border); margin: 12px 0; }
.empty { text-align: center; padding: 46px 20px; color: var(--text-dim); }
.empty .big { font-size: 46px; margin-bottom: 12px; }
table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
th { color: var(--text-dim); font-weight: 700; font-size: 12px; padding: 8px 4px; text-align: right; }
td { padding: 8px 4px; border-top: 1px solid var(--border); }
.cmp-table th, .cmp-table td { padding: 7px 6px; border-bottom: 1px solid var(--border); border-top: none; white-space: nowrap; }
.cmp-table th { text-align: center; }

/* Collapsible accordion sections (property detail) */
details.acc > summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; font-weight: 700; font-size: 14px; }
details.acc > summary::-webkit-details-marker { display: none; }
details.acc .acc-chev { color: var(--text-dim); transition: transform .2s ease; font-size: 12px; }
details.acc[open] .acc-chev { transform: rotate(180deg); }
details.acc .acc-body { margin-top: 12px; }
.ic svg { width: 100%; height: 100%; display: block; }
.ph-emoji.brand-house { color: #fff; }
.ph-emoji.brand-house svg { width: 44px; height: 44px; }
@media (prefers-reduced-motion: reduce) { details.acc .acc-chev { transition: none; } }
.scroll-x { overflow-x: auto; -webkit-overflow-scrolling: touch; }
ul.clean { padding-right: 18px; margin: 0; line-height: 2; }
details summary { list-style: none; } details summary::-webkit-details-marker { display: none; }

/* ─── Modal / sheet ─── */
.sheet-bg { position: fixed; inset: 0; background: rgba(27,33,48,0.42); backdrop-filter: blur(2px); z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
.sheet { background: var(--bg); width: 100%; max-width: 720px; border-radius: 24px 24px 0 0; max-height: 93vh; overflow-y: auto; padding: 16px 16px calc(24px + var(--safe-bottom)); animation: slideup .28s cubic-bezier(.16,1,.3,1); box-shadow: var(--shadow-lg); }
@keyframes slideup { from { transform: translateY(100%);} to { transform: translateY(0);} }
.sheet .grab { width: 42px; height: 5px; background: var(--border); border-radius: 4px; margin: 0 auto 14px; }

/* toast */
.toast { position: fixed; bottom: calc(96px + var(--safe-bottom)); left: 50%; transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 11px 20px; border-radius: 12px; font-size: 13px; font-weight: 700; z-index: 90; box-shadow: var(--shadow-lg); }

/* reminders banner */
.rem { border-radius: 12px; padding: 12px 14px; margin-bottom: 10px; font-size: 13px; line-height: 1.6; border: 1px solid; }

input[type=range] { accent-color: var(--accent); height: 22px; }

/* ─── Accessibility: visible keyboard focus ─── */
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, .chip:focus-visible, [onclick]:focus-visible {
  outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 8px;
}
@media (prefers-reduced-motion: reduce) { * { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

/* ─── Micro-interactions / polish ─── */
.card { transition: box-shadow .2s ease; }
@media (hover: hover) {
  .pcard:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
  .btn.ghost:hover { background: var(--accent-soft); border-color: var(--accent); }
  .btn:not(.ghost):hover { filter: brightness(1.05); }
  .todo-row:hover, .toggle-row .chip:hover { background: var(--accent-soft); border-radius: 8px; }
  .facts .f:hover { background: var(--accent-soft); }
  a:hover { text-decoration: underline; }
}
.pcard, .btn, .chip { transition: transform .12s ease, box-shadow .2s ease, background .15s ease, border-color .15s ease; }

/* ─── Pipeline stepper ─── */
.stepper { display: flex; align-items: flex-start; justify-content: space-between; }
.step { display: flex; flex-direction: column; align-items: center; gap: 5px; cursor: pointer; flex-shrink: 0; width: 52px; }
.step-dot { width: 38px; height: 38px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 16px; font-weight: 800; transition: all .2s; }
.step-lbl { font-size: 11px; }
.step-line { flex: 1; height: 3px; border-radius: 2px; margin-top: 17px; }

/* ─── Next action + to-do ─── */
.next-line { margin-top: 11px; background: var(--accent-soft); color: var(--accent); border-radius: 10px; padding: 8px 12px; font-size: 12px; font-weight: 700; }
.todo-row { display: flex; align-items: center; gap: 9px; padding: 9px 0; border-top: 1px solid var(--border); cursor: pointer; }
.todo-row:first-of-type { border-top: none; padding-top: 2px; }
.tdot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.tact { flex: 1; font-size: 13px; font-weight: 600; color: var(--text); }
.taddr { font-size: 11px; color: var(--text-dim); white-space: nowrap; }

/* ─── Login (dark hero — mirrors the landing) ─── */
.login { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 40px 24px; position: relative; overflow: hidden;
  background: radial-gradient(120% 120% at 85% -10%, #2A2350 0%, #141519 55%); color: #EFEDFA; }
.login::before { content:""; position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px); background-size: 44px 44px; -webkit-mask-image: radial-gradient(70% 60% at 60% 0, #000, transparent 75%); mask-image: radial-gradient(70% 60% at 60% 0, #000, transparent 75%); pointer-events: none; }
.login-inner { position: relative; max-width: 380px; width: 100%; text-align: center; animation: viewIn .5s ease both; }
.login-mark { width: 76px; height: 76px; border-radius: 20px; margin: 0 auto 18px; box-shadow: 0 20px 44px rgba(0,0,0,.5); display: block; }
.login h1 { font-size: 30px; font-weight: 900; line-height: 1.12; letter-spacing: -.02em; margin: 14px 0 10px; }
.login h1 .hl { background: linear-gradient(120deg, var(--accent-light), #C9B8FF); -webkit-background-clip: text; background-clip: text; color: transparent; }
.login .sub { color: #A6A9BE; font-size: 15px; margin-bottom: 22px; }
.login-vps { text-align: right; border: 1px solid rgba(255,255,255,.1); background: rgba(255,255,255,.04); border-radius: 16px; padding: 6px 16px; margin-bottom: 20px; }
.login-vp { display: flex; align-items: center; gap: 11px; padding: 11px 0; font-size: 14px; font-weight: 600; }
.login-vp + .login-vp { border-top: 1px solid rgba(255,255,255,.08); }
.login-vp .ic { color: var(--accent-light); width: 20px; height: 20px; flex: 0 0 auto; }
.btn-google-light { width: 100%; display: flex; align-items: center; justify-content: center; gap: 10px; background: #fff; color: #1B2130; border: none; border-radius: 13px; padding: 14px; font-size: 15px; font-weight: 700; font-family: inherit; cursor: pointer; box-shadow: 0 10px 26px rgba(0,0,0,.35); transition: transform .12s, filter .15s; }
.btn-google-light .gwrap { display: flex; }
.login-trust { color: #8A8DA6; font-size: 12.5px; margin-top: 16px; }

/* button lift + tabbar motion */
@media (hover: hover) {
  .btn:not(.ghost):hover { transform: translateY(-1px); box-shadow: 0 10px 24px rgba(122,90,248,.34); }
  .btn-google-light:hover { filter: brightness(1.03); transform: translateY(-1px); }
}
.tabbar button { transition: color .2s, background .2s, transform .12s; }
.tabbar button:active { transform: scale(.9); }
.tabbar button.active .ico { animation: tabPop .32s ease; }
@keyframes tabPop { 0%{transform:scale(.82)} 60%{transform:scale(1.16)} 100%{transform:scale(1)} }
