/* ARBITORIA — housing.css
 * Plan: ARBITORIA/housing/HOUSING_PLAN.md
 * 페이지: main.html (정성) + simulator.html (인터랙티브)
 *
 * 컴포넌트별 격리 (memory: feedback_css_component_isolation 7 룰):
 *   - housing-* prefix 모든 클래스
 *   - 다른 카테고리 (charge / salary 등) 와 충돌 ❌
 *   - tokens.css 의 변수만 사용 (재선언 ❌)
 *
 * R-004 정신: 차트 라이브러리 ❌ — CSS only.
 * charge.css 의 .charge-bar-chart 패턴 참조.
 */

/* ===== 공통 wrap (charge.css 와 동일 1200px) ===== */
.housing-hero .wrap,
.housing-sim-hero .wrap,
.housing-5axis .wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ===== Hero (main.html S1) ===== */
.housing-hero {
  padding: clamp(40px, 6vw, 72px) 0 24px;
  background: linear-gradient(180deg, rgba(34, 211, 238, .08), transparent 70%);
}
.housing-hero .eyebrow {
  font-size: 0.85rem;
  opacity: 0.7;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.housing-title {
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  margin: 0 0 12px;
  line-height: 1.15;
}
.housing-subtitle {
  font-size: clamp(1rem, 2vw, 1.15rem);
  opacity: 0.85;
  margin: 0 0 24px;
}
.housing-hero-card {
  display: inline-flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px 24px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.housing-hero-card .hero-num {
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 700;
}
.housing-hero-card .hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.85rem;
  opacity: 0.75;
}
.housing-hero-card .hero-pct {
  color: rgb(160, 220, 200);
  font-weight: 600;
}

/* Hero primary CTA — main.html 의 시뮬레이터 진입 강조 (사용자 결정 2026-05-07) */
.housing-hero-cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 20px;
}
.housing-hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 999px;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
  font-family: inherit;
  cursor: pointer;
  border: 0;
}
.housing-hero-cta-primary {
  background: linear-gradient(135deg, rgb(139, 92, 246), rgb(255, 61, 127));
  color: white;
  box-shadow: 0 4px 16px rgba(139, 92, 246, 0.35);
}
.housing-hero-cta-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 22px rgba(139, 92, 246, 0.50);
}
.housing-hero-cta-secondary {
  background: rgba(255, 255, 255, 0.06);
  color: inherit;
  border: 1px solid rgba(255, 255, 255, 0.15);
}
.housing-hero-cta-secondary:hover {
  background: rgba(255, 255, 255, 0.10);
  border-color: rgba(255, 255, 255, 0.30);
}

/* Choicecountry hub (housing/Choicecountry.HTML) */
.housing-choice-hero {
  padding: clamp(40px, 6vw, 72px) 0 24px;
  background: linear-gradient(180deg, rgba(34, 211, 238, .08), transparent 70%);
}
.housing-choice-grid {
  padding: 16px 0 48px;
}
.housing-choice-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-top: 16px;
}
.housing-choice-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 24px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  text-decoration: none;
  color: inherit;
  text-align: center;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}
.housing-choice-card:hover {
  transform: translateY(-2px);
  background: rgba(34, 211, 238, 0.08);
  border-color: rgba(34, 211, 238, 0.30);
}
.housing-choice-flag { font-size: 2.4rem; }
.housing-choice-name { font-weight: 600; font-size: 1.05rem; }
.housing-choice-status {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: rgba(140, 200, 140, 0.15);
  color: rgb(180, 230, 180);
}

/* ===== Snapshot grid (S2) ===== */
.housing-snapshot {
  padding: 32px 0;
}
.housing-snapshot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-top: 16px;
}
.housing-snapshot-card {
  padding: 18px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
}
.housing-snapshot-city {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 0 0 10px;
}
.housing-snapshot-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.92rem;
  margin: 4px 0;
}
.housing-snapshot-row .label {
  opacity: 0.75;
}
.housing-snapshot-row .value {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

/* ===== Bar chart (Affordability S3) — CSS only ===== */
.housing-bar-chart {
  list-style: none;
  padding: 0;
  margin: 16px 0 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.housing-bar-row {
  display: grid;
  grid-template-columns: 160px 1fr 100px;
  align-items: center;
  gap: 12px;
  font-size: 0.9rem;
}
.housing-bar-label {
  text-align: right;
  font-weight: 500;
  opacity: 0.9;
}
.housing-bar-track {
  position: relative;
  height: 18px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 9px;
  overflow: hidden;
}
.housing-bar-fill {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, rgb(99, 102, 241), rgb(139, 92, 246));
  border-radius: 9px;
  transition: width 0.4s ease;
}
.housing-bar-fill.is-rti {
  background: linear-gradient(90deg, rgb(34, 211, 238), rgb(16, 185, 129));
}
.housing-bar-value {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}
@media (max-width: 600px) {
  .housing-bar-row { grid-template-columns: 1fr; gap: 4px; }
  .housing-bar-label, .housing-bar-value { text-align: left; }
}

/* ===== Gateway to simulator (S4) ===== */
.housing-gateway {
  padding: 24px 0;
}
.housing-gateway-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 24px;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.10), rgba(255, 61, 127, 0.10));
  border: 1px solid rgba(139, 92, 246, 0.30);
  border-radius: 16px;
  text-decoration: none;
  color: inherit;
  transition: transform 0.15s ease, background 0.15s ease;
}
.housing-gateway-card:hover {
  transform: translateY(-2px);
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.18), rgba(255, 61, 127, 0.18));
}
.housing-gateway-icon {
  font-size: 2rem;
  flex-shrink: 0;
}
.housing-gateway-text h3 {
  margin: 0 0 4px;
  font-size: 1.1rem;
}
.housing-gateway-text p {
  margin: 0;
  font-size: 0.92rem;
  opacity: 0.85;
}

/* ===== 7 cards: opportunity cost vs stability (S5) ===== */
.housing-7cards-section {
  padding: 32px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.housing-7cards {
  list-style: none;
  padding: 0;
  margin: 16px 0 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}
.housing-7card {
  padding: 16px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.housing-7card-icon {
  display: inline-block;
  font-size: 1.6rem;
  margin-bottom: 8px;
}
.housing-7card-title {
  margin: 0 0 6px;
  font-size: 1rem;
}
.housing-7card-body {
  margin: 0;
  font-size: 0.88rem;
  opacity: 0.85;
  line-height: 1.55;
}

/* ===== AI future split (S6) ===== */
.housing-ai-future {
  padding: 32px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.housing-ai-future-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 16px;
}
@media (max-width: 720px) {
  .housing-ai-future-split { grid-template-columns: 1fr; }
}
.housing-ai-side {
  padding: 20px;
  border-radius: 14px;
}
.housing-ai-side-down {
  background: rgba(255, 61, 127, 0.06);
  border: 1px solid rgba(255, 61, 127, 0.25);
}
.housing-ai-side-up {
  background: rgba(34, 211, 238, 0.06);
  border: 1px solid rgba(34, 211, 238, 0.25);
}
.housing-ai-side h3 {
  margin: 0 0 10px;
  font-size: 1.05rem;
}
.housing-ai-side ul {
  list-style: disc;
  padding-left: 20px;
  margin: 0;
}
.housing-ai-side li {
  margin: 6px 0;
  font-size: 0.92rem;
  line-height: 1.55;
}

/* ===== Vote card / conclusion (S7) ===== */
.housing-vote {
  padding: 32px 0;
}
.housing-vote-card {
  padding: 24px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  text-align: center;
}
.housing-vote-question {
  font-size: clamp(1.2rem, 3vw, 1.5rem);
  margin: 0 0 16px;
}
.housing-vote-buttons {
  display: inline-flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}
.housing-vote-btn {
  padding: 10px 20px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  color: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
  font-family: inherit;
}
.housing-vote-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(139, 92, 246, 0.40);
}
.housing-vote-btn.is-selected {
  background: rgba(139, 92, 246, 0.18);
  border-color: rgba(139, 92, 246, 0.60);
  color: rgb(220, 200, 255);
}
.housing-vote-result {
  margin-top: 16px;
  font-size: 0.92rem;
  opacity: 0.85;
  min-height: 1.4em;
}

/* ===== Simulator page Hero (S1) ===== */
.housing-sim-hero {
  padding: clamp(40px, 6vw, 72px) 0 16px;
  background: linear-gradient(180deg, rgba(139, 92, 246, .10), transparent 70%);
}
.housing-sim-title {
  font-size: clamp(1.5rem, 3.8vw, 2.2rem);
  margin: 0 0 8px;
}
.housing-sim-subtitle {
  font-size: 0.95rem;
  opacity: 0.85;
  margin: 0 0 16px;
}

/* ===== Simulator inputs (S2) ===== */
.housing-sim-inputs {
  padding: 24px 0;
}
.housing-sim-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-top: 12px;
}
.housing-sim-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.housing-sim-field label {
  font-size: 0.85rem;
  opacity: 0.85;
}
.housing-sim-field input[type="number"],
.housing-sim-field select {
  padding: 10px 12px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  color: inherit;
  font-size: 1rem;
  font-variant-numeric: tabular-nums;
}
.housing-sim-field input[type="range"] {
  width: 100%;
  accent-color: rgb(139, 92, 246);
}
.housing-sim-field .range-value {
  font-size: 0.85rem;
  font-weight: 600;
  color: rgb(180, 200, 240);
  font-variant-numeric: tabular-nums;
}
.housing-sim-period-toggle {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
}
.housing-sim-period-btn {
  padding: 8px 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 999px;
  color: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.housing-sim-period-btn:hover {
  background: rgba(255, 255, 255, 0.08);
}
.housing-sim-period-btn.is-active {
  background: rgba(139, 92, 246, 0.18);
  border-color: rgba(139, 92, 246, 0.50);
  color: rgb(220, 200, 255);
}

/* ===== Mortgage output (S3) ===== */
.housing-sim-mortgage {
  padding: 24px 0;
  border-top: 1px dashed rgba(255, 255, 255, 0.08);
}
.housing-sim-output-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
}
.housing-sim-output-card {
  padding: 16px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.housing-sim-output-label {
  font-size: 0.85rem;
  opacity: 0.75;
  margin: 0 0 6px;
}
.housing-sim-output-value {
  font-size: 1.5rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: rgb(220, 200, 255);
}
.housing-sim-output-sub {
  font-size: 0.82rem;
  opacity: 0.7;
  margin: 4px 0 0;
}

/* ===== ETF 3-line chart (S4) — CSS only ===== */
.housing-sim-etf {
  padding: 24px 0;
  border-top: 1px dashed rgba(255, 255, 255, 0.08);
}
.housing-line-chart {
  position: relative;
  height: 220px;
  margin: 16px 0 8px;
  padding: 16px 12px;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.housing-line-grid {
  position: absolute;
  inset: 16px 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  pointer-events: none;
}
.housing-line-grid span {
  display: block;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.06);
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.4);
  font-variant-numeric: tabular-nums;
  padding-bottom: 2px;
}
.housing-line-bars {
  position: relative;
  height: 100%;
  display: flex;
  align-items: flex-end;
  gap: 4px;
}
.housing-line-bar-group {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  height: 100%;
  justify-content: flex-end;
}
.housing-line-bar {
  width: 100%;
  border-radius: 3px 3px 0 0;
  transition: height 0.4s ease;
}
.housing-line-bar.scenario-cons { background: rgb(34, 211, 238); }
.housing-line-bar.scenario-std  { background: rgb(139, 92, 246); }
.housing-line-bar.scenario-aggr { background: rgb(255, 61, 127); }
.housing-line-x-label {
  font-size: 0.7rem;
  opacity: 0.6;
  margin-top: 4px;
}
.housing-line-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 10px;
  font-size: 0.85rem;
}
.housing-line-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.housing-line-legend .swatch {
  width: 12px;
  height: 12px;
  border-radius: 3px;
}

/* ===== Period comparison (S5) ===== */
.housing-sim-period {
  padding: 24px 0;
  border-top: 1px dashed rgba(255, 255, 255, 0.08);
}
.housing-period-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
  font-size: 0.92rem;
}
.housing-period-table th,
.housing-period-table td {
  padding: 10px 12px;
  text-align: right;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  font-variant-numeric: tabular-nums;
}
.housing-period-table th:first-child,
.housing-period-table td:first-child {
  text-align: left;
}
.housing-period-table thead th {
  background: rgba(255, 255, 255, 0.03);
  font-weight: 600;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  opacity: 0.85;
}
.housing-period-table .is-country-default {
  background: rgba(139, 92, 246, 0.10);
  color: rgb(220, 200, 255);
  font-weight: 600;
}

/* ===== Compare house vs ETF (S6) — nominal/real toggle ===== */
.housing-sim-compare {
  padding: 24px 0;
  border-top: 1px dashed rgba(255, 255, 255, 0.08);
}
.housing-toggle-row {
  display: inline-flex;
  gap: 4px;
  background: rgba(0, 0, 0, 0.25);
  padding: 4px;
  border-radius: 999px;
  margin-bottom: 16px;
}
.housing-toggle-btn {
  padding: 6px 14px;
  background: transparent;
  border: 0;
  border-radius: 999px;
  color: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}
.housing-toggle-btn.is-active {
  background: rgba(139, 92, 246, 0.30);
  color: rgb(220, 200, 255);
}
.housing-compare-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 8px;
}
@media (max-width: 600px) {
  .housing-compare-grid { grid-template-columns: 1fr; }
}
.housing-compare-side {
  padding: 18px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.housing-compare-side h4 {
  margin: 0 0 8px;
  font-size: 1rem;
}
.housing-compare-side .big-num {
  font-size: 1.8rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: rgb(220, 200, 255);
}

/* ===== Disclaimer + sources (S7) ===== */
.housing-sim-disclaimer {
  padding: 24px 0 48px;
  font-size: 0.88rem;
  opacity: 0.85;
  font-style: italic;
}
.housing-sources-line {
  margin: 8px 0;
  font-size: 0.9rem;
  opacity: 0.85;
  font-style: normal;
}
.housing-sources-line a {
  color: rgb(180, 200, 240);
}

/* ===== 5-axis cross-link (housing 페이지용) ===== */
.housing-5axis {
  margin: 32px 0;
  padding: 20px 24px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 14px;
}
.housing-5axis h3 {
  margin: 0 0 8px;
  font-size: 1.05rem;
}
.housing-5axis-lede {
  font-size: 0.9rem;
  opacity: 0.75;
  margin: 0 0 12px;
}
.housing-5axis-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.housing-5axis-list .axis a,
.housing-5axis-list .axis > span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 0.9rem;
  text-decoration: none;
  color: inherit;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.housing-5axis-list .axis-active a {
  background: rgba(140, 200, 140, 0.10);
  border-color: rgba(140, 200, 140, 0.30);
  color: rgb(180, 230, 180);
}
.housing-5axis-list .axis-current > span {
  background: rgba(34, 211, 238, 0.15);
  border-color: rgba(34, 211, 238, 0.40);
  color: rgb(180, 230, 240);
  font-weight: 600;
}
.housing-5axis-list .axis-soon a {
  opacity: 0.7;
  background: rgba(255, 255, 255, 0.025);
}
.housing-5axis-list .axis-soon a:hover { opacity: 1; }
.housing-5axis-list .axis-icon { font-size: 1rem; }

/* ===== Section heads (charge.css 동일 패턴) ===== */
.housing-section-head h2 {
  font-size: clamp(1.3rem, 3vw, 1.8rem);
  margin: 0 0 6px;
}
.housing-section-head .lede {
  font-size: 0.95rem;
  opacity: 0.85;
  margin: 0 0 12px;
}

/* ===== sub-header housing chip 카테고리별 색 룰 폐기 (2026-05-27) — style.css 의 단일 .is-current 그라디언트로 통일 ===== */
