:root {
  --navy: #0d2338;
  --navy-2: #123049;
  --gold: #c8a24b;
  --gold-soft: #f4ead3;
  --bg: #f5f7fa;
  --card: #ffffff;
  --text: #1c2b3a;
  --muted: #5d6f80;
  --border: #dde4eb;
  --ok: #177a4c;
  --ok-bg: #e4f4ec;
  --warn: #9a6a00;
  --warn-bg: #fdf3d7;
  --err: #b3261e;
  --err-bg: #fdecea;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(13, 35, 56, 0.08), 0 6px 18px rgba(13, 35, 56, 0.06);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

a { color: inherit; }

/* ---------- header / footer ---------- */

.site-header {
  background: var(--navy);
  color: #fff;
  border-bottom: 3px solid var(--gold);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  padding-bottom: 14px;
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 8px;
  text-decoration: none;
  font-weight: 700;
  font-size: 1.2rem;
  letter-spacing: 0.2px;
}

.brand .brand-au {
  color: var(--gold);
  font-size: 0.85rem;
  font-weight: 600;
}

.site-nav a {
  color: #cdd9e4;
  text-decoration: none;
  font-size: 0.95rem;
  margin-left: 20px;
}

.site-nav a:hover, .site-nav a.active { color: #fff; }

.site-footer {
  margin-top: auto;
  background: var(--navy);
  color: #9fb2c2;
  font-size: 0.85rem;
  padding: 22px 0;
}

.footer-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 24px;
  justify-content: space-between;
}

.footer-attribution {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.footer-attribution a {
  color: #e3d3a6;
  text-decoration: none;
  border-bottom: 1px dotted rgba(227, 211, 166, 0.6);
}

.footer-attribution a:hover { color: #fff; }

/* ---------- demo notice ---------- */

.notice {
  background: var(--warn-bg);
  border: 1px solid #ecd9a0;
  color: var(--warn);
  border-radius: var(--radius);
  padding: 12px 16px;
  font-size: 0.9rem;
  margin-bottom: 28px;
}

.notice strong { color: #7c5600; }
.notice a { color: inherit; }

/* ---------- layout ---------- */

.container {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding-left: 20px;
  padding-right: 20px;
}

.page { padding: 36px 0 56px; }

.hero { max-width: 720px; margin-bottom: 32px; }

.hero h1 { font-size: 1.9rem; margin: 0 0 8px; color: var(--navy); }
.hero p { margin: 0; color: var(--muted); font-size: 1.05rem; }

.breadcrumb {
  font-size: 0.88rem;
  color: var(--muted);
  margin-bottom: 10px;
}

.breadcrumb a { color: var(--muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--navy); }

/* ---------- tool cards ---------- */

.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 18px;
}

.tool-card {
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  text-decoration: none;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.tool-card:hover { transform: translateY(-2px); box-shadow: 0 4px 8px rgba(13,35,56,0.1), 0 10px 26px rgba(13,35,56,0.1); }

.tool-card .tool-tagline {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gold);
  font-weight: 700;
  margin-bottom: 6px;
}

.tool-card h2 { font-size: 1.15rem; margin: 0 0 8px; color: var(--navy); }
.tool-card p { margin: 0 0 16px; color: var(--muted); font-size: 0.93rem; flex: 1; }

.tool-card .tool-cta { font-size: 0.92rem; font-weight: 600; color: var(--navy); }
.tool-card .tool-cta::after { content: " →"; }

.tool-card.soon { opacity: 0.6; pointer-events: none; }
.tool-card.soon .tool-cta::after { content: ""; }

/* ---------- calculator page ---------- */

.calc-layout {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: 22px;
  align-items: start;
}

.panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
}

.panel h2 {
  margin: 0 0 4px;
  font-size: 1.05rem;
  color: var(--navy);
}

.panel .panel-sub { margin: 0 0 18px; font-size: 0.87rem; color: var(--muted); }

.field { margin-bottom: 16px; }

.field label {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--navy-2);
}

.field .hint { font-weight: 400; color: var(--muted); font-size: 0.8rem; }

.input-wrap {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.input-wrap:focus-within { border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-soft); }

.input-wrap .affix {
  display: flex;
  align-items: center;
  padding: 0 12px;
  background: #f0f3f7;
  color: var(--muted);
  font-size: 0.9rem;
  border-right: 1px solid var(--border);
  white-space: nowrap;
}

.input-wrap .affix.right { border-right: none; border-left: 1px solid var(--border); }

.input-wrap input {
  border: none;
  outline: none;
  padding: 10px 12px;
  font-size: 1rem;
  width: 100%;
  min-width: 0;
  color: var(--text);
  background: transparent;
}

/* yes/no segmented control */

.segmented {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.segmented label {
  position: relative;
  margin: 0;
  font-weight: 600;
  font-size: 0.92rem;
}

.segmented input { position: absolute; opacity: 0; pointer-events: none; }

.segmented span {
  display: inline-block;
  padding: 9px 26px;
  cursor: pointer;
  color: var(--muted);
  background: #fff;
  border-right: 1px solid var(--border);
  transition: background 0.12s ease, color 0.12s ease;
}

.segmented label:last-child span { border-right: none; }
.segmented input:checked + span { background: var(--navy); color: #fff; }
.segmented input:focus-visible + span { box-shadow: inset 0 0 0 3px var(--gold-soft); }

.button {
  display: inline-block;
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: 8px;
  background: var(--navy);
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.12s ease;
}

.button:hover { background: var(--navy-2); }
.button:disabled { opacity: 0.6; cursor: wait; }

.form-error {
  display: none;
  margin: 0 0 14px;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--err-bg);
  color: var(--err);
  font-size: 0.88rem;
}

.form-error.show { display: block; }

/* ---------- results ---------- */

.result-hero {
  background: var(--navy);
  color: #fff;
  border-radius: var(--radius);
  padding: 20px 22px;
  margin-bottom: 18px;
}

.result-hero .label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gold);
  font-weight: 700;
  margin-bottom: 4px;
}

.result-hero .value { font-size: 2rem; font-weight: 700; line-height: 1.2; }
.result-hero .sub { font-size: 0.88rem; color: #b9c7d4; margin-top: 4px; }

.result-rows { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 18px; }

.result-row {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  background: #fbfcfe;
}

.result-row .label { font-size: 0.78rem; color: var(--muted); margin-bottom: 2px; }
.result-row .value { font-size: 1.05rem; font-weight: 600; color: var(--navy); }

.message { display: flex; align-items: center; gap: 8px; border-radius: 8px; padding: 10px 14px; font-size: 0.9rem; font-weight: 600; margin-bottom: 8px; }
.message::before { content: ""; width: 9px; height: 9px; border-radius: 50%; flex: none; }
.message.ok { background: var(--ok-bg); color: var(--ok); }
.message.ok::before { background: var(--ok); }
.message.warn { background: var(--warn-bg); color: var(--warn); }
.message.warn::before { background: var(--warn); }

.disclaimer {
  margin-top: 16px;
  font-size: 0.78rem;
  color: var(--muted);
  border-top: 1px solid var(--border);
  padding-top: 12px;
}

.placeholder {
  color: var(--muted);
  font-size: 0.92rem;
  text-align: center;
  padding: 40px 0;
}

/* ---------- responsive ---------- */

@media (max-width: 860px) {
  .calc-layout { grid-template-columns: 1fr; }
  .hero h1 { font-size: 1.55rem; }
}

@media (max-width: 480px) {
  .result-rows { grid-template-columns: 1fr; }
  .result-hero .value { font-size: 1.6rem; }
}
