@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=Poppins:wght@600;700&display=swap');

:root {
    --green-deep: #0b3b20;
    --green-bright: #1f7d3b;
    --green-soft: #2f9f5b;
    --cream: #f6f8f3;
    --white: #ffffff;
    --grey-900: #1c2228;
    --grey-700: #37424b;
    --grey-600: #49545d;
    --grey-400: #7e8a93;
    --grey-200: #dbe2da;
    --highlight-gold: #f4c144;
    --accent-error: #c90016;
    --shadow-soft: 0 28px 70px rgba(11, 59, 32, 0.16);
    --shadow-light: 0 14px 28px rgba(11, 59, 32, 0.14);
    --radius-lg: 28px;
    --radius-xl: 32px;
    --radius-md: 18px;
    --radius-sm: 12px;
}

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

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

body {
    margin: 0;
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: linear-gradient(180deg, #f9fbf6 0%, var(--cream) 45%, #edf3ed 100%);
    color: var(--grey-900);
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    position: relative;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    background:
        radial-gradient(60% 50% at 12% 18%, rgba(31, 125, 59, 0.18), transparent 72%),
        radial-gradient(42% 40% at 85% 8%, rgba(244, 193, 68, 0.24), transparent 70%),
        radial-gradient(60% 60% at 50% 90%, rgba(11, 59, 32, 0.14), transparent 75%);
    z-index: -1;
    pointer-events: none;
    animation: backgroundGlow 20s ease-in-out infinite alternate;
}

h1, h2, h3, h4, h5, h6 {
    font-family: "Poppins", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-weight: 600;
    margin: 0;
    letter-spacing: -0.01em;
}

p {
    margin: 0 0 1rem;
    color: var(--grey-700);
}

a {
    color: inherit;
    text-decoration: none;
}

ul, ol {
    margin: 0;
    padding: 0;
    list-style: none;
}

img {
    max-width: 100%;
    display: block;
}

button,
input,
select {
    font: inherit;
}

button {
    cursor: pointer;
    border: none;
    background: none;
}

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

:focus-visible {
    outline: 3px solid rgba(31, 125, 59, 0.45);
    outline-offset: 3px;
}

/* Header */
.global-header {
    position: sticky;
    top: 0;
    z-index: 40;
    background: linear-gradient(120deg, rgba(11, 59, 32, 0.95), rgba(31, 125, 59, 0.92));
    color: var(--white);
    backdrop-filter: blur(18px);
    box-shadow: 0 18px 36px rgba(9, 38, 20, 0.24);
}

.global-header::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(140% 180% at 10% -40%, rgba(244, 193, 68, 0.4), transparent 60%);
    opacity: 0.55;
    pointer-events: none;
}

.global-header__primary {
    position: relative;
    max-width: 1180px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 24px;
    align-items: center;
    padding: 22px 24px;
}

.logo {
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.32em;
    text-transform: uppercase;
}

.menu-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 16px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.12);
    color: inherit;
    transition: background 0.2s ease, border 0.2s ease;
}

.menu-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
}

.menu-toggle__bar {
    width: 18px;
    height: 2px;
    background: currentColor;
    border-radius: 999px;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.menu-toggle__label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

.menu-toggle[aria-expanded="true"] .menu-toggle__bar:nth-child(1) {
    transform: translateY(4px) rotate(45deg);
}

.menu-toggle[aria-expanded="true"] .menu-toggle__bar:nth-child(2) {
    opacity: 0;
}

.menu-toggle[aria-expanded="true"] .menu-toggle__bar:nth-child(3) {
    transform: translateY(-4px) rotate(-45deg);
}

.primary-nav {
    display: flex;
    justify-content: center;
    gap: 20px;
    font-size: 0.96rem;
}

.primary-nav a {
    position: relative;
    padding: 6px 0;
    opacity: 0.85;
    transition: opacity 0.2s ease;
}

.primary-nav a::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -3px;
    width: 100%;
    height: 2px;
    background: var(--highlight-gold);
    border-radius: 999px;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.2s ease;
}

.primary-nav a:hover,
.primary-nav a:focus-visible {
    opacity: 1;
}

.primary-nav a:hover::after,
.primary-nav a:focus-visible::after {
    transform: scaleX(1);
}

.header-actions {
    display: flex;
    justify-content: flex-end;
    gap: 14px;
    align-items: center;
}

.tools-dropdown {
    position: relative;
}

.tools-dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    margin-top: 10px;
    background: var(--white);
    color: var(--grey-900);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-soft);
    min-width: 240px;
    padding: 8px;
    z-index: 50;
}

.tools-dropdown:hover .tools-dropdown-content {
    display: block;
}

.tools-dropdown-content a {
    display: block;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    transition: background-color 0.2s ease;
}

.tools-dropdown-content a:hover {
    background-color: rgba(31, 125, 59, 0.1);
    color: var(--green-deep);
}

/* This class will be toggled by JS to show/hide the dropdown */
.tools-dropdown.is-open .tools-dropdown-content {
    display: block;
    animation: fadeIn 0.2s ease-out;
}

/* Layout */
main {
    display: flex;
    flex-direction: column;
    gap: 88px;
    padding-bottom: 128px;
}

.hero {
    position: relative;
    max-width: 1180px;
    margin: 0 auto;
    padding: 80px 28px 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 420px;
    gap: 72px;
}

.hero::before {
    content: "";
    position: absolute;
    inset: 10% -18% -15% -18%;
    background:
        radial-gradient(70% 90% at 65% 15%, rgba(244, 193, 68, 0.24), transparent 72%),
        radial-gradient(60% 80% at 12% 82%, rgba(31, 125, 59, 0.24), transparent 75%);
    filter: blur(28px);
    z-index: -1;
    animation: heroPulse 14s ease-in-out infinite alternate;
}

.calculator-dashboard {
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 28px;
    display: grid;
    grid-template-columns: minmax(0, 420px) 1fr;
    gap: 48px;
}
.hero-copy h1 {
    font-size: clamp(2.6rem, 3.1vw + 1rem, 3.4rem);
    line-height: 1.15;
    margin-bottom: 20px;
    background: linear-gradient(118deg, var(--green-deep), var(--green-bright));
    -webkit-background-clip: text;
    color: transparent;
}

.hero-copy p {
    font-size: 1.05rem;
    max-width: 620px;
    margin-bottom: 24px;
}

.hero-highlights {
    display: grid;
    gap: 12px;
    font-size: 0.98rem;
}

.hero-highlights li {
    position: relative;
    padding-left: 26px;
    color: var(--grey-600);
}

.hero-highlights li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 10px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--green-bright);
    box-shadow: 0 0 0 6px rgba(31, 125, 59, 0.16);
}

.calculator-card {
    position: relative;
    background: rgba(255, 255, 255, 0.92);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-soft);
    padding: 42px 36px;
    display: grid;
    gap: 30px;
    overflow: hidden;
    transform: translateZ(0);
    animation: cardFloat 12s ease-in-out infinite alternate;
}

.calculator-card::after {
    content: "";
    position: absolute;
    inset: auto -40% -45% auto;
    width: 360px;
    height: 360px;
    background: radial-gradient(circle, rgba(31, 125, 59, 0.32), transparent 74%);
    opacity: 0.45;
}

#nssf-form {
    display: grid;
    gap: 20px;
    position: relative;
}

.label-large {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--grey-700);
}


.input-feedback {
    min-height: 1.2em;
    font-size: 0.82rem;
    color: var(--accent-error);
    margin-top: 6px;
}

.input-hint {
    font-size: 0.82rem;
    color: var(--grey-400);
    margin-top: 6px;
}

#gross-salary {
    width: 100%;
    padding: 14px 18px;
    border-radius: 18px;
    border: 1px solid rgba(12, 56, 29, 0.2);
    background: rgba(255, 255, 255, 0.95);
    font-size: 1.05rem;
    color: var(--grey-900);
    transition: border 0.2s ease, box-shadow 0.2s ease, transform 0.12s ease;
}

#gross-salary:focus-visible {
    border-color: var(--green-bright);
    box-shadow: 0 0 0 5px rgba(31, 125, 59, 0.18);
}

#gross-salary:active {
    transform: scale(0.995);
}

.results-dashboard-panel {
    background: rgba(255, 255, 255, 0.6);
    border-radius: var(--radius-xl);
    padding: 32px 36px;
    border: 1px solid rgba(11, 59, 32, 0.1);
    box-shadow: var(--shadow-light);
}

.results-dashboard-panel h3 {
    font-size: 1.2rem;
    margin-bottom: 24px;
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.result-item {
    background: rgba(31, 125, 59, 0.06);
    border-radius: var(--radius-md);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    box-shadow: inset 0 0 0 1px rgba(31, 125, 59, 0.1);
}

.result-item.result-total {
    background: rgba(31, 125, 59, 0.12);
}

.result-item strong {
    font-size: 1.2rem;
    color: var(--green-deep);
    font-weight: 600;
}

.projections {
    margin-top: 24px;
    padding: 16px;
    background: rgba(11, 59, 32, 0.04);
    border-radius: var(--radius-md);
    font-size: 0.9rem;
}

.result-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-radius: var(--radius-md);
    background: linear-gradient(125deg, rgba(31, 125, 59, 0.16), rgba(11, 59, 32, 0.2));
    font-weight: 600;
    color: var(--green-deep);
    animation: highlightFlash 3.2s ease-in-out infinite;
    margin-bottom: 16px;
}

.result-line span {
    font-size: 1rem;
    color: rgba(12, 56, 29, 0.82);
}

.result-line strong {
    font-size: 1.4rem;
}

.result-line .currency {
    font-size: 1rem;
    margin-left: 4px;
}

.article-section {
    max-width: 840px;
    margin: 0 auto;
    padding: 0 28px;
}

.article-content {
    background: rgba(255, 255, 255, 0.94);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    padding: 48px;
    border: 1px solid rgba(11, 59, 32, 0.12);
}

.article-content h2 {
    font-size: 2.1rem;
    margin-bottom: 16px;
}

.article-content h3 {
    font-size: 1.5rem;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
}

.article-content p,
.article-content li {
    line-height: 1.7;
    margin-bottom: 1rem;
}

.article-content ul,
.article-content ol {
    padding-left: 20px;
    list-style: initial;
}

.article-content ul li,
.article-content ol li {
    padding-left: 8px;
    margin-bottom: 0.75rem;
}

.article-content .article-intro {
    font-size: 1.1rem;
    color: var(--grey-900);
}

.calculator-aside {
    background: rgba(11, 59, 32, 0.08);
    border-radius: 20px;
    padding: 20px 22px;
    display: grid;
    gap: 12px;
}

.calculator-aside h3 {
    font-size: 1.05rem;
    color: var(--green-deep);
}

.calculator-aside li {
    font-size: 0.9rem;
    color: var(--grey-600);
}

/* How-to steps */
.how-to {
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 28px;
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr);
    gap: 32px;
    align-items: center;
}

.how-to-text h2 {
    font-size: 2.15rem;
}

/* Tables */
.vat-tables {
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 28px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
}

.table-block {
    background: rgba(255, 255, 255, 0.94);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    padding: 28px;
    display: grid;
    gap: 18px;
    overflow-x: auto;
}

table {
    width: 100%;
    min-width: 320px;
    border-collapse: collapse;
}

caption {
    font-weight: 600;
    text-align: left;
    margin-bottom: 12px;
}

thead tr {
    background: rgba(31, 125, 59, 0.14);
}

th,
td {
    text-align: left;
    padding: 12px 14px;
    font-size: 0.95rem;
    border-bottom: 1px solid var(--grey-200);
}

tbody tr:last-of-type td {
    border-bottom: none;
}

.table-note h3 {
    font-size: 1.05rem;
    margin-bottom: 6px;
}

.table-note p {
    color: var(--grey-600);
}

.penalty-results {
    display: grid;
    gap: 18px;
    margin-top: 2px;
}

.penalty-result,
.penalty-total {
    background: rgba(31, 125, 59, 0.1);
    border-radius: 18px;
    padding: 20px 22px;
    display: grid;
    gap: 6px;
    box-shadow: inset 0 0 0 1px rgba(31, 125, 59, 0.14);
}

.penalty-label {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--grey-600);
}

/* More Tools Section */
.more-tools-section {
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 28px;
}

.more-tools-section h2 {
    font-size: 2.1rem;
    margin-bottom: 24px;
}

.tool-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 24px;
}

.tool-card {
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid rgba(11, 59, 32, 0.12);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    padding: 28px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.tool-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(11, 59, 32, 0.18);
}

.chart-container {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--grey-200);
}

/* Print */
@media print {
    body {
        background: var(--white);
        color: #000;
    }

    body::before,
    .global-header,
    .cta-banner,
    .site-footer {
        display: none;
    }

    main {
        padding: 0;
        gap: 32px;
    }

    .hero,
    .calculator-card,
    .article-section,
    .table-block,
    .faq {
        box-shadow: none;
        background: #fff;
        padding: 0;
    }

    a[href^="http"]::after {
        content: " (" attr(href) ")";
        font-size: 0.8em;
    }
}

/* CTA */
.cta-banner {
    margin: 0 28px;
    padding: 56px 46px;
    background: linear-gradient(125deg, var(--green-deep), var(--green-bright));
    color: var(--white);
    border-radius: 32px;
    box-shadow: var(--shadow-soft);
    display: grid;
    gap: 24px;
}

.cta-button:hover {
    transform: translateY(-1px);
    background: #f7d769;
}

.cta-button--ghost {
    background: rgba(255, 255, 255, 0.1);
    color: var(--white);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 10px 18px;
    box-shadow: none;
}
.cta-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 20px;
    border-radius: 999px;
    background: var(--highlight-gold);
    color: var(--grey-900);
    font-weight: 600;
    transition: transform 0.2s ease, background 0.2s ease;
}

.cta-button--ghost:hover {
    background: rgba(31, 125, 59, 0.12);
    transform: translateY(-1px);
}

.form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 8px;
}

/* FAQ */
.faq {
    max-width: 840px;
    margin: 0 auto;
    padding: 0 28px;
    display: grid;
    gap: 20px;
}

.faq h2 {
    font-size: 2.1rem;
}

.faq details {
    background: rgba(255, 255, 255, 0.96);
    border-radius: 20px;
    padding: 20px 22px;
    box-shadow: var(--shadow-soft);
    border: 1px solid rgba(11, 59, 32, 0.14);
    transition: transform 0.2s ease, border 0.2s ease;
}

.faq details[open] {
    transform: translateY(-2px);
    border-color: rgba(31, 125, 59, 0.28);
}

.faq summary {
    cursor: pointer;
    font-weight: 600;
    list-style: none;
    outline: none;
}

.faq summary::-webkit-details-marker {
    display: none;
}

.faq details p {
    margin-top: 12px;
}

/* Footer */
.site-footer {
    background: #0d1b23;
    color: var(--white);
    padding: 68px 28px 38px;
}

.footer-columns {
    max-width: 1180px;
    margin: 0 auto 44px auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 34px;
}

.footer-column h4 {
    font-size: 1rem;
    margin-bottom: 16px;
}

.footer-column ul {
    display: grid;
    gap: 10px;
    font-size: 0.94rem;
    opacity: 0.9;
}

.footer-column a:hover {
    text-decoration: underline;
}

.footer-base {
    max-width: 1180px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    padding-top: 26px;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.footer-logo {
    font-weight: 700;
    letter-spacing: 0.28em;
    font-size: 0.88rem;
    text-transform: uppercase;
}

.footer-links {
    display: flex;
    gap: 18px;
    flex-wrap: wrap;
    font-size: 0.94rem;
}

.footer-disclaimer {
    max-width: 1180px;
    margin: 26px auto 0 auto;
    font-size: 0.86rem;
    opacity: 0.72;
    line-height: 1.5;
}

/* Animations */
@keyframes backgroundGlow {
    from {
        opacity: 0.75;
        transform: scale(1);
    }
    to {
        opacity: 1;
        transform: scale(1.05);
    }
}

@keyframes heroPulse {
    from {
        transform: translate3d(-12px, 0, 0) scale(1);
    }
    to {
        transform: translate3d(12px, -12px, 0) scale(1.03);
    }
}

@keyframes cardFloat {
    from {
        transform: translateY(0);
    }
    to {
        transform: translateY(-8px);
    }
}

@keyframes highlightFlash {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(31, 125, 59, 0.24);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(31, 125, 59, 0.08);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive */
@media (max-width: 1100px) {
    .hero {
        grid-template-columns: 1fr;
        gap: 64px;
        padding: 68px 32px 0;
    }

    .calculator-dashboard {
        grid-template-columns: 1fr;
    }

    .calculator-card {
        max-width: 600px;
        margin: 0 auto;
    }

    .how-to {
        grid-template-columns: 1fr;
        gap: 40px;
    }
}

@media (max-width: 920px) {
    .global-header__primary {
        grid-template-columns: auto auto;
        grid-template-areas:
            "logo toggle"
            "nav nav"
            "actions actions";
    }

    .logo {
        grid-area: logo;
    }

    .menu-toggle {
        display: inline-flex;
        grid-area: toggle;
        justify-self: end;
    }

    .primary-nav {
        grid-area: nav;
        flex-direction: column;
        gap: 14px;
        display: none;
        background: rgba(11, 59, 32, 0.94);
        padding: 18px 20px 20px;
        border-radius: 20px;
        width: 100%;
    }

    .global-header.menu-open .primary-nav {
        display: flex;
    }

    .header-actions {
        grid-area: actions;
        justify-content: flex-start;
    }

    .hero::before {
        inset: 12% -28% -18% -28%;
    }
}

@media (max-width: 760px) {
    main {
        gap: 68px;
    }

    .hero {
        padding: 60px 18px 0;
    }

    .calculator-dashboard,
    .article-section,
    .how-to,
    .more-tools-section,
    .vat-tables,
    .faq {
        padding: 0 18px;
    }

    .calculator-card {
        padding: 32px 26px;
    }

    .results-grid {
        grid-template-columns: 1fr 1fr;
    }

    .cta-banner {
        margin: 0 18px;
        padding: 44px 26px;
        border-radius: 26px;
    }

    .tool-card {
        padding: 24px;
    }

    .footer-columns {
        grid-template-columns: 1fr;
    }

    .footer-base {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

@supports (backdrop-filter: blur(12px)) {
    .calculator-card,
    .faq details {
        backdrop-filter: blur(10px);
    }
}