/* =============================================
   AussieCalc.com.au — Design System
   Clean, fast, trustworthy finance utility
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&family=Fraunces:ital,opsz,wght@0,9..144,600;0,9..144,700;0,9..144,800;1,9..144,400&display=swap');

/* --- Variables --- */
:root {
  --navy: #0f2b3c;
  --navy-light: #1a3d52;
  --slate: #2c3e50;
  --teal: #00897b;
  --teal-light: #4db6ac;
  --teal-dark: #00695c;
  --gold: #f9a825;
  --gold-light: #fdd835;
  --white: #ffffff;
  --off-white: #f8f9fa;
  --grey-50: #fafafa;
  --grey-100: #f5f5f5;
  --grey-200: #eeeeee;
  --grey-300: #e0e0e0;
  --grey-400: #bdbdbd;
  --grey-500: #9e9e9e;
  --grey-600: #757575;
  --grey-700: #616161;
  --grey-800: #424242;
  --red: #e53935;
  --green: #43a047;

  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;

  --max-width: 800px;
  --header-height: 64px;
  --radius: 8px;
  --radius-lg: 12px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.12);
  --transition: 0.2s ease;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  color: var(--slate);
  background: var(--off-white);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--teal-dark); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--teal); }

/* --- Typography --- */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--navy);
  line-height: 1.25;
  font-weight: 700;
}

h1 { font-size: clamp(1.75rem, 4vw, 2.25rem); margin-bottom: 0.5rem; }
h2 { font-size: clamp(1.35rem, 3vw, 1.65rem); margin-top: 2rem; margin-bottom: 0.75rem; }
h3 { font-size: 1.15rem; margin-top: 1.5rem; margin-bottom: 0.5rem; }
p { margin-bottom: 1rem; }

.subtitle {
  font-size: 1.05rem;
  color: var(--grey-600);
  margin-bottom: 1.5rem;
  font-weight: 400;
}

/* --- Layout --- */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.25rem;
}

.container-wide {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

main {
  flex: 1;
  padding: 2rem 0 3rem;
}

/* --- Header --- */
.site-header {
  background: var(--navy);
  height: var(--header-height);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.25rem;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-logo {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--white);
  letter-spacing: -0.02em;
}

.site-logo span {
  color: var(--teal-light);
}

.header-nav {
  display: flex;
  gap: 1.5rem;
  list-style: none;
}

.header-nav a {
  color: rgba(255,255,255,0.8);
  font-size: 0.9rem;
  font-weight: 500;
  transition: color var(--transition);
}

.header-nav a:hover { color: var(--white); }

/* Mobile nav toggle */
.nav-toggle { display: none; background: none; border: none; cursor: pointer; padding: 0.5rem; }
.nav-toggle span { display: block; width: 22px; height: 2px; background: var(--white); margin: 5px 0; transition: var(--transition); }

@media (max-width: 640px) {
  .nav-toggle { display: block; }
  .header-nav {
    display: none;
    position: absolute;
    top: var(--header-height);
    left: 0;
    right: 0;
    background: var(--navy-light);
    flex-direction: column;
    padding: 1rem 1.25rem;
    gap: 0.75rem;
    box-shadow: var(--shadow-lg);
  }
  .header-nav.open { display: flex; }
}

/* --- Breadcrumbs --- */
.breadcrumbs {
  font-size: 0.85rem;
  color: var(--grey-500);
  margin-bottom: 1rem;
  padding: 0.75rem 0;
}

.breadcrumbs a { color: var(--grey-600); }
.breadcrumbs a:hover { color: var(--teal); }
.breadcrumbs span { margin: 0 0.4rem; }

/* --- Calculator Card --- */
.calc-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 2rem;
  margin-bottom: 2rem;
  border: 1px solid var(--grey-200);
}

.calc-card--highlight {
  border-top: 4px solid var(--teal);
}

/* --- Form Elements --- */
.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.35rem;
  color: var(--navy);
}

.form-group .hint {
  font-size: 0.8rem;
  color: var(--grey-500);
  margin-top: 0.2rem;
}

.form-input,
.form-select {
  width: 100%;
  padding: 0.7rem 0.9rem;
  border: 2px solid var(--grey-300);
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--slate);
  background: var(--white);
  transition: border-color var(--transition), box-shadow var(--transition);
  -webkit-appearance: none;
}

.form-input:focus,
.form-select:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(0,137,123,0.15);
}

.form-input::placeholder { color: var(--grey-400); }

/* Currency input wrapper */
.input-currency {
  position: relative;
}

.input-currency::before {
  content: '$';
  position: absolute;
  left: 0.9rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--grey-500);
  font-weight: 500;
  font-size: 1rem;
  pointer-events: none;
}

.input-currency .form-input {
  padding-left: 1.8rem;
}

/* Percentage input wrapper */
.input-percent {
  position: relative;
}

.input-percent::after {
  content: '%';
  position: absolute;
  right: 0.9rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--grey-500);
  font-weight: 500;
  pointer-events: none;
}

.input-percent .form-input {
  padding-right: 2rem;
}

/* Radio / toggle buttons */
.toggle-group {
  display: flex;
  gap: 0;
  border: 2px solid var(--grey-300);
  border-radius: var(--radius);
  overflow: hidden;
}

.toggle-group input[type="radio"] { display: none; }

.toggle-group label {
  flex: 1;
  padding: 0.6rem 1rem;
  text-align: center;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  border-right: 1px solid var(--grey-300);
  transition: all var(--transition);
  color: var(--grey-600);
  margin-bottom: 0;
}

.toggle-group label:last-of-type { border-right: none; }

.toggle-group input[type="radio"]:checked + label {
  background: var(--teal);
  color: var(--white);
  font-weight: 600;
}

/* --- Button --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.8rem 2rem;
  border: none;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  width: 100%;
}

.btn-primary {
  background: var(--teal);
  color: var(--white);
}

.btn-primary:hover {
  background: var(--teal-dark);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: var(--grey-100);
  color: var(--slate);
  border: 2px solid var(--grey-300);
}

.btn-secondary:hover {
  background: var(--grey-200);
}

/* --- Results Display --- */
.results-panel {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 100%);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  margin-top: 1.5rem;
  color: var(--white);
  display: none;
}

.results-panel.visible { display: block; }

.result-main {
  text-align: center;
  margin-bottom: 1.25rem;
}

.result-label {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.7;
  margin-bottom: 0.25rem;
}

.result-value {
  font-family: var(--font-display);
  font-size: clamp(2rem, 6vw, 2.75rem);
  font-weight: 800;
  color: var(--teal-light);
  line-height: 1.1;
}

.result-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.result-item {
  background: rgba(255,255,255,0.08);
  border-radius: var(--radius);
  padding: 0.9rem;
  text-align: center;
}

.result-item .result-label { font-size: 0.75rem; }

.result-item .result-value {
  font-size: 1.25rem;
  color: var(--white);
}

@media (max-width: 480px) {
  .result-grid { grid-template-columns: 1fr; }
}

/* --- Content Sections --- */
.content-section {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 2rem;
  margin-bottom: 1.5rem;
  border: 1px solid var(--grey-200);
}

.content-section h2 { margin-top: 0; }

.content-section ul, .content-section ol {
  padding-left: 1.5rem;
  margin-bottom: 1rem;
}

.content-section li { margin-bottom: 0.4rem; }

/* --- FAQ --- */
.faq-item {
  border-bottom: 1px solid var(--grey-200);
  padding: 1rem 0;
}

.faq-item:last-child { border-bottom: none; }

.faq-question {
  font-weight: 600;
  color: var(--navy);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  font-size: 0.95rem;
}

.faq-question::after {
  content: '+';
  font-size: 1.25rem;
  font-weight: 400;
  color: var(--teal);
  flex-shrink: 0;
  transition: transform var(--transition);
}

.faq-item.open .faq-question::after {
  content: '−';
}

.faq-answer {
  display: none;
  padding-top: 0.75rem;
  font-size: 0.92rem;
  color: var(--grey-700);
  line-height: 1.65;
}

.faq-item.open .faq-answer { display: block; }

/* --- Related Calculators --- */
.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}

.related-card {
  display: block;
  background: var(--grey-50);
  border: 1px solid var(--grey-200);
  border-radius: var(--radius);
  padding: 1.15rem;
  transition: all var(--transition);
}

.related-card:hover {
  border-color: var(--teal);
  box-shadow: var(--shadow-sm);
  transform: translateY(-2px);
}

.related-card h4 {
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
  color: var(--navy);
}

.related-card p {
  font-size: 0.8rem;
  color: var(--grey-600);
  margin-bottom: 0;
  line-height: 1.45;
}

/* --- Category Cards (Homepage) --- */
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.category-card {
  background: var(--white);
  border: 1px solid var(--grey-200);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  transition: all var(--transition);
}

.category-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--teal);
  transform: translateY(-2px);
}

.category-icon {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, var(--teal) 0%, var(--teal-dark) 100%);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.85rem;
  font-size: 1.3rem;
}

.category-card h3 {
  font-family: var(--font-body);
  font-size: 1.05rem;
  font-weight: 700;
  margin-top: 0;
  margin-bottom: 0.4rem;
}

.category-card p {
  font-size: 0.88rem;
  color: var(--grey-600);
  margin-bottom: 0.75rem;
  line-height: 1.5;
}

.category-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.category-links a {
  font-size: 0.8rem;
  color: var(--teal-dark);
  background: rgba(0,137,123,0.06);
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  transition: all var(--transition);
  font-weight: 500;
}

.category-links a:hover {
  background: rgba(0,137,123,0.12);
  color: var(--teal);
}

/* --- Ad Placeholder --- */
.ad-unit {
  background: var(--grey-100);
  border: 1px dashed var(--grey-300);
  border-radius: var(--radius);
  padding: 1rem;
  text-align: center;
  color: var(--grey-400);
  font-size: 0.8rem;
  margin: 1.5rem 0;
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* --- Footer --- */
.site-footer {
  background: var(--navy);
  color: rgba(255,255,255,0.6);
  padding: 2.5rem 0;
  margin-top: auto;
}

.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}

@media (max-width: 768px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 480px) {
  .footer-grid { grid-template-columns: 1fr; }
}

.footer-brand {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--white);
  margin-bottom: 0.5rem;
}

.footer-brand span { color: var(--teal-light); }

.footer-desc {
  font-size: 0.85rem;
  line-height: 1.55;
}

.footer-col h4 {
  color: var(--white);
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.75rem;
}

.footer-col ul {
  list-style: none;
}

.footer-col li { margin-bottom: 0.4rem; }

.footer-col a {
  color: rgba(255,255,255,0.6);
  font-size: 0.85rem;
  transition: color var(--transition);
}

.footer-col a:hover { color: var(--white); }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 1.5rem;
  font-size: 0.8rem;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* --- Disclaimer --- */
.disclaimer {
  background: #fff8e1;
  border-left: 4px solid var(--gold);
  padding: 1rem 1.25rem;
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 0.85rem;
  color: var(--grey-700);
  margin: 1.5rem 0;
  line-height: 1.55;
}

/* --- Hero (Homepage) --- */
.hero {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 60%, var(--teal-dark) 100%);
  padding: 3.5rem 0;
  color: var(--white);
  text-align: center;
}

.hero h1 {
  color: var(--white);
  font-size: clamp(2rem, 5vw, 2.75rem);
  margin-bottom: 0.75rem;
}

.hero p {
  font-size: 1.1rem;
  opacity: 0.85;
  max-width: 560px;
  margin: 0 auto 1.5rem;
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 2.5rem;
  margin-top: 1.5rem;
}

.hero-stat-value {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--teal-light);
}

.hero-stat-label {
  font-size: 0.8rem;
  opacity: 0.65;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

@media (max-width: 480px) {
  .hero-stats { flex-direction: column; gap: 1rem; }
  .hero { padding: 2.5rem 0; }
}

/* --- Utilities --- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}

.text-center { text-align: center; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }

/* --- Print --- */
@media print {
  .site-header, .site-footer, .ad-unit, .breadcrumbs { display: none; }
  .calc-card, .content-section { box-shadow: none; border: 1px solid #ccc; }
  .results-panel { color: #000; background: #f5f5f5 !important; -webkit-print-color-adjust: exact; }
  .result-value { color: #000 !important; }
}
