/* Finance Blueprint AU — Shared Stylesheet */

:root {
  --primary:       #0C447C;
  --primary-dark:  #083561;
  --primary-light: #1a5fa3;
  --primary-bg:    #e8f0f8;
  --success:       #1e7e40;
  --success-bg:    #e8f5ec;
  --danger:        #b91c1c;
  --danger-bg:     #fef2f2;
  --warning:       #92400e;
  --warning-bg:    #fffbeb;
  --neutral-bg:    #f0f4f8;
  --text:          #111827;
  --text-muted:    #4b5563;
  --border:        #d1d9e0;
  --white:         #ffffff;
  --radius:        8px;
  --radius-lg:     14px;
  --shadow-sm:     0 1px 3px rgba(0,0,0,0.07);
  --shadow:        0 2px 8px rgba(12,68,124,0.09), 0 1px 3px rgba(0,0,0,0.06);
  --shadow-hover:  0 6px 20px rgba(12,68,124,0.15);
  --font:          -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: var(--font);
  color: var(--text);
  background: #f8fafc;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }

/* ── Typography ── */
h1 { font-size: clamp(1.5rem, 4vw, 2.25rem); font-weight: 700; line-height: 1.2; }
h2 { font-size: clamp(1.2rem, 3vw, 1.6rem); font-weight: 700; line-height: 1.3; }
h3 { font-size: 1.1rem; font-weight: 600; }
p  { margin-bottom: 0.75rem; }
p:last-child { margin-bottom: 0; }

/* ── Layout ── */
.container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* ── Header / Nav ── */
.header {
  background: var(--primary);
  color: var(--white);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  gap: 1rem;
}
.logo {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--white);
  text-decoration: none;
  white-space: nowrap;
  letter-spacing: -0.02em;
}
.logo:hover { text-decoration: none; opacity: 0.9; }
.logo span { color: #7db8ef; }

.nav-list {
  list-style: none;
  display: flex;
  gap: 0.15rem;
  flex-wrap: nowrap;
  align-items: center;
}
.nav-list a {
  color: rgba(255,255,255,0.85);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 500;
  padding: 0.35rem 0.6rem;
  border-radius: var(--radius);
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}
.nav-list a:hover,
.nav-list a.active {
  background: rgba(255,255,255,0.15);
  color: var(--white);
  text-decoration: none;
}

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid rgba(255,255,255,0.4);
  color: var(--white);
  font-size: 1.25rem;
  padding: 0.3rem 0.6rem;
  border-radius: var(--radius);
  cursor: pointer;
  flex-shrink: 0;
}

/* ── Hero ── */
.hero {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 60%, var(--primary-light) 100%);
  color: var(--white);
  padding: 3.5rem 0 3rem;
  text-align: center;
}
.hero h1 { margin-bottom: 0.75rem; }
.hero p  { font-size: 1.1rem; color: rgba(255,255,255,0.88); max-width: 560px; margin: 0 auto 1.25rem; }

.banner {
  background: #fef3c7;
  color: #78350f;
  border: 1px solid #fcd34d;
  border-radius: var(--radius);
  padding: 0.65rem 1rem;
  font-size: 0.9rem;
  font-weight: 500;
  display: inline-block;
  margin-top: 0.5rem;
}

/* ── Cards grid ── */
.cards-section { padding: 2.5rem 0; }
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
  margin-top: 1.5rem;
}
.card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: box-shadow 0.2s, transform 0.2s;
  border: 1px solid var(--border);
}
.card:hover { box-shadow: var(--shadow-hover); transform: translateY(-2px); }
.card-icon { font-size: 2rem; }
.card h3 { color: var(--primary); margin: 0; }
.card p  { color: var(--text-muted); font-size: 0.9rem; margin: 0; flex: 1; }
.card .btn { align-self: flex-start; margin-top: auto; }

/* ── About section ── */
.about-section {
  background: var(--white);
  padding: 2.5rem 0;
  border-top: 1px solid var(--border);
}
.about-section h2 { margin-bottom: 0.75rem; color: var(--primary); }
.about-section p  { color: var(--text-muted); max-width: 680px; }

/* ── Page header ── */
.page-header {
  background: var(--primary);
  color: var(--white);
  padding: 2rem 0 1.75rem;
}
.page-header h1 { margin-bottom: 0.35rem; }
.page-header p  { color: rgba(255,255,255,0.85); margin: 0; font-size: 1rem; }

/* ── Calculator layout ── */
.calc-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  padding: 2rem 0 3rem;
  align-items: start;
}
.calc-panel {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  overflow: hidden;
}
.panel-header {
  background: var(--neutral-bg);
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  color: var(--primary);
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.panel-body { padding: 1.25rem; }

/* ── Form controls ── */
.form-group { margin-bottom: 1.1rem; }
.form-group:last-child { margin-bottom: 0; }
label.field-label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.45rem;
}
.input-wrap { position: relative; }
.input-prefix {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-weight: 500;
  pointer-events: none;
}
input[type="number"],
input[type="text"],
input[type="date"],
select {
  width: 100%;
  padding: 0.65rem 0.9rem 0.65rem 1.8rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 1rem;
  color: var(--text);
  background: var(--white);
  transition: border-color 0.15s, box-shadow 0.15s;
  appearance: none;
  -webkit-appearance: none;
  font-family: var(--font);
}
input[type="number"].no-prefix,
input[type="text"].no-prefix,
input[type="date"].no-prefix,
select.no-prefix {
  padding-left: 0.9rem;
}
input:focus, select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(12,68,124,0.1);
}
input[type="number"] { font-variant-numeric: tabular-nums; }
select.no-prefix { padding-left: 0.9rem; }

/* ── Toggle switch ── */
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--border);
  gap: 1rem;
}
.toggle-row:last-child { border-bottom: none; }
.toggle-row-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.95rem;
  font-weight: 500;
  flex: 1;
}
.toggle-wrap {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
}
.toggle-switch {
  position: relative;
  width: 44px;
  height: 24px;
  background: #d1d9e0;
  border-radius: 12px;
  transition: background 0.25s;
  flex-shrink: 0;
  cursor: pointer;
}
.toggle-switch::after {
  content: '';
  position: absolute;
  width: 20px; height: 20px;
  background: var(--white);
  border-radius: 50%;
  top: 2px; left: 2px;
  transition: left 0.25s;
  box-shadow: 0 1px 4px rgba(0,0,0,0.25);
}
input[type="checkbox"].toggle-input { display: none; }
input[type="checkbox"].toggle-input:checked + .toggle-switch {
  background: var(--primary);
}
input[type="checkbox"].toggle-input:checked + .toggle-switch::after {
  left: 22px;
}

/* ── Collapsible reveal ── */
.reveal-section {
  background: var(--primary-bg);
  border-radius: var(--radius);
  padding: 0.9rem 1rem;
  margin-top: 0.6rem;
  display: none;
  border: 1px solid rgba(12,68,124,0.15);
}
.reveal-section.open { display: block; }
.reveal-section .form-group { margin-bottom: 0.75rem; }
.reveal-section .form-group:last-child { margin-bottom: 0; }
.reveal-hint { font-size: 0.8rem; color: var(--text-muted); margin-top: 0.25rem; }

/* ── Results panel ── */
.results-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  color: var(--text-muted);
  font-size: 0.9rem;
  gap: 0.5rem;
  padding: 2rem;
}
.results-placeholder svg { opacity: 0.3; }

.result-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.95rem;
  gap: 1rem;
}
.result-row:last-child { border-bottom: none; }
.result-label { color: var(--text-muted); display: flex; align-items: center; gap: 0.4rem; }
.result-value { font-weight: 600; font-variant-numeric: tabular-nums; }
.result-value.success { color: var(--success); }
.result-value.danger  { color: var(--danger); }
.result-value.primary { color: var(--primary); }
.result-value.muted   { color: var(--text-muted); }

.takehome-block {
  background: var(--success-bg);
  border: 2px solid var(--success);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  margin-top: 1rem;
  text-align: center;
}
.takehome-label { font-size: 0.82rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--success); margin-bottom: 0.25rem; }
.takehome-amount { font-size: 2rem; font-weight: 700; color: var(--success); font-variant-numeric: tabular-nums; }
.takehome-sub { display: flex; justify-content: center; gap: 1.5rem; margin-top: 0.5rem; font-size: 0.85rem; color: var(--text-muted); }
.takehome-sub span { font-weight: 600; color: var(--text); }

.divider { border: none; border-top: 2px solid var(--border); margin: 0.75rem 0; }

/* ── Comparison blocks ── */
.compare-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin: 0.75rem 0;
}
.compare-box {
  background: var(--neutral-bg);
  border-radius: var(--radius);
  padding: 0.9rem;
  border: 1.5px solid var(--border);
}
.compare-box.highlight { background: var(--success-bg); border-color: var(--success); }
.compare-box h4 { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); margin-bottom: 0.4rem; }
.compare-box .amount { font-size: 1.4rem; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--text); }
.compare-box.highlight .amount { color: var(--success); }
.compare-box .sub { font-size: 0.8rem; color: var(--text-muted); margin-top: 0.2rem; }

/* ── Alert / info boxes ── */
.alert {
  padding: 0.85rem 1rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  margin: 0.75rem 0;
  border-left: 4px solid;
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
}
.alert-info    { background: var(--primary-bg); color: #1e3a5f; border-color: var(--primary); }
.alert-success { background: var(--success-bg); color: #14532d; border-color: var(--success); }
.alert-warning { background: var(--warning-bg); color: var(--warning); border-color: #f59e0b; }
.alert-danger  { background: var(--danger-bg);  color: #991b1b;  border-color: var(--danger); }
.alert-icon { font-size: 1rem; flex-shrink: 0; line-height: 1.5; }

/* ── Explainer ── */
.explainer {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  padding: 1.5rem;
  margin-top: 1.5rem;
}
.explainer h3 { color: var(--primary); margin-bottom: 0.75rem; }
.explainer p  { color: var(--text-muted); font-size: 0.93rem; }

/* ── Tooltip ── */
.tip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px; height: 16px;
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--primary);
  border: 1.5px solid var(--primary);
  border-radius: 50%;
  cursor: help;
  position: relative;
  flex-shrink: 0;
  vertical-align: middle;
  line-height: 1;
}
.tip::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: #1f2937;
  color: var(--white);
  font-size: 0.75rem;
  font-weight: 400;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  white-space: normal;
  width: 220px;
  line-height: 1.4;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
  z-index: 200;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}
.tip::before {
  content: '';
  position: absolute;
  bottom: calc(100% + 1px);
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: #1f2937;
  opacity: 0;
  transition: opacity 0.15s;
  pointer-events: none;
  z-index: 200;
}
.tip:hover::after,
.tip:hover::before { opacity: 1; }

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.6rem 1.25rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border: 2px solid transparent;
  transition: background 0.15s, box-shadow 0.15s, transform 0.1s;
  text-decoration: none;
  white-space: nowrap;
  font-family: var(--font);
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary {
  background: var(--primary);
  color: var(--white);
  border-color: var(--primary);
}
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn-outline {
  background: transparent;
  color: var(--primary);
  border-color: var(--primary);
}
.btn-outline:hover { background: var(--primary-bg); }
.btn-sm { padding: 0.4rem 0.85rem; font-size: 0.82rem; }
.btn-full { width: 100%; }

/* ── See Full Tax CTA ── */
.cta-row {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  text-align: center;
}

/* ── Section label ── */
.section-label {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin: 1.1rem 0 0.35rem;
}
.section-label:first-child { margin-top: 0; }

/* ── Print button ── */
.print-row { text-align: right; margin-bottom: 0.75rem; }

/* ── Footer ── */
.footer {
  background: var(--primary-dark);
  color: rgba(255,255,255,0.7);
  text-align: center;
  padding: 1.25rem 0;
  font-size: 0.82rem;
  border-top: 3px solid rgba(255,255,255,0.08);
}
.footer p { margin-bottom: 0.35rem; }
.footer p:last-child { margin-bottom: 0; }
.footer a { color: rgba(255,255,255,0.85); text-decoration: underline; }
.footer a:hover { color: var(--white); }
.footer-links { margin-top: 0.35rem; opacity: 0.85; }

/* ── Summary stat grid (HECS, etc.) ── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.75rem;
  margin: 0.75rem 0;
}
.stat-box {
  background: var(--neutral-bg);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  border: 1.5px solid var(--border);
}
.stat-box .stat-label { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); margin-bottom: 0.25rem; }
.stat-box .stat-value { font-size: 1.35rem; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--text); }
.stat-box.success-box { background: var(--success-bg); border-color: var(--success); }
.stat-box.success-box .stat-value { color: var(--success); }
.stat-box.danger-box  { background: var(--danger-bg);  border-color: var(--danger); }
.stat-box.danger-box  .stat-value { color: var(--danger); }
.stat-box.primary-box { background: var(--primary-bg); border-color: var(--primary); }
.stat-box.primary-box .stat-value { color: var(--primary); }

/* ── Recommendation box ── */
.recommendation {
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  text-align: center;
  margin: 1rem 0;
}
.recommendation.save { background: var(--success-bg); border: 2px solid var(--success); color: var(--success); }
.recommendation.cost { background: var(--danger-bg); border: 2px solid var(--danger); color: var(--danger); }
.recommendation h3 { font-size: 1.25rem; margin-bottom: 0.25rem; }
.recommendation p  { font-size: 0.88rem; opacity: 0.85; margin: 0; }

/* ── LHC warning ── */
.lhc-warning {
  display: none;
  background: var(--warning-bg);
  border: 1.5px solid #f59e0b;
  border-radius: var(--radius);
  padding: 0.8rem 1rem;
  font-size: 0.88rem;
  color: var(--warning);
  margin-top: 0.5rem;
}

/* ── Section titles ── */
.section-title { color: var(--primary); margin-bottom: 0.5rem; }

/* ── Print styles ── */
@media print {
  .header, .footer, .btn, .print-row, .cta-row, #nav-placeholder, .explainer { display: none !important; }
  .calc-layout { grid-template-columns: 1fr; }
  .calc-panel { box-shadow: none; border: 1px solid #ccc; }
  body { background: white; }
}

/* ── Responsive ── */
@media (max-width: 820px) {
  .calc-layout {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 640px) {
  .nav-list { display: none; flex-direction: column; gap: 0.25rem; }
  .nav-list.open { display: flex; }
  .header-inner { flex-wrap: wrap; height: auto; padding: 0.75rem 0; }
  .nav-toggle { display: block; }
  .nav { width: 100%; }
  .nav-list {
    width: 100%;
    padding: 0.5rem 0 0.75rem;
  }
  .nav-list a { display: block; padding: 0.5rem 0.75rem; }
  .hero { padding: 2rem 0 1.75rem; }
  .compare-grid { grid-template-columns: 1fr; }
  .takehome-sub { flex-direction: column; gap: 0.35rem; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .cards-grid { grid-template-columns: 1fr; }
}
@media (max-width: 390px) {
  .container { padding: 0 0.9rem; }
  .panel-body { padding: 1rem; }
  .calc-layout { gap: 1rem; }
}
