/* ===========================================
   INVESTNEST: PROPERTY CALCULATORS
   Uses the tokens from styles.css
   =========================================== */

.calc-hero { padding: 180px 0 60px; background: var(--black); }
.calc-hero .lead { max-width: 760px; }
.calc-hero-points { display: flex; flex-wrap: wrap; gap: 12px 28px; margin-top: 28px; list-style: none; }
.calc-hero-points li { font-size: 0.95rem; color: rgba(255,255,255,0.8); display: flex; align-items: center; gap: 10px; }
.calc-hero-points li::before { content: ""; width: 8px; height: 8px; background: var(--red); border-radius: 50%; flex-shrink: 0; }
@media (max-width: 768px) { .calc-hero { padding: 130px 0 40px; } }

/* ---------- Picker grid ---------- */
.calc-picker { background: var(--darker); padding: 48px 0 24px; border-top: 1px solid rgba(255,255,255,0.06); }
.calc-group-title { font-family: 'Inter', sans-serif; font-size: 0.75rem; font-weight: 600; letter-spacing: 0.22em; text-transform: uppercase; color: var(--grey); margin: 28px 0 14px; }
.calc-group-title:first-child { margin-top: 0; }
.calc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.calc-card {
  text-align: left; display: flex; flex-direction: column; gap: 6px;
  background: var(--dark); border: 1px solid rgba(255,255,255,0.08); border-radius: 10px;
  padding: 18px 18px 16px; transition: border-color .2s ease, transform .2s ease, background .2s ease;
  color: var(--white); width: 100%;
}
.calc-card:hover { border-color: rgba(211,0,0,0.6); transform: translateY(-2px); }
.calc-card.active { border-color: var(--red); background: #1c0d0d; }
.calc-card-num { font-size: 0.7rem; letter-spacing: 0.2em; color: var(--red); font-weight: 600; }
.calc-card-title { font-family: 'Oswald', sans-serif; font-size: 1.2rem; text-transform: uppercase; letter-spacing: 0.02em; line-height: 1.15; }
.calc-card-desc { font-size: 0.875rem; color: rgba(255,255,255,0.65); line-height: 1.45; }

/* ---------- Calculator shell ---------- */
.calc-stage { background: var(--darker); padding: 32px 0 100px; }
.calc-shell { background: var(--dark); border: 1px solid rgba(255,255,255,0.08); border-radius: 14px; overflow: hidden; scroll-margin-top: 110px; }
.calc-head { padding: 28px 32px 22px; border-bottom: 1px solid rgba(255,255,255,0.07); }
.calc-head h2 { font-size: clamp(1.6rem, 3.2vw, 2.4rem); }
.calc-head p { margin-top: 8px; font-size: 1rem; color: rgba(255,255,255,0.75); max-width: 760px; }
.calc-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.calc-inputs { padding: 24px 32px 32px; border-right: 1px solid rgba(255,255,255,0.07); }
.calc-results { padding: 24px 32px 32px; background: #101010; }
@media (max-width: 960px) {
  .calc-body { grid-template-columns: 1fr; }
  .calc-inputs { border-right: none; border-bottom: 1px solid rgba(255,255,255,0.07); }
}
@media (max-width: 600px) {
  .calc-head, .calc-inputs, .calc-results { padding-left: 18px; padding-right: 18px; }
}

.calc-example-note {
  display: flex; gap: 10px; align-items: flex-start;
  background: rgba(255,255,255,0.04); border: 1px dashed rgba(255,255,255,0.18);
  border-radius: 8px; padding: 10px 12px; margin-bottom: 18px; font-size: 0.875rem; color: rgba(255,255,255,0.8); line-height: 1.45;
}
.calc-example-note .swatch { color: #8f8f8f; font-style: italic; font-weight: 600; }
.calc-example-note.done { border-style: solid; border-color: rgba(46,160,67,0.45); background: rgba(46,160,67,0.08); }

.calc-section-label { font-size: 0.7rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--grey); font-weight: 600; margin: 22px 0 10px; }
.calc-section-label:first-of-type { margin-top: 0; }

/* ---------- Fields ---------- */
.cf { margin-bottom: 16px; }
.cf-label { display: flex; align-items: center; gap: 8px; font-size: 0.95rem; font-weight: 600; color: var(--white); margin-bottom: 7px; }
.cf-hint { font-size: 0.8rem; color: rgba(255,255,255,0.55); margin-top: 5px; line-height: 1.4; }
.cf-wrap { position: relative; display: flex; align-items: center; }
.cf-prefix, .cf-suffix { position: absolute; top: 50%; transform: translateY(-50%); color: rgba(255,255,255,0.55); font-size: 1rem; pointer-events: none; }
.cf-prefix { left: 14px; }
.cf-suffix { right: 14px; font-size: 0.9rem; }
.cf input[type="text"] {
  width: 100%; background: var(--black); color: var(--white);
  border: 1px solid #3a3a3a; border-radius: 8px; padding: 13px 14px; font-size: 1.05rem; font-family: 'Inter', sans-serif;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.cf input.has-prefix { padding-left: 30px; }
.cf input.has-suffix { padding-right: 64px; }
.cf input:focus { outline: none; border-color: var(--red); box-shadow: 0 0 0 3px rgba(211,0,0,0.25); }
.cf input.is-example { color: #8f8f8f; font-style: italic; }
.cf input.is-example:focus { color: #bdbdbd; }

/* Segmented buttons (choices) */
.cf-seg { display: flex; flex-wrap: wrap; gap: 6px; }
.cf-seg button {
  flex: 1 1 auto; min-width: 0; padding: 11px 12px; border-radius: 8px; font-size: 0.9rem; font-weight: 500;
  background: var(--black); border: 1px solid #3a3a3a; color: rgba(255,255,255,0.8); transition: all .15s ease; line-height: 1.25;
}
.cf-seg button:hover { border-color: rgba(255,255,255,0.4); color: var(--white); }
.cf-seg button.on { background: var(--red); border-color: var(--red); color: var(--white); }
.cf select {
  width: 100%; background: var(--black); color: var(--white); border: 1px solid #3a3a3a; border-radius: 8px;
  padding: 13px 14px; font-size: 1rem; font-family: 'Inter', sans-serif;
}

/* Tooltip (?) */
.tip { position: relative; display: inline-flex; }
.tip-btn {
  width: 20px; height: 20px; border-radius: 50%; border: 1px solid rgba(255,255,255,0.45);
  font-size: 0.75rem; font-weight: 700; line-height: 1; display: inline-flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,0.85); background: transparent; flex-shrink: 0;
}
.tip-btn:hover, .tip.open .tip-btn { background: var(--red); border-color: var(--red); color: #fff; }
.tip-pop {
  display: none; position: absolute; z-index: 50; left: 50%; bottom: calc(100% + 10px); transform: translateX(-50%);
  width: 280px; max-width: 78vw; background: #f4f4f4; color: #111; border-radius: 8px; padding: 12px 14px;
  font-size: 0.86rem; font-weight: 400; line-height: 1.5; box-shadow: 0 10px 30px rgba(0,0,0,0.55); text-transform: none; letter-spacing: 0;
}
.tip-pop::after { content: ""; position: absolute; top: 100%; left: 50%; transform: translateX(-50%); border: 7px solid transparent; border-top-color: #f4f4f4; }
.tip-pop strong { color: #000; }
.tip.open .tip-pop { display: block; }
@media (hover: hover) { .tip:hover .tip-pop { display: block; } }
@media (max-width: 600px) {
  .cf-label { flex-wrap: wrap; }
  .tip { display: contents; }
  .tip-pop { position: static; transform: none; width: 100%; max-width: none; flex-basis: 100%; margin-top: 4px; order: 3; box-shadow: none; }
  .tip-pop::after { display: none; }
}

/* ---------- Results ---------- */
.res-tag { display: inline-block; font-size: 0.7rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--red); font-weight: 600; margin-bottom: 8px; }
.res-tag .ex { color: #9a9a9a; margin-left: 8px; letter-spacing: 0.12em; }
.res-big { font-family: 'Oswald', sans-serif; font-size: clamp(2.4rem, 5.5vw, 3.6rem); font-weight: 700; line-height: 1.05; color: var(--white); }
.res-big.good { color: #3ccf6a; }
.res-big.bad { color: #ff5a5a; }
.res-sentence { font-size: 1.02rem; color: rgba(255,255,255,0.88); margin: 10px 0 18px; line-height: 1.55; }
.res-sentence b { color: #fff; }
.res-rows { border-top: 1px solid rgba(255,255,255,0.08); margin-bottom: 14px; }
.res-row { display: flex; justify-content: space-between; gap: 14px; padding: 10px 0; border-bottom: 1px solid rgba(255,255,255,0.08); font-size: 0.95rem; }
.res-row span:first-child { color: rgba(255,255,255,0.72); }
.res-row span:last-child { font-weight: 600; text-align: right; white-space: nowrap; }
.res-row.total span { color: #fff; font-weight: 700; font-size: 1.02rem; }
.res-row.pos span:last-child { color: #3ccf6a; }
.res-row.neg span:last-child { color: #ff6b6b; }
.res-note { font-size: 0.85rem; color: rgba(255,255,255,0.65); background: rgba(255,255,255,0.04); border-left: 3px solid var(--red); padding: 10px 12px; border-radius: 0 6px 6px 0; margin: 12px 0; line-height: 1.5; }
.res-note.warn { border-left-color: #e0a800; }
.res-note.ok { border-left-color: #3ccf6a; }

.res-how { margin-top: 16px; border: 1px solid rgba(255,255,255,0.1); border-radius: 8px; }
.res-how summary { cursor: pointer; padding: 12px 14px; font-weight: 600; font-size: 0.95rem; list-style: none; display: flex; justify-content: space-between; align-items: center; }
.res-how summary::-webkit-details-marker { display: none; }
.res-how summary::after { content: "+"; font-size: 1.2rem; color: var(--red); }
.res-how[open] summary::after { content: "–"; }
.res-how ol { padding: 0 16px 14px 34px; }
.res-how li { font-size: 0.9rem; color: rgba(255,255,255,0.8); margin-bottom: 8px; line-height: 1.5; }
.res-how li b { color: #fff; }
.res-how .src { padding: 0 16px 14px; font-size: 0.78rem; color: rgba(255,255,255,0.5); }
.res-how .src a { color: rgba(255,255,255,0.7); text-decoration: underline; }

/* Bar chart */
.res-chart { margin: 14px 0 6px; }
.res-chart-legend { display: flex; gap: 16px; font-size: 0.78rem; color: rgba(255,255,255,0.7); margin-bottom: 8px; flex-wrap: wrap; }
.res-chart-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }
.bars { display: flex; align-items: flex-end; gap: 4px; height: 160px; border-bottom: 1px solid rgba(255,255,255,0.2); }
.bar { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; height: 100%; position: relative; }
.bar > div { width: 100%; border-radius: 3px 3px 0 0; }
.bar .b1 { background: #6b6b6b; }
.bar .b2 { background: var(--red); }
.bars-x { display: flex; gap: 4px; margin-top: 4px; }
.bars-x span { flex: 1; text-align: center; font-size: 0.68rem; color: rgba(255,255,255,0.55); }

/* CTA box */
.res-cta { margin-top: 22px; background: linear-gradient(135deg, #2a0707 0%, #160606 100%); border: 1px solid rgba(211,0,0,0.45); border-radius: 10px; padding: 18px; }
.res-cta h4 { font-size: 1.15rem; margin-bottom: 6px; }
.res-cta p { font-size: 0.92rem; color: rgba(255,255,255,0.8); margin-bottom: 14px; }
.res-cta-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.res-cta .btn { padding: 12px 18px; font-size: 0.8rem; }
.res-actions { display: flex; gap: 14px; margin-top: 14px; flex-wrap: wrap; }
.res-actions button { font-size: 0.82rem; color: rgba(255,255,255,0.7); text-decoration: underline; }
.res-actions button:hover { color: #fff; }

.calc-check-form { margin-top: 14px; display: none; }
.calc-check-form.show { display: block; }
.calc-check-form .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.calc-check-form input { width: 100%; background: var(--black); color: #fff; border: 1px solid #3a3a3a; border-radius: 8px; padding: 11px 12px; font-size: 0.95rem; margin-bottom: 8px; font-family: 'Inter', sans-serif; }
.calc-check-form label.consent { display: flex; gap: 8px; font-size: 0.78rem; color: rgba(255,255,255,0.65); margin: 4px 0 10px; line-height: 1.4; }
.calc-check-ok { display: none; font-size: 0.95rem; color: #3ccf6a; margin-top: 10px; }
@media (max-width: 600px) { .calc-check-form .row2 { grid-template-columns: 1fr; } }

.calc-disclaimer { font-size: 0.75rem; color: rgba(255,255,255,0.45); margin-top: 16px; line-height: 1.5; }

/* ---------- Portfolio table ---------- */
.pf-list { display: flex; flex-direction: column; gap: 12px; }
.pf-item { border: 1px solid rgba(255,255,255,0.1); border-radius: 10px; padding: 14px 14px 4px; background: rgba(255,255,255,0.02); }
.pf-item-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; gap: 10px; }
.pf-item-head input { background: transparent; border: none; border-bottom: 1px dashed rgba(255,255,255,0.3); color: #fff; font-family: 'Oswald', sans-serif; font-size: 1.1rem; text-transform: uppercase; padding: 2px 0; width: 100%; max-width: 280px; }
.pf-item-head input:focus { outline: none; border-bottom-color: var(--red); }
.pf-remove { font-size: 0.8rem; color: rgba(255,255,255,0.6); text-decoration: underline; flex-shrink: 0; }
.pf-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
@media (max-width: 600px) { .pf-grid { grid-template-columns: 1fr; } }
.pf-add { margin-top: 12px; width: 100%; padding: 13px; border: 1px dashed rgba(255,255,255,0.35); border-radius: 10px; font-weight: 600; color: #fff; }
.pf-add:hover { border-color: var(--red); color: var(--red); }
.pf-table { width: 100%; border-collapse: collapse; font-size: 0.86rem; margin: 10px 0 4px; }
.pf-table th, .pf-table td { padding: 8px 6px; border-bottom: 1px solid rgba(255,255,255,0.08); text-align: right; white-space: nowrap; }
.pf-table th:first-child, .pf-table td:first-child { text-align: left; white-space: normal; }
.pf-table th { color: rgba(255,255,255,0.55); font-weight: 500; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; }
.pf-table-wrap { overflow-x: auto; }

/* ---------- Homepage widget ---------- */
.home-calc-section { background: var(--darker); }
.home-calc-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin: 32px 0 18px; justify-content: center; }
.home-calc-tabs button { padding: 12px 18px; border-radius: 8px; border: 1px solid #3a3a3a; background: var(--black); font-weight: 600; font-size: 0.9rem; color: rgba(255,255,255,0.8); }
.home-calc-tabs button.on { background: var(--red); border-color: var(--red); color: #fff; }
.home-calc-more { text-align: center; margin-top: 28px; }

@media print {
  .nav, .footer, .calc-picker, .calc-hero, .res-cta, .res-actions, .final-cta { display: none !important; }
  body, .calc-stage, .calc-shell, .calc-results { background: #fff !important; color: #000 !important; }
  .calc-shell * { color: #000 !important; }
  .res-how ol { display: block !important; }
}
.cf input::placeholder { color: #5f5f5f; font-style: italic; }

/* Mobile: sticky result bar */
.calc-mbar { display: none; }
@media (max-width: 960px) {
  .calc-mbar {
    display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 2px 12px; text-align: left;
    position: sticky; bottom: 0; z-index: 20; width: 100%; padding: 10px 18px calc(10px + env(safe-area-inset-bottom));
    background: rgba(20,20,20,0.97); border-top: 2px solid var(--red); color: #fff;
  }
  .calc-mbar .t { grid-column: 1; font-size: 0.68rem; letter-spacing: 0.12em; text-transform: uppercase; color: rgba(255,255,255,0.65); }
  .calc-mbar .b { grid-column: 1; font-family: 'Oswald', sans-serif; font-size: 1.5rem; font-weight: 700; line-height: 1.1; }
  .calc-mbar .b.good { color: #3ccf6a; } .calc-mbar .b.bad { color: #ff5a5a; }
  .calc-mbar .go { grid-column: 2; grid-row: 1 / span 2; font-size: 0.8rem; font-weight: 600; color: #fff; background: var(--red); padding: 8px 12px; border-radius: 6px; }
}
