/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #0f766e;
    --primary-dark: #134e4a;
    --secondary-color: #0d9488;
    --text-color: #111827;
    --text-light: #4b5563;
    --bg-color: #ffffff;
    --bg-gray: #f9fafb;
    --border-color: #e5e7eb;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --error-color: #ef4444;
    --radius: 8px;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);
}

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

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: all 0.2s ease;
}

a:hover {
    color: var(--primary-dark);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header and Navigation */
.top-bar {
    background-color: #f8fafc;
    border-bottom: 1px solid var(--border-color);
    padding: 0.5rem 0;
    font-size: 0.8125rem;
}

.top-bar-content {
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.lang-switcher {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: white;
    padding: 4px 12px;
    border-radius: 20px;
    border: 1px solid var(--border-color);
}

.lang-link {
    color: var(--text-light);
    font-weight: 500;
}

.lang-active {
    color: var(--primary-color);
    font-weight: 700;
}

.lang-divider {
    color: var(--border-color);
}

.lang-icon {
    color: var(--text-light);
}

.site-header {
    background-color: #ffffff;
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 11000; /* Higher than overlay (10000) so children are clickable */
    box-shadow: var(--shadow);
    height: 72px;
    /* NO backdrop-filter here or on pseudo-elements — it creates a stacking context
       that traps fixed children (mobile nav) inside the header's paint layer */
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
}

.logo-img {
    height: 32px;
    width: auto;
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.main-nav a {
    color: var(--text-color);
    font-weight: 500;
    font-size: 0.875rem;
    position: relative;
    padding: 4px 0;
    white-space: nowrap;
}

.main-nav a:hover,
.main-nav a.active {
    color: var(--primary-color);
}

.main-nav a.active::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--primary-color);
    border-radius: 2px;
}

/* Nav Dropdown */
.nav-dropdown-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.nav-dropdown-wrapper > a.nav-parent {
    display: flex;
    align-items: center;
    gap: 3px;
    padding: 4px 0;
    white-space: nowrap;
}

.chevron-icon {
    transition: transform 0.18s ease;
    flex-shrink: 0;
    opacity: 0.5;
    margin-top: 1px;
}

.nav-dropdown-wrapper:hover .chevron-icon,
.nav-dropdown-wrapper:focus-within .chevron-icon {
    transform: rotate(180deg);
    opacity: 0.8;
}

.nav-dropdown-panel {
    display: none;
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.10);
    min-width: 210px;
    padding: 0.5rem 0 0.35rem;
    z-index: 9999;
}

.nav-dropdown-wrapper:hover .nav-dropdown-panel,
.nav-dropdown-wrapper:focus-within .nav-dropdown-panel {
    display: block;
}

.nav-dropdown-panel a {
    display: block;
    padding: 0.5rem 1.1rem;
    font-size: 0.8125rem;
    color: var(--text-color);
    white-space: nowrap;
    border-bottom: none;
    position: static;
    font-weight: 400;
}

.nav-dropdown-panel a::after {
    display: none !important;
}

.nav-dropdown-panel a:hover {
    background: var(--bg-gray);
    color: var(--primary-color);
}

.view-all-link {
    border-top: 1px solid var(--border-color) !important;
    font-weight: 600;
    color: var(--primary-color) !important;
    margin-top: 0.25rem;
    padding-top: 0.5rem !important;
    font-size: 0.8125rem !important;
}

/* Mobile Menu Toggle Button */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 24px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 20000 !important;
}

.mobile-menu-toggle span {
    display: block;
    width: 100%;
    height: 3px;
    background-color: var(--text-color);
    border-radius: 3px;
    transition: all 0.3s ease;
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: translateY(10.5px) rotate(45deg);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: translateY(-10.5px) rotate(-45deg);
}

/* Mobile Menu Overlay */
.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 10000; /* Dims everything except header/nav */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.mobile-menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Main Content */
.main-content {
    min-height: calc(100vh - 200px);
    padding: 2rem 0;
}

/* Hero Section */
.hero {
    position: relative;
    text-align: center;
    padding: 6rem 2rem;
    background: #0f172a url("/static/images/hero-bg.webp") center/cover no-repeat;
    background-image: url("/static/images/hero-bg.webp");
    color: white;
    border-radius: 24px;
    margin-bottom: 4rem;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.hero::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(15, 118, 110, 0.7) 0%, rgba(30, 64, 175, 0.7) 100%);
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.hero-badge {
    display: inline-block;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50px;
    padding: 0.5rem 1.25rem;
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    letter-spacing: 0.025em;
    animation: fadeInDown 0.6s ease-out;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 850;
    margin-bottom: 1.5rem;
    line-height: 1.1;
    letter-spacing: -0.02em;
    animation: fadeInUp 0.6s ease-out 0.1s both;
}

.hero-highlight {
    display: inline-block;
    background: linear-gradient(120deg, #fbbf24 0%, #f59e0b 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    position: relative;
}

.hero-description {
    font-size: 1.25rem;
    line-height: 1.6;
    opacity: 0.9;
    max-width: 680px;
    margin: 0 auto 2.5rem;
    font-weight: 450;
    animation: fadeInUp 0.6s ease-out 0.2s both;
}

.hero-image {
    position: relative;
    z-index: 1;
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    animation: fadeInUp 0.8s ease-out 0.3s both;
}

.hero-image img {
    max-width: 110%;
    height: auto;
    filter: drop-shadow(0 20px 40px rgba(0, 0, 0, 0.4));
    border-radius: 20px;
}

.hero-actions {
    display: flex;
    gap: 1.25rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 3.5rem;
    animation: fadeInUp 0.6s ease-out 0.3s both;
}

.button-hero-primary,
.button-hero-secondary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 700;
    font-size: 1.125rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    cursor: pointer;
}

.button-hero-primary {
    background: white;
    color: #0f766e;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.button-hero-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
}

.button-hero-primary svg {
    transition: transform 0.3s ease;
}

.button-hero-primary:hover svg {
    transform: translateX(4px);
}

.button-hero-secondary {
    background: transparent;
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
}

.button-hero-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
}

.hero-features {
    display: flex;
    gap: 2rem;
    justify-content: center;
    flex-wrap: wrap;
    animation: fadeInUp 0.6s ease-out 0.4s both;
}

.hero-feature-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
    opacity: 0.9;
    font-weight: 500;
}

.hero-feature-item svg {
    width: 18px;
    height: 18px;
    stroke-width: 2.5;
}

/* Animations */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}
/* Responsive Adjustments for Hero */
@media (max-width: 768px) {
    .hero {
        padding: 4rem 1.5rem;
        border-radius: 0;
        margin: -2rem -20px 3rem -20px;
    }

    .hero-title {
        font-size: 2.25rem;
    }

    .hero-description {
        font-size: 1.1rem;
    }

    .hero-features {
        gap: 1rem;
    }
}

/* Content Sections */
.content-section,
.featured-category,
.how-it-works,
.about-section {
    margin: 3rem 0;
}

h2 {
    font-size: 1.875rem;
    margin-bottom: 1rem;
    color: var(--text-color);
}

h3 {
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
    color: var(--text-color);
}

h4 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

p {
    margin-bottom: 1rem;
}

ul,
ol {
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

li {
    margin-bottom: 0.5rem;
}

/* Cards */
.tool-card,
.guide-card,
.content-card {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--primary-color);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    display: flex;
    flex-direction: column;
    height: 100%;
    transition: transform 0.2s, box-shadow 0.2s;
}

.category-card,
.child-card {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    display: flex;
    flex-direction: column;
    height: 100%;
    transition: transform 0.2s, box-shadow 0.2s;
}

.category-card:hover,
.child-card:hover,
.tool-card:hover,
.guide-card:hover,
.content-card:hover,
.tool-guide-group:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.tool-guide-group {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--primary-color);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.category-card h3,
.child-card h3 {
    margin-bottom: 0.75rem;
}

.category-card h3 a,
.child-card h3 a,
.tool-card h3 a,
.content-card h3 a,
.tool-guide-group h3 a {
    color: var(--primary-color);
    text-decoration: none;
}

.category-card h3 a:hover,
.child-card h3 a:hover,
.tool-card h3 a:hover,
.content-card h3 a:hover,
.tool-guide-group h3 a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* Category item counts on homepage cards */
.category-counts {
    font-size: 0.8125rem;
    color: var(--text-light);
    margin: 0.15rem 0 0.75rem;
    font-weight: 600;
    letter-spacing: 0.01em;
}

/* Page TOC pill navigation */
.page-toc {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 2rem;
}

.toc-pill {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--primary-color);
    padding: 0.3rem 0.875rem;
    border-radius: 20px;
    border: 1px solid var(--primary-color);
    text-decoration: none;
    transition: background 0.15s;
}

.toc-pill:hover {
    background: var(--primary-color);
    color: white;
}

/* Tax sub-section labels */
.sub-section-label {
    font-size: 0.8125rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-light);
    margin: 2rem 0 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border-color);
}

/* Grid Layouts */
.features-grid,
.children-grid,
.guides-grid,
.tools-grid,
.category-content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.category-content-grid {
    grid-template-columns: 1fr;
    /* Default for grouped content */
}

.feature {
    background: var(--bg-gray);
    padding: 1.5rem;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Buttons */
.button-primary,
.button-secondary {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s;
    border: none;
    cursor: pointer;
    font-size: 1rem;
}

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

.button-primary:hover {
    background: var(--primary-dark);
    color: white;
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

.button-secondary {
    background: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.button-secondary:hover {
    background: var(--primary-color);
    color: white;
}

/* Breadcrumb */
.breadcrumb {
    padding: 1rem 0;
    font-size: 0.875rem;
    color: var(--text-light);
}

.breadcrumb a {
    color: var(--primary-color);
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.breadcrumb span {
    margin: 0 0.5rem;
}

/* Forms */
.eligibility-form {
    background: var(--bg-gray);
    padding: 2rem;
    border-radius: var(--radius);
    margin: 2rem 0;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.required {
    color: var(--error-color);
}

input[type="number"],
input[type="text"],
select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 1rem;
    transition: border-color 0.2s;
}

input:focus,
select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.1);
}

.radio-group {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-weight: normal;
}

.radio-label input[type="radio"] {
    width: auto;
    cursor: pointer;
}

.help-text {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.875rem;
    color: var(--text-light);
}

/* Affiliate CTA Section */
.affiliate-cta-section {
    margin: 1.5rem 0 0;
    border: 1px solid #e5e7eb;
    border-radius: var(--radius);
    overflow: hidden;
}

.affiliate-disclosure {
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
    color: #6b7280;
    line-height: 1.4;
}

.affiliate-cta-card {
    padding: 1.25rem 1.5rem;
    background: white;
}

.affiliate-cta-headline {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0 0 0.4rem;
}

.affiliate-cta-body {
    font-size: 0.875rem;
    color: var(--text-light);
    margin: 0 0 1rem;
    line-height: 1.5;
}

.button-affiliate {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 0.6rem 1.25rem;
    background: #1d4ed8;
    color: white;
    border-radius: var(--radius);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: background 0.2s;
}

.button-affiliate:hover {
    background: #1e40af;
    color: white;
}

/* Result Section */
.tool-result-section {
    margin: 2rem 0;
}

.result-card {
    background: white;
    border: 2px solid var(--success-color);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--shadow-lg);
}

.result-card.filing-required {
    border-color: var(--warning-color);
    background: #fffbeb;
}

/* Professional Tax results */
.result-card.exempt {
    border-color: var(--success-color);
    background: #f0fdf4;
}

.result-card.applicable {
    border-color: var(--orange-color, #ea580c);
    background: #fff7ed;
}

#result-title {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

#result-reasons {
    margin: 1rem 0;
}

#result-reasons ul {
    margin-left: 1.5rem;
}

.result-fy {
    font-size: 0.875rem;
    color: var(--text-light);
    margin-top: 1rem;
}

/* FAQ */
.faq-item {
    background: var(--bg-gray);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    margin-bottom: 1rem;
    padding: 1rem;
}

.faq-item summary {
    font-weight: 600;
    cursor: pointer;
    padding: 0.5rem 0;
}

.faq-item p {
    margin-top: 0.75rem;
    padding-left: 0.5rem;
}

details {
    cursor: pointer;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    background: white;
}

th,
td {
    padding: 0.75rem;
    text-align: left;
    border: 1px solid var(--border-color);
}

th {
    background: var(--bg-gray);
    font-weight: 600;
}

/* Disclaimer */
.tool-disclaimer,
.guide-disclaimer,
.disclaimer-section {
    background: #fef3c7;
    border-left: 4px solid var(--warning-color);
    padding: 1.5rem;
    border-radius: var(--radius);
    margin: 2rem 0;
    font-size: 0.9rem;
}

/* Guide CTA */
.guide-cta,
.cta-button {
    background: linear-gradient(135deg, #0f766e 0%, #1e40af 100%);
    color: white;
    padding: 2rem;
    border-radius: var(--radius);
    text-align: center;
    margin: 2rem 0;
}

.guide-cta h3 {
    color: white;
    margin-bottom: 1rem;
}

.guide-cta .button-primary {
    background: white;
    color: var(--primary-color);
}

.cta-button {
    display: inline-block;
    text-decoration: none;
    padding: 1rem 2rem;
    font-weight: 600;
    margin-top: 1rem;
}

/* Page Hero Section */
.page-hero {
    background-color: #f0fdfa;
    border-bottom: 1px solid var(--border-color);
    padding: 3rem 0;
    margin-bottom: 3rem;
}

.page-hero .breadcrumb {
    padding-top: 0;
    margin-bottom: 1.5rem;
}

.page-hero h1 {
    font-size: 2.5rem;
    color: var(--text-color);
    margin-bottom: 1rem;
    line-height: 1.2;
}

.page-hero .intro,
.page-hero .tool-intro,
.page-hero .guide-intro {
    font-size: 1.125rem;
    color: var(--text-light);
    max-width: 800px;
    line-height: 1.6;
}

@media (max-width: 768px) {
    .page-hero {
        padding: 2rem 0;
    }

    .page-hero h1 {
        font-size: 2rem;
    }
}

/* Tool Footer & Badges */
.tool-footer {
    margin-top: 3rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
    text-align: center;
}

.methodology-badge {
    display: inline-flex;
    align-items: center;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.75rem;
}

.badge-icon {
    background: #22c55e;
    color: white;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-right: 0.5rem;
    font-size: 0.75rem;
}

.last-updated {
    font-size: 0.8125rem;
    color: var(--text-light);
}

/* Tag Pills */
.tag-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 12px 0;
}

.tag-pill {
    display: inline-block;
    padding: 4px 10px;
    background-color: #f3f4f6;
    color: #4b5563;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
    border: 1px solid #e5e7eb;
}

a.tag-pill:hover {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    text-decoration: none;
}

/* Guide Meta */
.guide-meta {
    font-size: 0.875rem;
    color: var(--text-light);
    margin-bottom: 1rem;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Footer */
.site-footer {
    background: var(--text-color);
    color: white;
    padding: 3rem 0 1rem;
    margin-top: 4rem;
}

/* Featured Tools Section */
.featured-tools-section {
    margin: 4rem 0;
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.tool-card.featured {
    position: relative;
    background: white;
    padding: 2.5rem;
    border-radius: 16px;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.tool-card.featured .button-primary,
.category-card .button-secondary,
.child-card .button-secondary {
    margin-top: auto;
    align-self: flex-start;
}

.tool-card.featured::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--primary-color);
}

.tool-card.featured:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.tool-badge {
    display: inline-block;
    background: #eff6ff;
    color: var(--primary-color);
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
}

/* Category Grid */
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.button-outline {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s;
    border: 2px solid #374151;
    color: #374151;
    background: transparent;
}

.button-outline:hover {
    background: #374151;
    color: white;
}

/* Footer Enhanced */
.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 3rem;
    margin-bottom: 3rem;
}

@media (max-width: 900px) {
    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 2rem;
    }

    .footer-section.about {
        grid-column: span 2;
    }
}

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

    .footer-section.about {
        grid-column: span 1;
    }
}

.footer-section h3,
.footer-section h4 {
    color: white;
    margin-bottom: 1rem;
}

.footer-section ul {
    list-style: none;
    margin: 0;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section a {
    color: #d1d5db;
    text-decoration: none;
}

.footer-section a:hover {
    color: white;
    text-decoration: underline;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid #374151;
    color: #9ca3af;
    font-size: 0.875rem;
}

/* Responsive */
@media (max-width: 768px) {
    .hero {
        padding: 3rem 1.5rem;
        border-radius: 12px;
    }

    .hero-title {
        font-size: 2.25rem;
    }

    .hero-description {
        font-size: 1.125rem;
    }

    .hero-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .button-hero-primary,
    .button-hero-secondary {
        width: 100%;
        justify-content: center;
    }

    .hero-features {
        gap: 1rem;
    }

    .hero-feature-item {
        font-size: 0.875rem;
    }

    /* Mobile Menu Styles */
    .mobile-menu-toggle {
        display: flex;
    }

    .header-content {
        justify-content: space-between;
        align-items: center;
    }

    .main-nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: 280px;
        height: 100vh;
        background: white;
        flex-direction: column;
        gap: 0;
        padding: 80px 0 20px;
        box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
        z-index: 20000;  /* must be highest — above overlay, ads, and anchor */
        transition: right 0.3s ease;
        overflow-y: auto;
        /* isolation: isolate ensures this forms its own stacking context */
        isolation: isolate;
    }

    .main-nav.active {
        right: 0;
    }

    .main-nav a {
        padding: 1rem 1.5rem;
        border-bottom: 1px solid var(--border-color);
        display: flex;
        align-items: center;
        width: 100%;
    }

    .main-nav a:hover,
    .main-nav a.active {
        background: var(--bg-gray);
    }

    .main-nav a.active {
        color: var(--primary-color);
        font-weight: 600;
        border-left: 4px solid var(--primary-color);
    }

    .main-nav a.active::after {
        display: none;
    }

    /* Mobile: dropdowns expand inline in the drawer */
    .nav-dropdown-wrapper {
        display: flex;
        flex-direction: column;
        width: 100%;
    }

    .nav-dropdown-panel {
        display: block;
        position: static;
        box-shadow: none;
        border: none;
        border-radius: 0;
        background: var(--bg-gray);
        padding: 0 0 0.25rem 0;
        min-width: unset;
    }

    .nav-dropdown-panel a {
        padding: 0.65rem 2rem;
        border-bottom: 1px solid var(--border-color);
        font-size: 0.875rem;
    }

    .chevron-icon {
        display: none;
    }

    .view-all-link {
        border-top: none !important;
        padding-top: 0.65rem !important;
    }

    .radio-group {
        flex-direction: column;
        gap: 0.75rem;
    }

    .features-grid,
    .children-grid {
        grid-template-columns: 1fr;
    }
}

/* Loading State */
#submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Tax Comparison Dashboard */
.comparison-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin: 2rem 0;
}

.comparison-col {
    background: #f9fafb;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    position: relative;
    transition: all 0.3s ease;
}

.comparison-col.winner {
    background: #f0fdf4;
    border-color: #22c55e;
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.15);
}

.regime-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.75rem;
}

.regime-header h4 {
    margin: 0;
    color: var(--text-color);
    font-size: 1.125rem;
}

.save-badge {
    background: #22c55e;
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
    text-transform: uppercase;
}

.regime-body .stat {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    font-size: 0.9375rem;
    color: var(--text-light);
}

.regime-body .total-stat {
    display: flex;
    justify-content: space-between;
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 2px dashed #bbf7d0;
    font-size: 1.125rem;
    color: var(--text-color);
}

.comparison-col.winner .total-stat {
    color: #166534;
}

.savings-summary {
    background: #ecfdf5;
    border: 1px dashed #10b981;
    color: #065f46;
    padding: 1rem;
    border-radius: 8px;
    text-align: center;
    font-size: 1.125rem;
    margin-bottom: 2rem;
}

.interpretation-box {
    background: white;
    border-left: 4px solid var(--primary-color);
    padding: 1rem 1.5rem;
    margin-top: 1.5rem;
    font-size: 1rem;
    line-height: 1.6;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

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

.tool-footer {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
    text-align: center;
    font-size: 0.875rem;
    color: var(--text-light);
}

/* Benefits Display */
.benefits-container {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.benefits-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.benefit-item {
    background: white;
    padding: 1.5rem;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
}

.benefit-header {
    display: flex;
    flex-direction: column;
    margin-bottom: 1rem;
}

.benefit-section {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--primary-color);
    margin-bottom: 0.25rem;
}

.benefit-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-color);
}

.benefit-amount {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--success-color);
    margin-bottom: 0.75rem;
}

.benefit-desc {
    font-size: 0.9rem;
    color: var(--text-light);
    line-height: 1.5;
}

.interpretation-box {
    background: #eff6ff;
    border-left: 4px solid var(--primary-color);
    padding: 1.25rem;
    border-radius: 4px;
    margin: 1.5rem 0;
}

.guidance-box {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    padding: 1.25rem;
    border-radius: var(--radius);
    margin: 1.5rem 0;
}

.guidance-box h4 {
    color: #166534;
    margin-bottom: 0.5rem;
}

.guidance-box ul {
    margin-bottom: 0;
    color: #166534;
}

/* Guide Hero Image */
.guide-hero-image {
    margin-top: 2rem;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.guide-hero-image img {
    width: 100%;
    height: auto;
    max-height: 400px;
    object-fit: cover;
    object-position: center;
    display: block;
    border-radius: var(--radius);
}

/* Related Content Section */
.related-content {
    margin-top: 4rem;
    padding-top: 3rem;
    border-top: 1px solid var(--border-color);
}

.related-content h2 {
    font-size: 1.5rem;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
}

.related-section {
    margin-bottom: 2.5rem;
}

.related-section h3 {
    font-size: 1.1rem;
    color: var(--text-light);
    margin-bottom: 1.25rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.related-card {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    height: 100%;
    display: block;
    text-decoration: none;
    color: inherit;
}

.related-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    border-color: var(--primary-color);
}

.related-card h4 {
    margin: 0 0 0.5rem 0;
    font-size: 1.125rem;
    color: var(--text-color);
}

.related-card h4 a {
    text-decoration: none;
    color: inherit;
}

.related-card h4 a:hover {
    color: var(--primary-color);
}

.related-card p {
    margin: 0;
    font-size: 0.875rem;
    color: var(--text-light);
    line-height: 1.5;
}

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

/* Premium Content & Value Proposition Styles */
.value-prop-section {
    position: relative;
    margin: 6rem 0;
    padding: 6rem 0;
    border-top: 1px solid var(--border-color);
    background-image: radial-gradient(circle at 1px 1px, var(--border-color) 1px, transparent 0);
    background-size: 40px 40px;
    background-position: center;
}

.value-prop-section::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, transparent 0%, var(--bg-color) 100%);
    pointer-events: none;
}

.value-prop-container {
    position: relative;
    z-index: 1;
}

.value-prop-header {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.value-prop-header i {
    color: var(--warning-color);
    background: rgba(245, 158, 11, 0.1);
    padding: 14px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.value-prop-title {
    font-size: 2.75rem;
    font-weight: 850;
    background: linear-gradient(135deg, var(--text-color) 0%, var(--primary-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.035em;
    margin: 0;
    line-height: 1.1;
}

.statutory-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: 100px;
    color: #047857;
    font-size: 0.8125rem;
    font-weight: 650;
    margin-bottom: 1.5rem;
}

.value-prop-content {
    font-size: 1.125rem;
    line-height: 1.8;
    color: var(--text-light);
    margin: 0;
    column-count: 2;
    column-gap: 4rem;
    margin-bottom: 4rem;
    text-align: justify;
}

@media (max-width: 1024px) {
    .value-prop-content {
        column-count: 1;
    }
}

.value-prop-content strong {
    color: var(--text-color);
    font-weight: 700;
}

.coverage-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.premium-feature-card {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 2.5rem;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    position: relative;
    overflow: hidden;
    height: 100%;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.premium-feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 0;
    background: var(--primary-color);
    transition: height 0.3s ease;
}

.premium-feature-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.05), 0 10px 10px -5px rgba(0, 0, 0, 0.02);
    border-color: var(--primary-color);
}

.premium-feature-card:hover::before {
    height: 100%;
}

.premium-card-icon {
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f0fdfa; /* Emerald 50 tint */
    color: var(--primary-color);
    border-radius: 12px;
    margin-bottom: 1.75rem;
    transition: all 0.3s ease;
}

.premium-feature-card:hover .premium-card-icon {
    background: var(--primary-color);
    color: white;
}

.premium-feature-card h4 {
    font-size: 1.35rem;
    font-weight: 750;
    margin-bottom: 1rem;
    color: var(--text-color);
    letter-spacing: -0.01em;
}

.premium-feature-card p {
    font-size: 0.9375rem;
    line-height: 1.7;
    color: var(--text-light);
    margin: 0;
}

@media (max-width: 768px) {
    .value-prop-section {
        padding: 3rem 0;
        margin-top: 2rem;
    }
    .value-prop-title {
        font-size: 1.875rem;
    }
    .value-prop-header {
        flex-direction: row;
        align-items: center;
        gap: 1rem;
    }
    .premium-feature-card {
        padding: 1.75rem;
    }
}

/* =============================================================
   ADSENSE AD UNITS — CLS-Safe Placeholders (May 2026)
   All ad containers have min-height to prevent layout shift.
   Google Core Web Vitals: CLS must stay < 0.1
   ============================================================= */

/* Base ad wrapper — always shown, reserves space before ad loads */
.ad-unit-wrapper {
    width: 100%;
    overflow: hidden;
    background: transparent;
    position: relative;
}

/* Ad label ("Advertisement") */
.ad-label {
    display: block;
    font-size: 0.65rem;
    text-align: center;
    color: #9ca3af;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 4px;
    font-weight: 500;
    user-select: none;
}

/* ── Slot 1: Top Banner (below page title / breadcrumb) ── */
.ad-slot-top {
    min-height: 90px;
    margin: 1rem 0 1.5rem;
    text-align: center;
}

/* ── Slot 2: Post-Result (after tool result renders) ── */
.ad-slot-post-result {
    min-height: 250px;
    margin: 1.5rem 0;
    text-align: center;
}

/* ── Slot 3: Mid-Article / In-article ── */
.ad-slot-mid-article {
    min-height: 280px;
    margin: 2rem 0;
    text-align: center;
    clear: both;
}

/* ── Slot 4: Bottom Multiplex (end of content) ── */
.ad-slot-bottom-multiplex {
    min-height: 300px;
    margin: 2rem 0 1rem;
    text-align: center;
}

/* ── Slot 5: Mobile Anchor (sticky bottom, mobile only) ── */
.ad-slot-anchor {
    display: none; /* hidden by default */
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: white;
    border-top: 1px solid var(--border-color);
    box-shadow: 0 -2px 12px rgba(0,0,0,0.1);
    min-height: 50px;
    text-align: center;
    padding: 4px 0 2px;
}

/* Close button for anchor ad */
.ad-anchor-close {
    position: absolute;
    top: 4px;
    right: 8px;
    background: none;
    border: none;
    cursor: pointer;
    color: #9ca3af;
    font-size: 1rem;
    line-height: 1;
    padding: 4px;
    z-index: 1001;
}

/* Anchor ad body padding so content isn't hidden behind it */
body.has-anchor-ad {
    padding-bottom: 70px;
}

@media (max-width: 768px) {
    .ad-slot-anchor {
        display: block;
    }

    .ad-slot-top {
        min-height: 50px;
        max-height: 100px !important;
        overflow: hidden;
    }

    .ad-slot-mid-article {
        min-height: 250px;
    }
}

@media (min-width: 769px) {
    /* Anchor only on mobile */
    .ad-slot-anchor {
        display: none !important;
    }
}

/* Make adsbygoogle fill its container - but allow it to grow in height for responsive units */
.ad-unit-wrapper ins.adsbygoogle {
    display: block !important;
    width: 100% !important;
}
/* Hide multiplex on homepage for better UX */
body.is-home .ad-slot-bottom-multiplex {
    display: none !important;
}

/* Auto-hide ad wrappers if Google fails to serve an ad (low fill rate) */
.ad-unit-wrapper:has(ins.adsbygoogle[data-ad-status="unfilled"]) {
    display: none !important;
}

/* Guide 2-Column Layout */
.guide-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

.guide-sidebar {
    display: none;
}

@media (min-width: 1024px) {
    .guide-layout {
        grid-template-columns: 1fr 336px; /* 336px to accommodate large rectangle/half page */
        gap: 3rem;
    }
    .guide-sidebar {
        display: block;
    }
    .sticky-sidebar-content {
        position: sticky;
        top: 120px; /* Keep below sticky header */
    }
}
