/* ============================================================
   Amar Pandey & Company — Financial Calculators
   Live fitted header + hero + calculator layout
   ============================================================ */

:root {
    --primary-dark: #0d2b4a;
    --primary-blue: #1a4a7a;
    --primary-soft: #eef6ff;
    --accent-orange: #f47f22;
    --accent-green: #29964a;
    --text-primary: #152436;
    --text-secondary: #5a6a7d;
    --white: #ffffff;
    --border-light: #dfebf5;
    --header-bg: #dcecf8;
    --page-bg: #f5f9fd;
    --gradient-hero: linear-gradient(135deg, #0d2b4a 0%, #1a4f82 52%, #2f79b5 100%);
    --gradient-orange: linear-gradient(135deg, #ff9b45 0%, #f47f22 100%);
    --gradient-green: linear-gradient(135deg, #1f833f 0%, #36ad58 100%);
    --shadow-sm: 0 8px 22px rgba(13, 43, 74, .07);
    --shadow-md: 0 16px 42px rgba(13, 43, 74, .12);
    --shadow-xl: 0 28px 90px rgba(13, 43, 74, .16);
    --shadow-orange: 0 16px 34px rgba(244, 127, 34, .28);
    --transition-base: all .24s ease;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; overflow-x: hidden; color: var(--text-primary); }
img, svg { max-width: 100%; }

/* Shared container — keeps the page fitted on live desktop screens */
.header .container,
.calc-hero .container,
.calculator-page-section .container,
.calculator-contact-band .container,
.footer .container {
    width: min(100% - 72px, 1320px) !important;
    max-width: 1320px !important;
    margin-inline: auto !important;
    padding-inline: 0 !important;
}

/* Header like the About page screenshot */
.header {
    position: sticky !important;
    top: 0;
    z-index: 1000;
    min-height: 78px;
    background: var(--header-bg) !important;
    border: 0 !important;
    box-shadow: none !important;
}

.header-inner {
    min-height: 78px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 28px;
    padding: 0 !important;
}

.logo {
    display: inline-flex !important;
    align-items: center;
    flex: 0 0 auto;
    text-decoration: none !important;
}

.logo-img {
    width: auto !important;
    height: 54px !important;
    max-width: 292px !important;
    object-fit: contain;
    display: block;
}

.nav-desktop {
    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: clamp(22px, 2vw, 34px);
    flex: 1 1 auto;
    margin: 0 24px 0 60px;
}

.nav-desktop a {
    position: relative;
    display: inline-flex;
    align-items: center;
    min-height: 78px;
    color: #21344a !important;
    text-decoration: none !important;
    font-size: 14px;
    font-weight: 900;
    letter-spacing: .01em;
    white-space: nowrap;
    transition: color .22s ease;
}

.nav-desktop a:hover,
.nav-desktop a.active { color: var(--primary-blue) !important; }

.nav-desktop a.active::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 18px;
    height: 2px;
    border-radius: 999px;
    background: var(--accent-orange);
}

.header-cta {
    display: flex;
    align-items: center;
    flex: 0 0 auto;
}

.btn,
.header .btn-primary,
.header-cta .btn-primary,
.button-row button,
.calc-cta-buttons a {
    border: 0;
    cursor: pointer;
    text-decoration: none !important;
    font: inherit;
    font-weight: 900;
    transition: var(--transition-base);
}

.header .btn-primary,
.header-cta .btn-primary {
    min-height: 44px;
    padding: 0 24px !important;
    border-radius: 9px !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    color: #fff !important;
    background: var(--gradient-orange) !important;
    box-shadow: var(--shadow-orange) !important;
}

.mobile-menu-btn {
    display: none;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 12px;
    background: #fff;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
}

.mobile-menu-btn span {
    display: block;
    width: 22px;
    height: 2px;
    margin: 5px auto;
    border-radius: 999px;
    background: var(--primary-dark);
}

.mobile-nav {
    background: var(--header-bg) !important;
}

/* Top hero exactly fitted below the sticky header */
.calc-hero {
    min-height: 268px;
    padding: 74px 0 68px;
    background: linear-gradient(90deg, rgba(13, 43, 74, .97) 0%, rgba(26, 74, 122, .95) 48%, rgba(45, 109, 163, .96) 100%);
    color: #fff;
    overflow: hidden;
    position: relative;
    display: flex;
    align-items: center;
}

.calc-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle, rgba(255, 255, 255, .09) 2px, transparent 2.4px);
    background-size: 25px 25px;
    opacity: .72;
}

.calc-hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 20% 10%, rgba(255,255,255,.06), transparent 28%), radial-gradient(circle at 86% 40%, rgba(255,255,255,.045), transparent 32%);
}

.calc-hero .container { position: relative; z-index: 1; }

.calc-hero-center {
    max-width: 880px;
    margin-inline: auto;
    text-align: center;
}

.calc-hero-center h1 {
    color: #fff;
    font-size: clamp(2.45rem, 4vw, 4rem);
    line-height: 1.08;
    font-weight: 950;
    letter-spacing: -.045em;
    margin: 0;
    text-shadow: 0 8px 30px rgba(0,0,0,.18);
}

.calc-hero-center p {
    max-width: 720px;
    margin: 24px auto 0;
    color: rgba(255,255,255,.88);
    font-size: clamp(1rem, 1.25vw, 1.18rem);
    line-height: 1.72;
    font-weight: 650;
}

#calculators,
.calc-page { scroll-margin-top: 104px; }

.calculator-page-section {
    padding: 76px 0 96px;
    background: linear-gradient(180deg, #fff 0%, var(--page-bg) 100%);
}

.section-title {
    text-align: center;
    max-width: 820px;
    margin: 0 auto 38px;
}

.section-title h2 {
    margin: 10px 0 10px;
    color: var(--primary-dark);
    font-size: clamp(2rem, 4vw, 3.2rem);
    line-height: 1.08;
    letter-spacing: -.045em;
}

.section-title p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 1.02rem;
    line-height: 1.65;
}

.section-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 999px;
    background: var(--primary-soft);
    color: var(--primary-blue);
    border: 1px solid rgba(26, 74, 122, .10);
    font-weight: 950;
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .08em;
}

.calculator-dashboard {
    display: grid;
    grid-template-columns: 310px minmax(0, 1fr);
    gap: 24px;
    align-items: start;
    width: 100%;
}

.calculator-tabs {
    position: sticky;
    top: 98px;
    display: grid;
    gap: 14px;
    min-width: 0;
}

.calc-tab {
    width: 100%;
    border: 1px solid var(--border-light);
    background: rgba(255,255,255,.94);
    color: var(--text-primary);
    border-radius: 22px;
    padding: 18px;
    text-align: left;
    cursor: pointer;
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr);
    column-gap: 14px;
    align-items: center;
    box-shadow: var(--shadow-md);
    transition: var(--transition-base);
}

.calc-tab b {
    width: 52px;
    height: 52px;
    display: grid;
    place-items: center;
    border-radius: 18px;
    color: #fff;
    background: var(--gradient-hero);
    box-shadow: var(--shadow-md);
    font-size: .95rem;
}

.calc-tab span {
    display: block;
    font-weight: 950;
    line-height: 1.25;
    min-width: 0;
}

.calc-tab small {
    grid-column: 2;
    display: block;
    color: var(--text-secondary);
    font-weight: 700;
    margin-top: 2px;
    min-width: 0;
}

.calc-tab:nth-child(2) b { background: var(--gradient-orange); }
.calc-tab:nth-child(3) b { background: var(--gradient-green); }

.calc-tab:hover,
.calc-tab.active {
    transform: translateY(-3px);
    border-color: rgba(26,74,122,.25);
    box-shadow: 0 18px 50px rgba(13,43,74,.14);
}

.calc-tab.active {
    background: linear-gradient(135deg, #ffffff 0%, #eef6ff 100%);
    outline: 2px solid rgba(26,74,122,.08);
}

.calculator-view { min-width: 0; width: 100%; }

.calc-page {
    display: none;
    width: 100%;
    min-width: 0;
    background: #fff;
    border: 1px solid rgba(13,43,74,.08);
    border-radius: 30px;
    overflow: hidden;
    box-shadow: 0 22px 70px rgba(13,43,74,.12);
    animation: calcAppear .32s ease both;
}

.calc-page.active { display: block; }

@keyframes calcAppear {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

.calc-head {
    position: relative;
    overflow: hidden;
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: center;
    padding: 26px 30px;
    color: #fff;
}

.calc-head::after {
    content: '';
    position: absolute;
    width: 180px;
    height: 180px;
    right: -70px;
    top: -80px;
    border-radius: 50%;
    background: rgba(255,255,255,.16);
}

.calc-head > * { position: relative; z-index: 1; }

.calc-head h3 {
    font-size: clamp(1.55rem, 2.4vw, 2.2rem);
    margin: 0 0 4px;
    letter-spacing: -.025em;
    line-height: 1.1;
}

.calc-head p { margin: 0; color: rgba(255,255,255,.87); }
.blue-head { background: var(--gradient-hero); }
.orange-head { background: var(--gradient-orange); }
.green-head { background: var(--gradient-green); }

.calc-badge {
    white-space: nowrap;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(255,255,255,.16);
    border: 1px solid rgba(255,255,255,.22);
    font-weight: 900;
    font-size: .82rem;
}

.calc-grid {
    display: grid;
    grid-template-columns: minmax(0, .92fr) minmax(0, 1.08fr);
    gap: 0;
    min-width: 0;
}

.form-card,
.result-card {
    padding: 30px;
    min-width: 0;
}

.form-card {
    background: radial-gradient(circle at top left, rgba(244,127,34,.08), transparent 36%), #fff;
    border-right: 1px solid var(--border-light);
}

.form-card h4 {
    font-size: 1.3rem;
    color: var(--primary-dark);
    margin: 0 0 18px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.form-grid label {
    color: var(--text-primary);
    font-size: .92rem;
    font-weight: 850;
    min-width: 0;
}

.form-grid label.full { grid-column: 1 / -1; }

.form-grid input,
.form-grid select {
    width: 100%;
    max-width: 100%;
    min-height: 46px;
    margin-top: 7px;
    padding: 11px 12px;
    border-radius: 14px;
    border: 1px solid var(--border-light);
    background: #fff;
    color: var(--text-primary);
    font: inherit;
    box-shadow: 0 1px 0 rgba(13,43,74,.02);
    transition: var(--transition-base);
}

.form-grid input[type="range"] {
    min-height: auto;
    padding: 0;
    accent-color: var(--primary-blue);
    box-shadow: none;
}

.form-grid input:focus,
.form-grid select:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 4px rgba(26,74,122,.12);
}

.form-grid input[type=number]::-webkit-outer-spin-button,
.form-grid input[type=number]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.form-grid input[type=number] { -moz-appearance: textfield; }

.button-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 22px 0 14px;
}

.button-row .btn,
.button-row button {
    min-height: 46px;
    padding: 0 22px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-primary,
.button-row .btn-primary {
    background: var(--gradient-orange);
    color: #fff;
    box-shadow: var(--shadow-orange);
}

.btn-light {
    background: #fff;
    color: var(--primary-blue);
    border: 1px solid var(--border-light);
}

.btn-orange {
    background: var(--gradient-orange);
    color: #fff;
    box-shadow: var(--shadow-orange);
}

.btn-green {
    background: var(--gradient-green);
    color: #fff;
    box-shadow: 0 14px 34px rgba(41, 150, 74, .22);
}

.btn:hover,
.button-row button:hover { transform: translateY(-3px); }

.mini-note {
    font-size: .86rem;
    line-height: 1.62;
    color: var(--text-secondary);
    background: #fff8ee;
    border: 1px solid rgba(244,127,34,.18);
    border-radius: 16px;
    padding: 12px 14px;
    margin: 0;
}

.result-card {
    background: radial-gradient(circle at top right, rgba(41,150,74,.08), transparent 35%), #fbfdff;
}

.main-result {
    text-align: center;
    padding: 24px;
    border-radius: 24px;
    background: #fff;
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
}

.main-result span {
    display: block;
    color: var(--text-secondary);
    font-weight: 900;
    font-size: .82rem;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.main-result strong {
    display: block;
    margin-top: 8px;
    color: var(--primary-blue);
    font-size: clamp(2rem, 4vw, 3.15rem);
    line-height: 1.05;
    letter-spacing: -.045em;
}

.result-card.emi .main-result strong { color: var(--accent-orange); }
.result-card.gst .main-result strong { color: var(--accent-green); }

.visual-row {
    display: grid;
    grid-template-columns: 166px minmax(0, 1fr);
    gap: 22px;
    align-items: center;
    margin: 24px 0;
    min-width: 0;
}

.donut {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: conic-gradient(var(--primary-blue) 0deg, #e8eef4 0deg);
    position: relative;
    box-shadow: inset 0 0 0 1px rgba(13,43,74,.08), var(--shadow-md);
}

.donut::after {
    content: '';
    position: absolute;
    inset: 18px;
    border-radius: 50%;
    background: #fff;
    box-shadow: inset 0 0 0 1px rgba(13,43,74,.06);
}

.donut div { position: relative; z-index: 1; text-align: center; }
.donut small { display: block; color: var(--text-secondary); font-weight: 900; font-size: .72rem; text-transform: uppercase; }
.donut b { display: block; color: var(--primary-dark); font-size: 1.38rem; }
.emi-donut { background: conic-gradient(var(--accent-orange) 0deg, #e8eef4 0deg); }
.gst-donut { background: conic-gradient(var(--accent-green) 0deg, #e8eef4 0deg); }

.bar-area { display: grid; gap: 15px; min-width: 0; }
.bar-area p {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    margin: 0 0 7px;
    color: var(--text-secondary);
    font-weight: 750;
}
.bar-area p b { color: var(--text-primary); white-space: nowrap; }
.bar { height: 13px; border-radius: 999px; background: #e8eef4; overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--gradient-hero); transition: width .45s ease; }
.result-card.emi .bar i { background: var(--gradient-orange); }
.result-card.gst .bar i { background: var(--gradient-green); }

.summary-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 22px;
}

.summary-grid > div {
    background: #fff;
    border: 1px solid var(--border-light);
    border-radius: 18px;
    padding: 14px;
    box-shadow: var(--shadow-sm);
    min-width: 0;
}

.summary-grid span {
    display: block;
    color: var(--text-secondary);
    font-size: .78rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .05em;
}

.summary-grid strong {
    display: block;
    color: var(--primary-dark);
    font-size: 1.12rem;
    margin-top: 4px;
    word-break: break-word;
}

.table-wrap {
    overflow-x: auto;
    border-radius: 18px;
    border: 1px solid var(--border-light);
    background: #fff;
    max-width: 100%;
}

.calculator-dashboard table {
    width: 100%;
    min-width: 0;
    border-collapse: collapse;
    table-layout: fixed;
}

.calculator-dashboard th,
.calculator-dashboard td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-light);
    text-align: left;
    vertical-align: middle;
}

.calculator-dashboard th {
    background: #f2f6fb;
    color: var(--primary-dark);
    font-size: .82rem;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.calculator-dashboard td:first-child,
.calculator-dashboard th:first-child { width: 58%; }
.calculator-dashboard td:last-child,
.calculator-dashboard th:last-child {
    width: 42%;
    text-align: right;
    font-weight: 900;
    white-space: nowrap;
}

.calculator-dashboard tr:last-child td { border-bottom: 0; }
.calculator-dashboard .success { color: #16733c; }
.calculator-dashboard .danger { color: #b42318; }

.calculator-contact-band { padding: 0 0 96px; background: var(--page-bg); }
.calculator-contact-card {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    align-items: center;
    padding: 34px;
    border-radius: 28px;
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-blue));
    color: #fff;
    box-shadow: var(--shadow-xl);
}
.calculator-contact-card h2 { margin: 12px 0 8px; font-size: clamp(1.7rem, 3vw, 2.45rem); }
.calculator-contact-card p { color: rgba(255,255,255,.82); max-width: 720px; }
.calc-cta-buttons { display: flex; flex-wrap: wrap; gap: 12px; justify-content: flex-end; }

.calc-tab:focus-visible,
.form-grid input:focus-visible,
.form-grid select:focus-visible,
.button-row button:focus-visible,
.calc-cta-buttons a:focus-visible {
    outline: 3px solid rgba(244,127,34,.42);
    outline-offset: 3px;
}

@media (max-width: 1180px) {
    .header .container,
    .calc-hero .container,
    .calculator-page-section .container,
    .calculator-contact-band .container,
    .footer .container {
        width: min(100% - 44px, 1180px) !important;
    }
    .nav-desktop { gap: 22px; margin-left: 28px; margin-right: 14px; }
    .logo-img { max-width: 250px !important; height: 48px !important; }
    .header .btn-primary, .header-cta .btn-primary { padding: 0 18px !important; }
    .calculator-dashboard { grid-template-columns: 292px minmax(0, 1fr); }
}

@media (max-width: 1080px) {
    .calculator-dashboard,
    .calc-grid { grid-template-columns: 1fr; }

    .calculator-tabs {
        position: relative;
        top: auto;
        display: flex;
        gap: 12px;
        overflow-x: auto;
        padding: 0 2px 10px;
        scroll-snap-type: x mandatory;
    }

    .calc-tab {
        min-width: 250px;
        grid-template-columns: 44px minmax(0, 1fr);
        padding: 14px;
        scroll-snap-align: start;
    }

    .calc-tab b { width: 44px; height: 44px; border-radius: 15px; }
    .form-card { border-right: 0; border-bottom: 1px solid var(--border-light); }
}

@media (max-width: 940px) {
    .header { min-height: 72px; }
    .header-inner { min-height: 72px !important; }
    .logo-img { max-width: 238px !important; height: 44px !important; }
    .nav-desktop,
    .header-cta { display: none !important; }
    .mobile-menu-btn { display: block !important; }
    .mobile-nav {
        padding: 14px 22px 20px;
        border-top: 1px solid rgba(13,43,74,.08);
        box-shadow: 0 18px 40px rgba(13,43,74,.10);
    }
    .mobile-nav a {
        color: #203246 !important;
        font-weight: 850;
        text-decoration: none !important;
        padding: 12px 0;
    }
    .calc-hero { min-height: 236px; padding: 60px 0 54px; }
    #calculators, .calc-page { scroll-margin-top: 92px; }
}

@media (max-width: 760px) {
    .header .container,
    .calc-hero .container,
    .calculator-page-section .container,
    .calculator-contact-band .container,
    .footer .container {
        width: min(100% - 28px, 1180px) !important;
    }

    .calculator-page-section { padding: 56px 0 72px; }
    .section-title { margin-bottom: 26px; }
    .calc-head { flex-direction: column; align-items: flex-start; padding: 22px; }
    .form-card, .result-card { padding: 22px; }
    .form-grid, .summary-grid, .visual-row { grid-template-columns: 1fr; }
    .visual-row { margin: 20px 0; }
    .donut { margin: 0 auto; }
    .button-row .btn, .button-row button { width: 100%; justify-content: center; }
    .calculator-tabs { margin-left: -4px; margin-right: -4px; }
    .calc-tab { min-width: 86%; }
    .calc-page { border-radius: 24px; }
    .main-result { padding: 20px 14px; }
    .calculator-dashboard table { min-width: 460px; table-layout: auto; }
    .calculator-contact-card { padding: 24px; flex-direction: column; align-items: flex-start; }
    .calc-cta-buttons { justify-content: flex-start; width: 100%; }
    .calc-cta-buttons .btn { flex: 1; justify-content: center; }
}

@media (max-width: 560px) {
    .logo-img { max-width: 214px !important; height: 40px !important; }
    .calc-hero { min-height: 216px; padding: 48px 0 44px; }
    .calc-hero-center h1 { font-size: clamp(2rem, 10vw, 2.65rem); }
    .calc-hero-center p { font-size: .96rem; line-height: 1.62; margin-top: 18px; }
    .calc-head h3 { font-size: 1.45rem; }
    .calc-badge { white-space: normal; }
    .summary-grid > div { padding: 12px; }
    .summary-grid strong { font-size: 1rem; }
}

@media print {
    .header,
    .mobile-nav,
    .calc-hero,
    .calculator-tabs,
    .calculator-contact-band,
    .footer,
    .whatsapp-float,
    #scroll-progress,
    #scroll-top { display: none !important; }

    .calculator-page-section { padding: 0; background: #fff; }
    .calculator-dashboard { display: block; }
    .calc-page { display: none !important; box-shadow: none; border: 1px solid #ccc; }
    .calc-page.active { display: block !important; }
    .form-card { display: none; }
    .calc-grid { display: block; }
    .result-card { background: #fff; }
}

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