/* =============================================
   Tax Calculator Suite — Shared Styles
   ============================================= */

:root {
  /* ── Brand colours ── */
  --primary:        #11A2D7;   /* sky blue */
  --primary-dark:   #0c89b8;   /* hover / topbar */
  --primary-light:  #e0f5fb;   /* light tint backgrounds */
  --secondary:      #E775A6;   /* brand pink */
  --secondary-dark: #d45490;   /* hover pink */
  --secondary-light:#fde8f3;   /* light pink backgrounds */
  --accent-yellow:  #F7DC6F;   /* brand yellow accent */
  --accent-yellow-text: #7a5500; /* readable text on yellow */

  /* ── Semantic colours (keep green for +ve financial values) ── */
  --accent:       #059669;
  --accent-light: #d1fae5;
  --danger:       #dc2626;
  --warning:      #d97706;

  /* ── Neutrals ── */
  --text:       #1f2937;
  --text-muted: #6b7280;
  --border:     #e5e7eb;
  --bg:         #f8fafc;
  --card:       #ffffff;
  --shadow:     0 1px 3px rgba(0,0,0,.08), 0 4px 16px rgba(0,0,0,.06);
  --shadow-lg:  0 8px 32px rgba(0,0,0,.10);
  --radius:     12px;
  --radius-sm:  8px;
}

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

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Topbar ── */
.topbar {
  display: none;
  background: var(--primary-dark);
  color: #fff;
  font-size: .78rem;
  padding: .35rem 0;
  text-align: center;
  letter-spacing: .3px;
}
.topbar a { color: var(--accent-yellow); }

/* ── Header / Nav ── */
.site-header {
  background: var(--primary);
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,.2);
}
.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
}
.site-logo {
  display: flex;
  align-items: center;
  gap: .6rem;
  color: #fff;
  font-size: 1.2rem;
  font-weight: 700;
  white-space: nowrap;
}
.site-logo img { display: block; }

.main-nav {
  display: flex;
  gap: .25rem;
  flex-wrap: wrap;
  flex: 1;
}
.main-nav a {
  color: rgba(255,255,255,.82);
  font-size: .82rem;
  padding: .3rem .65rem;
  border-radius: 6px;
  transition: background .15s, color .15s;
  white-space: nowrap;
}
.main-nav a:hover, .main-nav a.active {
  background: rgba(255,255,255,.15);
  color: #fff;
  text-decoration: none;
}

/* ── Hamburger ── */
.nav-burger {
  display: none;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  padding: .35rem;
  color: #fff;
  border-radius: 6px;
  transition: background .15s;
  flex-shrink: 0;
}
.nav-burger:hover { background: rgba(255,255,255,.18); }

/* ── Hero ── */
.hero {
  background: linear-gradient(135deg, var(--primary) 0%, #0d89b8 45%, var(--secondary) 100%);
  color: #fff;
  padding: 1.5rem 1.5rem 1.75rem;
  text-align: center;
}
.hero h1 {
  font-size: clamp(1.5rem, 3.5vw, 2.25rem);
  font-weight: 800;
  margin-bottom: .4rem;
  line-height: 1.15;
}
.hero h1 span { color: var(--accent-yellow); }
.hero p {
  font-size: .95rem;
  max-width: 600px;
  margin: 0 auto .5rem;
  opacity: .9;
}
.hero-badges {
  display: flex;
  gap: .5rem;
  justify-content: center;
  flex-wrap: wrap;
}
.badge-pill {
  background: rgba(255,255,255,.15);
  border: 1px solid rgba(255,255,255,.25);
  color: #fff;
  padding: .3rem .9rem;
  border-radius: 999px;
  font-size: .78rem;
  font-weight: 500;
}

/* ── Page Hero (individual pages) ── */
.page-hero {
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  color: #fff;
  padding: .6rem 1.5rem 2rem;
  text-align: center;
}
.page-hero::after {
  display: none;
}
.page-hero h1 {
  font-size: clamp(1.3rem, 3vw, 1.85rem);
  font-weight: 800;
  margin-bottom: .3rem;
}
.page-hero p { max-width: 560px; margin: 0 auto; opacity: .88; font-size: .88rem; }

/* ── Container ── */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}
.container-sm {
  max-width: 820px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ── Section ── */
.section { padding: 3rem 0; }
.section-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  color: var(--text);
}
.section-title span { color: var(--primary); }

/* ── Calculator Card ── */
.calc-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  margin: 0 auto 2rem;
  max-width: 780px;
  position: relative;
  z-index: 10;
}
.calc-card-header {
  background: var(--primary);
  color: #fff;
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  gap: .75rem;
  font-weight: 600;
  font-size: 1rem;
}
.calc-card-header svg { width: 20px; height: 20px; opacity: .85; }
.calc-body { padding: 1.75rem; }

/* ── Form Elements ── */
.form-group { margin-bottom: 1.25rem; }
.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}
label {
  display: block;
  font-size: .85rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: .4rem;
}
label span { color: var(--text-muted); font-weight: 400; }
input[type="number"],
input[type="text"],
select {
  width: 100%;
  padding: .65rem .9rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .95rem;
  color: var(--text);
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
  outline: none;
  appearance: none;
}
input[type="number"]:focus,
input[type="text"]:focus,
select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(17,162,215,.15);
}
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right .75rem center;
  padding-right: 2.5rem;
  cursor: pointer;
}

.input-prefix-wrap {
  position: relative;
}
.input-prefix {
  position: absolute;
  left: .9rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: .95rem;
  font-weight: 500;
  pointer-events: none;
}
.input-prefix-wrap input { padding-left: 2rem; }

/* Australian tax calculator – pay period row */
.aus-income-row {
  display: flex;
  gap: .6rem;
  align-items: stretch;
}
.aus-income-field { flex: 1; }
.aus-period-select { width: auto; min-width: 155px; flex-shrink: 0; }
.aus-hours-input { max-width: 140px; }
.label-hint { font-weight: 400; color: var(--text-muted); }
.aus-annual-banner {
  background: var(--primary-light);
  border: 1.5px solid rgba(17,162,215,.3);
  border-radius: 8px;
  padding: .65rem 1rem;
  font-size: .85rem;
  margin-bottom: 1.1rem;
  color: var(--primary-dark);
}

.radio-group {
  display: flex;
  gap: .75rem;
  flex-wrap: wrap;
}
.radio-btn {
  cursor: pointer;
}
.radio-btn input { display: none; }
.radio-btn span {
  display: block;
  padding: .45rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  font-size: .85rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: all .15s;
}
.radio-btn input:checked + span {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary);
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .7rem 1.5rem;
  border-radius: var(--radius-sm);
  font-size: .95rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all .15s;
  outline: none;
}
.btn-primary {
  background: var(--primary);
  color: #fff;
  width: 100%;
  justify-content: center;
  font-size: 1rem;
  padding: .8rem;
}
.btn-primary:hover { background: var(--primary-dark); }
.btn-outline {
  background: transparent;
  border: 1.5px solid var(--primary);
  color: var(--primary);
}
.btn-outline:hover { background: var(--primary-light); }
.btn-sm { padding: .4rem .9rem; font-size: .82rem; }
.btn-reset {
  background: #f3f4f6;
  color: var(--text-muted);
  width: 100%;
  justify-content: center;
  margin-top: .5rem;
}
.btn-reset:hover { background: #e5e7eb; }

/* ── Results ── */
.results-box {
  background: linear-gradient(135deg, var(--primary-light) 0%, #f0fdf4 100%);
  border: 1.5px solid rgba(17,162,215,.3);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-top: 1.5rem;
  display: none;
}
.results-box.show { display: block; }

.result-headline {
  text-align: center;
  margin-bottom: 1.25rem;
}
.result-headline .result-label {
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-muted);
  font-weight: 600;
}
.result-headline .result-value {
  font-size: clamp(2rem, 5vw, 2.75rem);
  font-weight: 800;
  color: var(--primary);
  line-height: 1.1;
}
.result-headline .result-sub { font-size: .85rem; color: var(--text-muted); margin-top: .2rem; }

.result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: .75rem;
  margin-bottom: 1rem;
}
.result-item {
  background: #fff;
  border-radius: var(--radius-sm);
  padding: .9rem 1rem;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.result-item .r-label {
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: .25rem;
}
.result-item .r-value {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
}
.result-item.accent .r-value { color: var(--accent); }
.result-item.primary .r-value { color: var(--primary); }
.result-item.danger .r-value { color: var(--danger); }

/* Tax Breakdown Table */
.breakdown-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .88rem;
  margin-top: 1rem;
}
.breakdown-table th {
  background: var(--primary);
  color: #fff;
  padding: .6rem .9rem;
  text-align: left;
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.breakdown-table th:last-child,
.breakdown-table td:last-child { text-align: right; }
.breakdown-table td { padding: .6rem .9rem; border-bottom: 1px solid var(--border); }
.breakdown-table tr:last-child td { border-bottom: none; font-weight: 700; background: #f8fafc; }
.breakdown-table tr:nth-child(even) td { background: #f9fafb; }
.breakdown-table tr:last-child td:first-child { color: var(--text); }

.progress-bar-wrap {
  background: #e5e7eb;
  border-radius: 999px;
  height: 8px;
  margin-top: .5rem;
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  transition: width .4s ease;
}

/* ── Info Sections ── */
.info-section {
  background: var(--card);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow);
  margin-bottom: 1.5rem;
}
.info-section h2 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: .5rem;
}
.info-section h2 .icon {
  width: 32px;
  height: 32px;
  background: var(--primary-light);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.info-section h2 .icon svg { width: 16px; height: 16px; color: var(--primary); }
.info-section p { color: var(--text-muted); margin-bottom: .75rem; font-size: .93rem; }
.info-section ul, .info-section ol {
  padding-left: 1.25rem;
  color: var(--text-muted);
  font-size: .93rem;
}
.info-section li { margin-bottom: .4rem; }
.info-section strong { color: var(--text); }

/* ── Tax Bracket Box ── */
.bracket-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .85rem;
}
.bracket-table th {
  background: #f1f5f9;
  padding: .5rem .75rem;
  text-align: left;
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text-muted);
  border-bottom: 1.5px solid var(--border);
}
.bracket-table td { padding: .55rem .75rem; border-bottom: 1px solid var(--border); }
.bracket-table tr:last-child td { border-bottom: none; }
.rate-badge {
  display: inline-block;
  padding: .15rem .5rem;
  border-radius: 4px;
  font-size: .78rem;
  font-weight: 700;
  background: var(--primary-light);
  color: var(--primary);
}

/* ── FAQ ── */
.faq-list { display: flex; flex-direction: column; gap: .75rem; }
.faq-item {
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.faq-question {
  width: 100%;
  background: none;
  border: none;
  padding: 1rem 1.25rem;
  text-align: left;
  font-size: .93rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}
.faq-question svg {
  width: 16px;
  height: 16px;
  color: var(--primary);
  flex-shrink: 0;
  transition: transform .2s;
}
.faq-item.open .faq-question svg { transform: rotate(180deg); }
.faq-answer {
  padding: 0 1.25rem;
  font-size: .88rem;
  color: var(--text-muted);
  max-height: 0;
  overflow: hidden;
  transition: max-height .3s ease, padding .3s;
}
.faq-item.open .faq-answer {
  padding: 0 1.25rem 1rem;
  max-height: 400px;
}

/* ── Calculator Grid (hub page) ── */
.calc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
}
.calc-tile {
  background: var(--card);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  border: 1.5px solid var(--border);
  display: flex;
  flex-direction: column;
  transition: transform .2s, box-shadow .2s, border-color .2s;
  text-decoration: none;
  color: inherit;
}
.calc-tile:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary);
  text-decoration: none;
}
.calc-tile-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  font-size: 1.5rem;
}
.calc-tile h3 { font-size: 1rem; font-weight: 700; margin-bottom: .4rem; }
.calc-tile p { font-size: .83rem; color: var(--text-muted); flex: 1; }
.calc-tile .tile-footer {
  margin-top: 1rem;
  font-size: .8rem;
  font-weight: 600;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: .35rem;
}

/* Featured general tax calculator tile */
.calc-tile.calc-tile-featured {
  border-color: var(--primary);
  background: linear-gradient(135deg, var(--primary-light), #fff);
}
.calc-tile-icon-featured {
  background: var(--primary-light);
  font-size: 1.75rem;
}
.tile-footer-featured {
  font-size: .85rem;
  font-weight: 700;
}

.category-label {
  display: inline-block;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  padding: .2rem .65rem;
  border-radius: 999px;
  margin-bottom: 1rem;
}
.cat-blue   { background: var(--primary-light);   color: var(--primary); }
.cat-green  { background: var(--secondary-light); color: var(--secondary-dark); }
.cat-orange { background: rgba(247,220,111,.25);  color: var(--accent-yellow-text); }
.cat-purple { background: #f5f3ff; color: #7c3aed; }

/* ── Nav Search ── */
.nav-search { position: relative; margin-left: auto; flex-shrink: 0; }
.nav-search-btn {
  background: rgba(255,255,255,.15);
  border: none;
  color: #fff;
  width: 34px; height: 34px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s;
}
.nav-search-btn:hover { background: rgba(255,255,255,.28); }
.nav-search-box {
  position: absolute;
  right: 0;
  top: calc(100% + .6rem);
  width: 280px;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,.2);
  overflow: hidden;
  display: none;
  z-index: 200;
}
.nav-search-box.open { display: block; }
.nav-search-box input {
  width: 100%;
  padding: .75rem 1rem .75rem 2.75rem;
  border: none;
  font-size: .95rem;
  color: var(--text);
  outline: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E") .75rem center no-repeat;
}

/* ── Filter Bar ── */
.filter-bar {
  background: #fff;
  border-bottom: 1px solid var(--border);
  padding: .6rem 1.5rem;
  position: sticky;
  top: 64px;
  z-index: 90;
}
.filter-pills {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  gap: .45rem;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.filter-pills::-webkit-scrollbar { display: none; }
.filter-pill {
  display: inline-flex;
  align-items: center;
  padding: .35rem 1rem;
  border-radius: 999px;
  border: 1.5px solid var(--border);
  font-size: .82rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  background: #fff;
  color: var(--text-muted);
  transition: border-color .15s, background .15s, color .15s;
  -webkit-user-select: none;
  user-select: none;
}
.filter-pill:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}
.filter-pill.active {
  background: var(--text);
  border-color: var(--text);
  color: #fff;
}
.filter-pill.active:hover {
  background: #374151;
  border-color: #374151;
}

/* ── Ad layout ── */
.ad-layout { display: flex; align-items: flex-start; max-width: 1280px; margin: 0 auto; padding: 0; }
.ad-layout .container-sm { flex: 1; min-width: 0; max-width: 860px; }
.ad-col { width: 160px; flex-shrink: 0; padding: 1.5rem 8px 0; }
.ad-horiz-mob { margin: 1.5rem 0; }
@media (max-width: 1240px) { .ad-layout { display: block; } .ad-col { display: none; } }

/* ── Footer ── */
.site-footer {
  background: linear-gradient(135deg, var(--primary) 0%, #0d89b8 45%, var(--secondary) 100%);
  color: rgba(255,255,255,.75);
  padding: 3rem 0 1.5rem;
  font-size: .85rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}
.footer-col h4 { color: #fff; font-size: .9rem; margin-bottom: .85rem; }
.footer-col a {
  display: block;
  color: rgba(255,255,255,.7);
  margin-bottom: .45rem;
  font-size: .83rem;
  transition: color .15s;
}
.footer-col a:hover { color: #fff; text-decoration: none; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.2);
  padding-top: 1.25rem;
  text-align: center;
  font-size: .78rem;
  color: rgba(255,255,255,.6);
}
.footer-logo { color: #fff; font-size: 1.1rem; font-weight: 700; margin-bottom: .5rem; }

/* ── Breadcrumb ── */
.breadcrumb {
  font-size: .8rem;
  color: var(--text-muted);
  padding: .35rem 0 .25rem;
  display: flex;
  align-items: center;
  gap: .4rem;
}
.breadcrumb a { color: var(--primary); }
.breadcrumb span { color: var(--text-muted); }

/* ── Alert ── */
.alert {
  padding: .85rem 1rem;
  border-radius: var(--radius-sm);
  font-size: .85rem;
  margin-bottom: 1.25rem;
  display: flex;
  gap: .65rem;
  align-items: flex-start;
}
.alert-info {
  background: var(--primary-light);
  color: var(--primary-dark);
  border-left: 3px solid var(--primary);
}
.alert-warning {
  background: #fffbeb;
  color: #92400e;
  border-left: 3px solid var(--warning);
}
.alert svg { width: 16px; height: 16px; flex-shrink: 0; margin-top: .1rem; }

/* ── Year Tag ── */
.year-tag {
  display: inline-block;
  background: var(--accent-yellow);
  color: var(--accent-yellow-text);
  font-size: .72rem;
  font-weight: 700;
  padding: .15rem .5rem;
  border-radius: 4px;
  margin-left: .5rem;
  vertical-align: middle;
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .nav-inner { flex-wrap: wrap; gap: .5rem; padding: .6rem 1rem; }
  .nav-burger { display: flex; }
  .main-nav {
    display: none;
    flex-direction: column;
    width: 100%;
    order: 10;
    flex: none;
    gap: 0;
    padding-bottom: .4rem;
  }
  .site-header.nav-open .main-nav { display: flex; }
  .main-nav a {
    padding: .65rem .75rem;
    font-size: .92rem;
    border-radius: 6px;
    border-bottom: 1px solid rgba(255,255,255,.1);
    white-space: normal;
  }
  .main-nav a:last-child { border-bottom: none; }
  .calc-card { margin: -1rem 1rem 1.5rem; }
  .form-row { grid-template-columns: 1fr; }
  .result-grid { grid-template-columns: 1fr 1fr; }
  .section { padding: 2rem 0; }
}
@media (max-width: 480px) {
  .result-grid { grid-template-columns: 1fr; }
  .hero { padding: 1rem 1rem 1.75rem; }
  .page-hero { padding: .5rem 1rem 1.75rem; }
  .calc-body { padding: 1.25rem; }
}

/* ── Print ── */
@media print {
  .site-header, .site-footer, .btn, nav { display: none; }
  .results-box { display: block !important; border: 1px solid #ccc; }
  body { background: #fff; }
}
