/* =============================================
   S-Corp Tax Calculator — Shared Stylesheet
   ============================================= */

/* ---------- CSS Variables ---------- */
:root {
  --blue-900: #0F2444;
  --blue-800: #1E3A5F;
  --blue-700: #274d7e;
  --blue-100: #E8F0FB;
  --blue-50:  #F0F5FF;
  --green-600: #16A34A;
  --green-500: #22C55E;
  --green-50:  #F0FDF4;
  --amber-500: #F59E0B;
  --amber-50:  #FFFBEB;
  --red-500:   #EF4444;
  --red-50:    #FEF2F2;
  --gray-900: #0F172A;
  --gray-700: #374151;
  --gray-500: #6B7280;
  --gray-300: #D1D5DB;
  --gray-100: #F3F4F6;
  --gray-50:  #F9FAFB;
  --white:    #FFFFFF;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.10);
  --shadow-lg: 0 10px 30px rgba(0,0,0,0.12);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

/* ---------- Reset & Base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--gray-900);
  background: var(--gray-50);
}
a { color: var(--blue-800); text-decoration: none; }
a:hover { color: var(--blue-700); text-decoration: underline; }
img { max-width: 100%; display: block; }
ul, ol { padding-left: 1.5rem; }

/* ---------- Layout ---------- */
.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 20px;
}
.container-narrow {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ---------- Navigation ---------- */
.site-nav {
  background: var(--blue-900);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.site-nav .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--white);
  font-weight: 700;
  font-size: 1.1rem;
  text-decoration: none;
}
.nav-logo:hover { color: var(--white); text-decoration: none; }
.nav-logo-icon {
  width: 36px;
  height: 36px;
  background: var(--green-500);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}
.nav-links {
  display: flex;
  list-style: none;
  padding: 0;
  gap: 4px;
}
.nav-links a {
  color: rgba(255,255,255,0.82);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.15s, background 0.15s;
}
.nav-links a:hover, .nav-links a.active {
  color: var(--white);
  background: rgba(255,255,255,0.12);
  text-decoration: none;
}
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 6px;
  background: none;
  border: none;
}
.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--white);
  border-radius: 2px;
  transition: 0.3s;
}

/* ---------- Hero ---------- */
.hero {
  background: linear-gradient(135deg, var(--blue-900) 0%, var(--blue-800) 60%, #1a4a8a 100%);
  color: var(--white);
  padding: 60px 0 50px;
  text-align: center;
}
.hero h1 {
  font-size: clamp(1.7rem, 4vw, 2.6rem);
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: 14px;
}
.hero h1 span { color: var(--green-500); }
.hero p {
  font-size: 1.1rem;
  opacity: 0.88;
  max-width: 620px;
  margin: 0 auto 24px;
}
.hero-badges {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 0.83rem;
}
.hero-badge {
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.22);
  border-radius: 20px;
  padding: 5px 14px;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ---------- Ad Placeholders ---------- */
.ad-slot {
  background: var(--gray-100);
  border: 1px dashed var(--gray-300);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray-500);
  font-size: 0.8rem;
  text-align: center;
}
.ad-slot-banner {
  width: 100%;
  height: 90px;
  margin: 20px 0;
}
.ad-slot-rectangle {
  width: 300px;
  height: 250px;
}
.ad-slot-leaderboard {
  width: 100%;
  height: 90px;
}

/* ---------- Cards ---------- */
.card {
  background: var(--white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-300);
}
.card-padding { padding: 28px; }

/* ---------- Calculator ---------- */
.calculator-section {
  padding: 40px 0 60px;
}
.calc-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 28px;
  align-items: start;
}
.calc-form-card { padding: 32px; }
.calc-form-card h2 {
  font-size: 1.2rem;
  color: var(--blue-900);
  margin-bottom: 24px;
  padding-bottom: 14px;
  border-bottom: 2px solid var(--blue-100);
}
.form-group {
  margin-bottom: 20px;
}
.form-group label {
  display: block;
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--gray-700);
  margin-bottom: 6px;
}
.form-group .helper {
  font-size: 0.79rem;
  color: var(--gray-500);
  margin-top: 4px;
  font-weight: 400;
}
.input-prefix-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.input-prefix {
  position: absolute;
  left: 12px;
  color: var(--gray-500);
  font-weight: 600;
  pointer-events: none;
}
input[type="number"], input[type="text"], input[type="email"], select, textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--gray-300);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-family: var(--font);
  color: var(--gray-900);
  background: var(--white);
  transition: border-color 0.15s, box-shadow 0.15s;
  appearance: none;
  -webkit-appearance: none;
}
input[type="number"]:focus, input[type="text"]:focus, input[type="email"]:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--blue-700);
  box-shadow: 0 0 0 3px rgba(30, 58, 95, 0.12);
}
.input-with-prefix input { padding-left: 28px; }
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
  cursor: pointer;
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.range-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.range-value-display {
  font-weight: 700;
  color: var(--blue-800);
  font-size: 1rem;
}
input[type="range"] {
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: var(--gray-300);
  outline: none;
  padding: 0;
  border: none;
  cursor: pointer;
  accent-color: var(--blue-800);
}
.btn-primary {
  width: 100%;
  background: var(--blue-800);
  color: var(--white);
  border: none;
  padding: 14px 24px;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  font-family: var(--font);
  margin-top: 8px;
}
.btn-primary:hover { background: var(--blue-900); transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }
.btn-secondary {
  background: var(--gray-100);
  color: var(--gray-700);
  border: 1.5px solid var(--gray-300);
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
  font-family: var(--font);
}
.btn-secondary:hover { background: var(--gray-300); }

/* ---------- Results ---------- */
#results-section { display: none; margin-top: 28px; }
.savings-banner {
  background: linear-gradient(135deg, var(--green-600), #15803D);
  color: var(--white);
  border-radius: var(--radius-md);
  padding: 24px 28px;
  text-align: center;
  margin-bottom: 24px;
}
.savings-banner .label { font-size: 0.88rem; opacity: 0.9; margin-bottom: 4px; }
.savings-banner .amount { font-size: 2.8rem; font-weight: 800; line-height: 1; }
.savings-banner .sub { font-size: 0.85rem; opacity: 0.85; margin-top: 6px; }
.savings-negative { background: linear-gradient(135deg, var(--amber-500), #D97706) !important; }
.comparison-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}
.comparison-table th {
  background: var(--blue-900);
  color: var(--white);
  padding: 12px 16px;
  text-align: left;
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: 0.02em;
}
.comparison-table th:not(:first-child) { text-align: right; }
.comparison-table td {
  padding: 11px 16px;
  border-bottom: 1px solid var(--gray-100);
  color: var(--gray-700);
}
.comparison-table td:not(:first-child) { text-align: right; font-weight: 600; }
.comparison-table tr:last-child td { border-bottom: none; }
.comparison-table .total-row td {
  background: var(--gray-50);
  font-weight: 700;
  color: var(--gray-900);
  font-size: 0.95rem;
  border-top: 2px solid var(--gray-300);
}
.comparison-table .highlight-green { color: var(--green-600) !important; }
.comparison-table .highlight-red { color: var(--red-500) !important; }
.breakeven-box {
  background: var(--amber-50);
  border: 1px solid #FDE68A;
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  font-size: 0.87rem;
  color: #92400E;
  margin-top: 16px;
}
.breakeven-box strong { color: #78350F; }
.disclaimer-box {
  background: var(--blue-50);
  border: 1px solid var(--blue-100);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  font-size: 0.82rem;
  color: var(--gray-500);
  margin-top: 16px;
  line-height: 1.5;
}

/* ---------- Sidebar ---------- */
.sidebar { display: flex; flex-direction: column; gap: 20px; }
.sidebar-card { padding: 22px; }
.sidebar-card h3 { font-size: 0.95rem; color: var(--blue-900); margin-bottom: 14px; }
.sidebar-card ul { list-style: none; padding: 0; }
.sidebar-card ul li {
  padding: 9px 0;
  border-bottom: 1px solid var(--gray-100);
  font-size: 0.88rem;
  color: var(--gray-700);
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.sidebar-card ul li:last-child { border-bottom: none; }
.sidebar-card ul li::before { content: "✓"; color: var(--green-600); font-weight: 700; flex-shrink: 0; }
.cta-card {
  background: var(--blue-50);
  border: 1px solid var(--blue-100);
  border-radius: var(--radius-md);
  padding: 22px;
  text-align: center;
}
.cta-card h3 { font-size: 1rem; color: var(--blue-900); margin-bottom: 8px; }
.cta-card p { font-size: 0.84rem; color: var(--gray-500); margin-bottom: 14px; }
.cta-card .btn-cta {
  display: inline-block;
  background: var(--blue-800);
  color: var(--white);
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
}
.cta-card .btn-cta:hover { background: var(--blue-900); text-decoration: none; }

/* ---------- Content Pages ---------- */
.page-hero {
  background: var(--blue-900);
  color: var(--white);
  padding: 48px 0 40px;
}
.page-hero h1 { font-size: clamp(1.5rem, 3vw, 2.2rem); font-weight: 800; }
.page-hero p { opacity: 0.85; margin-top: 10px; font-size: 1.05rem; }
.content-section { padding: 50px 0 70px; }
.content-grid {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 36px;
  align-items: start;
}
.prose h2 {
  font-size: 1.4rem;
  color: var(--blue-900);
  margin: 36px 0 14px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--blue-100);
}
.prose h2:first-child { margin-top: 0; }
.prose h3 {
  font-size: 1.1rem;
  color: var(--blue-800);
  margin: 24px 0 10px;
}
.prose p { margin-bottom: 16px; color: var(--gray-700); }
.prose ul, .prose ol { margin-bottom: 16px; color: var(--gray-700); }
.prose li { margin-bottom: 6px; }
.prose strong { color: var(--gray-900); }
.prose table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 24px;
  font-size: 0.9rem;
}
.prose table th {
  background: var(--blue-900);
  color: var(--white);
  padding: 10px 14px;
  text-align: left;
  font-size: 0.83rem;
}
.prose table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--gray-200);
  color: var(--gray-700);
}
.prose table tr:nth-child(even) td { background: var(--gray-50); }
.info-box {
  background: var(--blue-50);
  border-left: 4px solid var(--blue-800);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 16px 20px;
  margin: 20px 0;
  font-size: 0.92rem;
  color: var(--gray-700);
}
.info-box strong { color: var(--blue-900); }
.warning-box {
  background: var(--amber-50);
  border-left: 4px solid var(--amber-500);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 16px 20px;
  margin: 20px 0;
  font-size: 0.92rem;
  color: #78350F;
}

/* ---------- FAQ ---------- */
.faq-list { display: flex; flex-direction: column; gap: 14px; }
.faq-item {
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--white);
}
.faq-question {
  width: 100%;
  background: none;
  border: none;
  padding: 18px 22px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  font-family: var(--font);
  font-size: 0.97rem;
  font-weight: 600;
  color: var(--gray-900);
  text-align: left;
  gap: 12px;
  transition: background 0.15s;
}
.faq-question:hover { background: var(--gray-50); }
.faq-icon {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  background: var(--blue-100);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  color: var(--blue-800);
  font-weight: 700;
  transition: transform 0.2s, background 0.15s;
}
.faq-item.open .faq-icon { transform: rotate(45deg); background: var(--blue-800); color: var(--white); }
.faq-answer {
  display: none;
  padding: 0 22px 18px;
  font-size: 0.92rem;
  color: var(--gray-700);
  line-height: 1.7;
}
.faq-answer p { margin-bottom: 10px; }
.faq-answer p:last-child { margin-bottom: 0; }
.faq-item.open .faq-answer { display: block; }

/* ---------- Contact Form ---------- */
.contact-form .form-group { margin-bottom: 20px; }
.contact-form textarea {
  min-height: 140px;
  resize: vertical;
}
.form-success {
  background: var(--green-50);
  border: 1px solid #BBF7D0;
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  color: var(--green-600);
  font-weight: 600;
  display: none;
}

/* ---------- Breadcrumb ---------- */
.breadcrumb {
  font-size: 0.82rem;
  color: rgba(255,255,255,0.7);
  margin-bottom: 12px;
}
.breadcrumb a { color: rgba(255,255,255,0.7); }
.breadcrumb a:hover { color: var(--white); text-decoration: none; }
.breadcrumb span { margin: 0 6px; }

/* ---------- About Stats ---------- */
.stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin: 36px 0;
}
.stat-card {
  background: var(--white);
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-md);
  padding: 24px 20px;
  text-align: center;
  box-shadow: var(--shadow-sm);
}
.stat-card .number {
  font-size: 2rem;
  font-weight: 800;
  color: var(--blue-800);
  line-height: 1;
  margin-bottom: 6px;
}
.stat-card .stat-label { font-size: 0.85rem; color: var(--gray-500); }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--blue-900);
  color: rgba(255,255,255,0.75);
  padding: 48px 0 28px;
  margin-top: 60px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 36px;
  margin-bottom: 36px;
}
.footer-brand h3 {
  color: var(--white);
  font-size: 1.05rem;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.footer-brand p { font-size: 0.85rem; line-height: 1.6; max-width: 320px; }
.footer-col h4 { color: var(--white); font-size: 0.88rem; margin-bottom: 14px; letter-spacing: 0.04em; text-transform: uppercase; }
.footer-col ul { list-style: none; padding: 0; }
.footer-col ul li { margin-bottom: 8px; }
.footer-col ul li a { color: rgba(255,255,255,0.7); font-size: 0.87rem; transition: color 0.15s; }
.footer-col ul li a:hover { color: var(--white); text-decoration: none; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.12);
  padding-top: 22px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}
.footer-bottom p { font-size: 0.8rem; }
.footer-disclaimer { font-size: 0.77rem; color: rgba(255,255,255,0.5); max-width: 600px; line-height: 1.5; }

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  .nav-links { display: none; flex-direction: column; position: absolute; top: 64px; left: 0; right: 0; background: var(--blue-900); padding: 16px 20px 20px; border-top: 1px solid rgba(255,255,255,0.1); gap: 4px; }
  .nav-links.open { display: flex; }
  .nav-links li a { display: block; padding: 10px 14px; }
  .nav-toggle { display: flex; }
  .site-nav .container { position: relative; }
  .calc-layout { grid-template-columns: 1fr; }
  .sidebar { order: -1; display: grid; grid-template-columns: 1fr 1fr; }
  .content-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
  .stats-row { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .sidebar .ad-slot-rectangle { display: none; }
}
@media (max-width: 480px) {
  .hero { padding: 40px 0 36px; }
  .sidebar { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
}
