/* ============================================
   AU Sole Trader Tax Estimator - Design System
   Color: Blue #2563eb
   ============================================ */

:root {
  --color-primary: #2563eb;
  --color-bg: #ffffff;
  --color-surface: #f8f9fa;
  --color-text: #1a1a2e;
  --color-text-muted: #6b7280;
  --color-text-faint: #9ca3af;
  --color-primary: #2563eb;
  --color-primary-light: #60a5fa;
  --color-primary-dark: #1d4ed8;
  --color-success: #047857;
  --color-warning: #9a5400;
  --color-error: #dc2626;
  --color-border: #e5e7eb;
  --radius: 12px;
  --max-width: 1100px;
  --color-cta: #F97316;
}

[data-theme="dark"] {
  --color-bg: #0f172a;
  --color-surface: #1e293b;
  --color-text: #f1f5f9;
  --color-text-muted: #94a3b8;
  --color-text-faint: #64748b;
  --color-primary: #2563eb;
  --color-primary-light: #60a5fa;
  --color-primary-dark: #2563eb;
  --color-success: #10b981;
  --color-warning: #fbbf24;
  --color-error: #f87171;
  --color-border: #334155;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: system-ui, -apple-system, sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  min-height: 100vh;
}
a { color: var(--color-primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; }

/* ---------- Skip link ---------- */
.skip-link {
  position: absolute; top: -100%; left: 1rem;
  background: var(--color-primary); color: #fff;
  padding: 0.5rem 1rem; border-radius: var(--radius);
  z-index: 1000; font-weight: 600;
}
.skip-link:focus { top: 1rem; }

/* ---------- Announcement Bar ---------- */
.announcement-bar {
  background: #111827; color: rgba(255,255,255,0.85);
  text-align: center; padding: 0.5rem 1rem;
  font-size: 0.785rem; font-weight: 400;
  letter-spacing: 0.01em; line-height: 1.4;
}
.announcement-bar strong { font-weight: 600; color: #fff; }
.announcement-bar .ann-cta {
  color: #60a5fa; text-decoration: underline;
  text-underline-offset: 2px; font-weight: 500; margin-left: 0.35rem;
}
.announcement-bar .ann-cta:hover { color: #fff; }
.announcement-bar .ann-sep { margin: 0 0.4rem; opacity: 0.35; }
[data-theme="dark"] .announcement-bar { background: #1e293b; }
[data-theme="dark"] .announcement-bar .ann-cta { color: #60a5fa; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
  backdrop-filter: blur(10px);
}
.header-inner {
  max-width: var(--max-width); margin: 0 auto;
  padding: 0.75rem 1.5rem;
  display: flex; align-items: center; justify-content: space-between;
}
.logo { font-weight: 800; font-size: 1.2rem; color: var(--color-text); }
.logo:hover { text-decoration: none; }
.nav-links {
  list-style: none; display: flex; align-items: center; gap: 1.5rem;
}
.nav-links a { color: var(--color-text-muted); font-weight: 500; font-size: 0.95rem; }
.nav-links a:hover, .nav-links a.active { color: var(--color-primary); text-decoration: none; }

/* ---------- Mobile menu ---------- */
.mobile-toggle {
  display: none; background: none; border: none;
  font-size: 1.5rem; color: var(--color-text); cursor: pointer;
}
@media (max-width: 768px) {
  .mobile-toggle { display: block; }
  .nav-links {
    display: none; flex-direction: column;
    position: absolute; top: 100%; left: 0; right: 0;
    background: var(--color-bg); border-bottom: 1px solid var(--color-border);
    padding: 1rem; gap: 0.75rem;
  }
  .nav-links.open { display: flex; }
}

/* ---------- Theme toggle ---------- */
.theme-toggle {
  background: none; border: 1px solid var(--color-border);
  border-radius: 50%; width: 2rem; height: 2rem;
  cursor: pointer; color: var(--color-text); font-size: 1rem;
  display: flex; align-items: center; justify-content: center;
}

/* ---------- Hero ---------- */
.hero {
  padding: 3rem 1.5rem 2rem;
  max-width: var(--max-width);
  margin: 0 auto;
  text-align: center;
}
.hero h1 {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 1rem;
}
.hero .subtitle {
  font-size: 1.15rem;
  color: var(--color-text-muted);
  max-width: 600px;
  margin: 0 auto 1.5rem;
}

/* ---------- Calculator ---------- */
.calc-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem 3rem;
}
.calc-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: start;
}
@media (max-width: 768px) {
  .calc-grid { grid-template-columns: 1fr; }
}

.calc-panel {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.5rem;
}
.calc-panel h2 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* ---------- Form controls ---------- */
.form-group {
  margin-bottom: 1rem;
}
.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-text-muted);
  margin-bottom: 0.25rem;
}
.form-group select,
.form-group input[type="number"],
.form-group input[type="text"] {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-bg);
  color: var(--color-text);
  font-size: 0.95rem;
  font-family: inherit;
}
.form-group select:focus,
.form-group input:focus {
  outline: 2px solid var(--color-primary);
  outline-offset: -1px;
  border-color: var(--color-primary);
}

/* Input prefix for dollar sign */
.input-prefix {
  position: relative;
}
.input-prefix::before {
  content: "$";
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-text-muted);
  font-size: 1rem;
  font-weight: 600;
  pointer-events: none;
}
.input-prefix input {
  padding-left: 1.5rem;
}

/* Checkbox / toggle group */
.checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.checkbox-group label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  cursor: pointer;
  color: var(--color-text);
  font-weight: 400;
}
.checkbox-group input[type="checkbox"] {
  width: 1.1rem;
  height: 1.1rem;
  accent-color: var(--color-primary);
  cursor: pointer;
}

/* ---------- Results panel ---------- */
.results-panel {
  position: sticky;
  top: 5rem;
}
.result-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--color-border);
  font-size: 0.9rem;
}
.result-row:last-child { border-bottom: none; }
.result-row .label { color: var(--color-text-muted); }
.result-row .value { font-weight: 700; font-variant-numeric: tabular-nums; }
.result-row.deduction .value { color: var(--color-error); }
.result-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
  border-top: 2px solid var(--color-primary);
  margin-top: 0.5rem;
  font-size: 1.15rem;
}
.result-total .value {
  font-weight: 800;
  font-size: 1.4rem;
  color: var(--color-primary);
}

/* Result highlight boxes */
.result-highlight {
  background: color-mix(in srgb, var(--color-primary) 10%, var(--color-surface));
  border-radius: 8px;
  padding: 1rem;
  margin-top: 1rem;
}
.result-highlight-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-top: 0.75rem;
}
.result-highlight-item {
  text-align: center;
}
.result-highlight-item .rh-label {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  margin-bottom: 0.15rem;
}
.result-highlight-item .rh-value {
  font-weight: 700;
  font-size: 1.15rem;
}

/* GST warning */
.gst-warning {
  background: #fef3c7;
  border: 1px solid #f59e0b;
  border-radius: 8px;
  padding: 0.75rem 1rem;
  margin-top: 1rem;
  font-size: 0.85rem;
  color: #92400e;
  display: none;
}
[data-theme="dark"] .gst-warning {
  background: #451a03;
  border-color: #d97706;
  color: #fde68a;
}

/* ---------- Buy button ---------- */
.buy-btn, .hero-cta {
  display: inline-block;
  background: var(--color-primary);
  color: #fff;
  padding: 0.75rem 2rem;
  border-radius: var(--radius);
  font-weight: 700;
  font-size: 1.1rem;
  border: none;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}
.buy-btn:hover, .hero-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  text-decoration: none;
  color: #fff;
}

/* ---------- Info sections ---------- */
.info-section {
  max-width: var(--max-width);
  margin: 3rem auto;
  padding: 0 1.5rem;
}
.info-section h2 {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 1.5rem;
}
.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}
.info-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.5rem;
}
.info-card h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}
.info-card p {
  color: var(--color-text-muted);
  font-size: 0.9rem;
}

/* ---------- Tax brackets table ---------- */
.tax-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  margin: 1.5rem 0;
}
.tax-table th,
.tax-table td {
  padding: 0.6rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--color-border);
}
.tax-table th {
  font-weight: 700;
  background: var(--color-surface);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--color-text-muted);
}
.tax-table td { font-variant-numeric: tabular-nums; }
.tax-table tr:hover td { background: color-mix(in srgb, var(--color-primary) 5%, var(--color-bg)); }

/* ---------- Content page ---------- */
.content-page {
  max-width: 700px;
  margin: 0 auto;
  padding: 3rem 1.5rem;
}
.content-page h1 {
  font-size: 1.8rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
}
.content-page h2 {
  font-size: 1.2rem;
  font-weight: 700;
  margin: 2rem 0 0.75rem;
}
.content-page h3 {
  font-size: 1rem;
  font-weight: 700;
  margin: 1.5rem 0 0.5rem;
}
.content-page p {
  color: var(--color-text-muted);
  margin-bottom: 0.75rem;
}
.content-page ul, .content-page ol {
  color: var(--color-text-muted);
  margin: 0.5rem 0 1rem 1.5rem;
  font-size: 0.9rem;
}
.content-page li {
  margin-bottom: 0.35rem;
}

/* ---------- Footer ---------- */
.site-footer {
  margin-top: 4rem; padding: 2rem 1.5rem;
  border-top: 1px solid var(--color-border);
  background: var(--color-surface);
}
.footer-inner {
  max-width: var(--max-width); margin: 0 auto;
  display: flex; flex-wrap: wrap; gap: 2rem;
}
.footer-brand { flex: 2; min-width: 200px; }
.footer-brand h3 { font-size: 1.1rem; margin-bottom: 0.5rem; }
.footer-brand p { color: var(--color-text-muted); font-size: 0.9rem; }
.footer-links { flex: 1; min-width: 120px; }
.footer-links h4 { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--color-text-muted); margin-bottom: 0.5rem; }
.footer-links ul { list-style: none; }
.footer-links li { margin-bottom: 0.35rem; }
.footer-links a { color: var(--color-text-muted); font-size: 0.9rem; }
.footer-links a:hover { color: var(--color-primary); }

/* ---------- Cross-sell ---------- */
.footer-products {
  max-width: var(--max-width); margin: 1.5rem auto 0;
  padding-top: 1rem; border-top: 1px solid var(--color-border);
  text-align: center;
}
.footer-products h4 {
  font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--color-text-muted); margin-bottom: 0.5rem;
}
.footer-products-list {
  list-style: none; display: flex; flex-wrap: wrap;
  gap: 0.5rem 1.5rem; justify-content: center; font-size: 0.85rem;
}
.footer-products-list a { color: var(--color-text-muted); }
.footer-products-list a:hover { color: var(--color-primary); }
.product-dot {
  display: inline-block; width: 8px; height: 8px;
  border-radius: 50%; margin-right: 0.35rem;
}

/* ---------- Footer bottom ---------- */
.footer-bottom {
  max-width: var(--max-width); margin: 1rem auto 0;
  text-align: center; font-size: 0.85rem; color: var(--color-text-muted);
}

/* ---------- Scroll reveal ---------- */
[data-reveal] { opacity: 0; transform: translateY(20px); transition: opacity 0.5s, transform 0.5s; }
[data-reveal].visible { opacity: 1; transform: translateY(0); }

/* ---------- FAQ ---------- */
.faq-section { max-width: 700px; margin: 3rem auto; padding: 0 1.5rem; }
.faq-item { border-bottom: 1px solid var(--color-border); padding: 1rem 0; }
.faq-item summary { cursor: pointer; font-weight: 600; list-style: none; }
.faq-item summary::before { content: "+ "; color: var(--color-primary); }
.faq-item[open] summary::before { content: "- "; }
.faq-answer { margin-top: 0.5rem; color: var(--color-text-muted); }

/* ---------- Disclaimer ---------- */
.disclaimer {
  max-width: var(--max-width);
  margin: 2rem auto;
  padding: 1rem 1.5rem;
  font-size: 0.75rem;
  color: var(--color-text-muted);
  text-align: center;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
}

/* ---------- Utility ---------- */
.container { max-width: var(--max-width); margin: 0 auto; padding: 0 1.5rem; }
.text-center { text-align: center; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-4 { margin-top: 2rem; }


/* === SPACING + SHADOW TOKENS (UI/UX Pro Max audit) === */
:root {
  --space-xs:  0.25rem;
  --space-sm:  0.5rem;
  --space-md:  1rem;
  --space-lg:  1.5rem;
  --space-xl:  2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;

  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.07);
  --shadow-lg: 0 10px 15px rgba(0,0,0,0.10);
  --shadow-xl: 0 20px 25px rgba(0,0,0,0.12);

  --transition: 200ms ease;
}


/* === FOCUS-VISIBLE ACCESSIBILITY (UI/UX Pro Max audit) === */
*:focus { outline: none; }
*:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
  border-radius: 4px;
}


/* === CARD HOVER (UI/UX Pro Max audit) === */
.card {
  transition: box-shadow var(--transition, 200ms ease),
              transform var(--transition, 200ms ease);
}
.card:hover {
  box-shadow: var(--shadow-lg, 0 10px 15px rgba(0,0,0,0.10));
  transform: translateY(-2px);
}


/* === INPUT FOCUS (UI/UX Pro Max audit) === */
input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):focus,
select:focus, textarea:focus {
  outline: none;
  border-color: var(--color-primary) !important;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-primary) 20%, transparent);
}
