/* J2E MTR — Warm operator aesthetic. Terracotta, cream, sage, sunrise orange. */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,700;0,900;1,700&family=Plus+Jakarta+Sans:wght@400;500;600&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --cream:    #fdf6ed;
  --warm-bg:  #fef9f3;
  --card-bg:  #ffffff;
  --terra:    #c85c3a;
  --terra2:   #e07050;
  --sage:     #5a8a6a;
  --sage2:    #4a7a5a;
  --sunrise:  #f4a340;
  --sunrise2: #f7bc6a;
  --blush:    #f9ddd5;
  --text:     #2c1f18;
  --muted:    #8a7060;
  --border:   #e8ddd4;
  --shadow:   rgba(44,31,24,0.08);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--warm-bg);
  color: var(--text);
  font-family: 'Plus Jakarta Sans', sans-serif;
  min-height: 100vh;
  padding-bottom: 80px;
  position: relative;
  overflow-x: hidden;
}

/* Background blobs */
.bg-blob {
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.18;
  pointer-events: none;
  z-index: 0;
}
.blob1 { width: 500px; height: 500px; background: #f4a340; top: -100px; right: -100px; }
.blob2 { width: 400px; height: 400px; background: #c85c3a; bottom: 100px; left: -100px; }
.blob3 { width: 300px; height: 300px; background: #5a8a6a; top: 50%; right: 10%; }

/* ── Header ── */
.site-header {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 40px;
  background: rgba(253,246,237,0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  gap: 16px;
}

.logo { display: flex; align-items: baseline; gap: 6px; }
.logo-j2e {
  font-family: 'Playfair Display', serif;
  font-size: 28px;
  font-weight: 900;
  color: var(--terra);
  letter-spacing: -1px;
}
.logo-mtr {
  font-family: 'Playfair Display', serif;
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
}
.logo-dot { color: var(--sunrise); font-size: 24px; margin: 0 2px; }
.logo-sub { font-size: 11px; color: var(--muted); letter-spacing: 0.1em; text-transform: uppercase; font-family: 'JetBrains Mono', monospace; }

/* ── Tab Nav ── */
.tab-nav { display: flex; gap: 8px; flex-wrap: wrap; }
.tab-btn {
  padding: 8px 20px;
  border: 1.5px solid var(--border);
  border-radius: 100px;
  background: transparent;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.2s;
}
.tab-btn:hover { border-color: var(--terra2); color: var(--terra); }
.tab-btn.active { background: var(--terra); border-color: var(--terra); color: white; }

/* ── Panels ── */
.tab-panel {
  display: none;
  padding: 0 40px;
  position: relative;
  z-index: 1;
  animation: fadeUp 0.3s ease;
}
.tab-panel.active { display: block; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.panel-hero {
  padding: 48px 0 32px;
  max-width: 700px;
}
.panel-hero h1 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(32px, 5vw, 54px);
  line-height: 1.1;
  color: var(--text);
  margin-bottom: 12px;
}
.panel-hero h1 em { font-style: italic; color: var(--terra); }
.panel-sub { font-size: 15px; color: var(--muted); line-height: 1.6; }

/* ── Layout ── */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 24px;
}
@media (max-width: 700px) { .two-col { grid-template-columns: 1fr; } .site-header { padding: 16px 20px; } .tab-panel { padding: 0 20px; } }

/* ── Cards ── */
.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px;
  box-shadow: 0 2px 16px var(--shadow);
}
.full-card { margin-bottom: 24px; }
.card-eyebrow {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--terra);
  margin-bottom: 20px;
  font-weight: 500;
}

/* ── Form controls ── */
label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-top: 18px;
  margin-bottom: 8px;
}
label:first-of-type { margin-top: 0; }
.label-hint { font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--muted); opacity: 0.7; font-size: 11px; }

select, input[type="number"] {
  width: 100%;
  background: var(--cream);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 14px;
  padding: 11px 14px;
  appearance: none;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
select:focus, input[type="number"]:focus {
  border-color: var(--terra);
  box-shadow: 0 0 0 3px rgba(200,92,58,0.1);
}
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%238a7060' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
  cursor: pointer;
}

.chip-group { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  padding: 7px 16px;
  border: 1.5px solid var(--border);
  border-radius: 100px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  background: var(--cream);
  color: var(--muted);
  transition: all 0.15s;
  user-select: none;
}
.chip:hover { border-color: var(--terra2); color: var(--terra); }
.chip.active { background: var(--terra); border-color: var(--terra); color: white; }

.primary-btn {
  width: 100%;
  margin-top: 24px;
  padding: 14px;
  background: linear-gradient(135deg, var(--terra), var(--terra2));
  color: white;
  border: none;
  border-radius: 12px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 14px rgba(200,92,58,0.3);
}
.primary-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(200,92,58,0.4); }
.primary-btn:active { transform: translateY(0); }
.primary-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.error-msg {
  margin-top: 12px;
  padding: 10px 14px;
  background: #fdecea;
  border: 1.5px solid #f5c6c0;
  border-radius: 8px;
  color: var(--terra);
  font-size: 12px;
}

/* ── Result card ── */
.result-card { display: flex; flex-direction: column; }
.placeholder-msg { color: var(--muted); font-size: 13px; line-height: 1.7; padding: 12px 0; }

.big-number {
  font-family: 'Playfair Display', serif;
  font-size: 56px;
  font-weight: 900;
  color: var(--terra);
  line-height: 1;
  margin-bottom: 4px;
}
.big-number-sub {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 24px;
}

.breakdown-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 16px;
  padding: 16px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}
.brow { font-size: 13px; color: var(--muted); align-self: center; }
.bval { font-family: 'JetBrains Mono', monospace; font-size: 13px; text-align: right; }
.brow.bold, .bval.bold { font-weight: 600; color: var(--text); font-size: 14px; }
.bval.green  { color: var(--sage); }
.bval.coral  { color: var(--terra2); }
.bval.highlight { color: var(--terra); }

/* Range bar */
.range-section { margin-bottom: 16px; }
.range-labels { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; font-size: 12px; }
.range-mid-label { color: var(--muted); font-size: 11px; font-family: 'JetBrains Mono', monospace; letter-spacing: 0.08em; text-transform: uppercase; }
.mono { font-family: 'JetBrains Mono', monospace; font-size: 12px; color: var(--muted); }
.range-track { height: 6px; background: var(--cream); border: 1px solid var(--border); border-radius: 3px; position: relative; }
.range-fill { position: absolute; height: 100%; background: linear-gradient(90deg, var(--sunrise2), var(--sunrise)); border-radius: 3px; left: 0; width: 0; transition: width 0.4s ease; }
.range-dot { position: absolute; top: 50%; left: 0; transform: translate(-50%,-50%); width: 12px; height: 12px; border-radius: 50%; background: var(--terra); border: 2px solid white; box-shadow: 0 2px 6px var(--shadow); transition: left 0.4s ease; }

.info-box {
  background: var(--blush);
  border: 1.5px solid rgba(200,92,58,0.2);
  border-radius: 10px;
  padding: 14px 16px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.6;
}

/* ── Deal Analyzer ── */
.verdict-box {
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
  text-align: center;
}
.verdict-box.green  { background: #e8f5ec; border: 1.5px solid #a8d4b4; }
.verdict-box.yellow { background: #fff8e6; border: 1.5px solid #f4d67a; }
.verdict-box.teal   { background: #e6f4f4; border: 1.5px solid #7ac4c4; }
.verdict-box.red    { background: #fdecea; border: 1.5px solid #f5a8a0; }

.verdict-label {
  font-family: 'Playfair Display', serif;
  font-size: 28px;
  font-weight: 900;
  margin-bottom: 6px;
}
.verdict-box.green  .verdict-label { color: var(--sage2); }
.verdict-box.yellow .verdict-label { color: #b07a00; }
.verdict-box.teal   .verdict-label { color: #2a7a7a; }
.verdict-box.red    .verdict-label { color: var(--terra); }
.verdict-reason { font-size: 13px; color: var(--muted); line-height: 1.5; }

.metric-row {
  display: grid;
  grid-template-columns: repeat(4,1fr);
  gap: 8px;
  margin-bottom: 20px;
}
@media (max-width: 500px) { .metric-row { grid-template-columns: repeat(2,1fr); } }
.metric-cell {
  background: var(--cream);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  text-align: center;
}
.metric-val { font-family: 'JetBrains Mono', monospace; font-size: 14px; font-weight: 500; color: var(--text); margin-bottom: 4px; }
.metric-lbl { font-size: 10px; color: var(--muted); line-height: 1.3; }

.compare-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.compare-col { background: var(--cream); border: 1px solid var(--border); border-radius: 12px; padding: 16px; }
.flip-col { border-top: 3px solid var(--sunrise); }
.mtr-col  { border-top: 3px solid var(--sage); }
.compare-header { font-weight: 600; font-size: 13px; color: var(--text); margin-bottom: 12px; }
.compare-row { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); padding: 5px 0; border-bottom: 1px solid var(--border); }
.compare-row:last-child { border-bottom: none; }
.compare-row span:last-child { font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--text); }
.compare-row.total { font-weight: 600; color: var(--text); }
.compare-row.total span:last-child { color: var(--terra); font-size: 12px; }

/* ── Area Ratios ── */
.ratios-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 24px; margin-bottom: 24px; }
@media (max-width: 900px) { .ratios-grid { grid-template-columns: 1fr; } }

.ratio-row { display: grid; grid-template-columns: 1fr 120px 36px 80px; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.ratio-row:last-child { border-bottom: none; }
.ratio-area { font-size: 12px; color: var(--text); }
.ratio-bar-track { height: 6px; background: var(--cream); border: 1px solid var(--border); border-radius: 3px; overflow: hidden; }
.ratio-bar-fill { height: 100%; border-radius: 3px; transition: width 0.6s ease; }
.tier-competitive .ratio-bar-fill, .ratio-bar-fill.tier-competitive { background: var(--sage); }
.tier-moderate    .ratio-bar-fill, .ratio-bar-fill.tier-moderate    { background: var(--sunrise); }
.tier-value       .ratio-bar-fill, .ratio-bar-fill.tier-value       { background: var(--terra2); }

.ratio-val { font-family: 'JetBrains Mono', monospace; font-size: 13px; font-weight: 500; text-align: right; }
.tier-competitive.ratio-val { color: var(--sage); }
.tier-moderate.ratio-val    { color: #b07a00; }
.tier-value.ratio-val       { color: var(--terra); }

.ratio-tier-badge {
  font-size: 9px;
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 100px;
  text-align: center;
}
.tier-competitive.ratio-tier-badge { background: #e8f5ec; color: var(--sage2); }
.tier-moderate.ratio-tier-badge    { background: #fff8e6; color: #7a5500; }
.tier-value.ratio-tier-badge       { background: var(--blush); color: var(--terra); }

/* ── Tables ── */
.table-scroll { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: left;
  padding: 8px 12px;
  border-bottom: 1.5px solid var(--border);
}
.data-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); color: var(--text); }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--cream); }

.badge-HIGH { display:inline-block; padding:2px 10px; border-radius:100px; background:#e8f5ec; color:var(--sage2); font-size:10px; font-family:'JetBrains Mono',monospace; }
.badge-MID  { display:inline-block; padding:2px 10px; border-radius:100px; background:#fff8e6; color:#7a5500; font-size:10px; font-family:'JetBrains Mono',monospace; }
.badge-LOW  { display:inline-block; padding:2px 10px; border-radius:100px; background:var(--blush); color:var(--terra); font-size:10px; font-family:'JetBrains Mono',monospace; }

.muted { color: var(--muted); }

.trades-note {
  margin-top: 16px;
  padding: 12px 16px;
  background: var(--blush);
  border-radius: 8px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.6;
  border-left: 3px solid var(--terra2);
}
