/* Legal71 Tax Calculator — client-side only (no DB), two tabs: Income Tax Calculator
   (individual) and Company TDS Calculator (salary TDS). Self-contained styles — the
   frontend uses a purged static style.css with no runtime Tailwind JIT, so this whole
   page is plain CSS rather than Tailwind utility classes (see the hero-stat-card bug in
   home.css for why: an uncompiled utility class silently no-ops instead of erroring).
   Palette/type matches the rest of the site: navy #202050 headings, Inter body font,
   brand orange gradient (#F05A2B → #FA991B) for accents/CTAs, the same badge/title/
   subtitle look as .gallery-head (gallery.css) for section-header consistency. */

.taxcalc-section {
    background: linear-gradient(180deg, #ffffff 0%, #f5f4ff 100%);
    padding: 3rem 0 4.5rem;
}
@media (min-width: 768px) { .taxcalc-section { padding: 4rem 0 5.5rem; } }

.taxcalc-head {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 2rem;
    text-align: center;
}
.taxcalc-badge {
    font-family: Inter, sans-serif;
    font-weight: 600;
    font-size: 0.95rem;
    line-height: 1;
    color: #F05A2B;
    background: rgba(240, 90, 43, 0.1);
    border: 1px solid rgba(240, 90, 43, 0.28);
    padding: 0.35rem 1.1rem;
    border-radius: 9999px;
}
.taxcalc-title {
    font-family: Inter, sans-serif;
    font-weight: 700;
    font-size: clamp(1.6rem, 3.5vw, 2.25rem);
    line-height: 1.25;
    color: #202050;
}
.taxcalc-subtitle {
    max-width: 38rem;
    margin-top: -0.15rem;
    font-family: Inter, sans-serif;
    font-size: 0.98rem;
    line-height: 1.6;
    color: #5b5f77;
}

/* Tab switcher — a pill segmented control, active tab gets the brand gradient. */
.taxcalc-tabs-wrap {
    display: flex;
    justify-content: center;
    margin-bottom: 2.5rem;
}
.taxcalc-tabs {
    display: inline-flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.35rem;
    background: #fff;
    border: 1px solid rgba(32, 32, 80, 0.08);
    border-radius: 9999px;
    padding: 0.35rem;
    box-shadow: 0 10px 30px rgba(32, 32, 80, 0.06);
}
.taxcalc-tab {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border: 0;
    background: transparent;
    cursor: pointer;
    font-family: Inter, sans-serif;
    font-weight: 600;
    font-size: 0.92rem;
    color: #5b5f77;
    padding: 0.65rem 1.35rem;
    border-radius: 9999px;
    white-space: nowrap;
    transition: background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}
.taxcalc-tab svg { width: 18px; height: 18px; flex-shrink: 0; }
.taxcalc-tab:hover:not(.is-active) { background: rgba(240, 90, 43, 0.08); color: #F05A2B; }
.taxcalc-tab.is-active {
    background-image: linear-gradient(90deg, #F05A2B 0%, #FA991B 100%);
    color: #fff;
    box-shadow: 0 8px 20px rgba(240, 90, 43, 0.28);
}

/* Card */
.taxcalc-card {
    max-width: 940px;
    margin: 0 auto;
    background: #fff;
    border-radius: 28px;
    padding: 1.5rem;
    box-shadow: 0 20px 60px rgba(32, 32, 80, 0.08);
}
@media (min-width: 640px) { .taxcalc-card { padding: 2rem; } }
@media (min-width: 1024px) { .taxcalc-card { padding: 2.5rem 2.75rem; } }

.taxcalc-card-head { margin-bottom: 1.75rem; }
.taxcalc-card-head h2 {
    margin: 0 0 0.35rem;
    font-family: Inter, sans-serif;
    font-weight: 700;
    font-size: 1.4rem;
    color: #202050;
}
.taxcalc-card-head p {
    margin: 0;
    font-family: Inter, sans-serif;
    font-size: 0.92rem;
    color: #6b7280;
    line-height: 1.6;
}

.taxcalc-field--solo { max-width: 220px; margin-bottom: 2rem; }

.taxcalc-field { display: flex; flex-direction: column; gap: 0.35rem; min-width: 0; }
.taxcalc-field label {
    font-family: Inter, sans-serif;
    font-weight: 600;
    font-size: 0.74rem;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.taxcalc-field input,
.taxcalc-field select {
    width: 100%;
    font-family: Inter, sans-serif;
    font-size: 0.95rem;
    color: #202050;
    background: #F7F7FC;
    border: 1px solid rgba(32, 32, 80, 0.1);
    border-radius: 12px;
    padding: 0.65rem 0.85rem;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}
.taxcalc-field input:focus,
.taxcalc-field select:focus {
    border-color: #F05A2B;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(240, 90, 43, 0.12);
}

/* Blocks */
.taxcalc-block { margin-bottom: 2rem; }
.taxcalc-block-title {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0 0 1rem;
    font-family: Inter, sans-serif;
    font-weight: 700;
    font-size: 1.02rem;
    color: #202050;
}
.taxcalc-block-title span {
    font-weight: 500;
    font-size: 0.78rem;
    color: #9698a8;
}

/* Salary component rows */
.taxcalc-rows {
    border: 1px solid rgba(32, 32, 80, 0.08);
    border-radius: 16px;
    overflow: hidden;
}
.taxcalc-row {
    display: grid;
    grid-template-columns: minmax(96px, 1.3fr) repeat(3, minmax(0, 1fr));
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 0.9rem;
    border-bottom: 1px solid rgba(32, 32, 80, 0.06);
}
.taxcalc-row:last-child { border-bottom: 0; }
.taxcalc-row:nth-child(even) { background: #FAFAFD; }
.taxcalc-row-head {
    background: #F1F0FF !important;
    font-family: Inter, sans-serif;
    font-weight: 700;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #5b5f77;
}
.taxcalc-row-label { font-family: Inter, sans-serif; font-weight: 600; font-size: 0.88rem; color: #202050; }
.taxcalc-row input {
    width: 100%;
    min-width: 0;
    border: 1px solid rgba(32, 32, 80, 0.1);
    border-radius: 10px;
    background: #fff;
    padding: 0.45rem 0.55rem;
    font-family: Inter, sans-serif;
    font-size: 0.86rem;
    color: #202050;
    text-align: right;
    outline: none;
}
.taxcalc-row input:focus { border-color: #F05A2B; box-shadow: 0 0 0 3px rgba(240, 90, 43, 0.12); }
.taxcalc-row-out { font-family: Inter, sans-serif; font-weight: 700; font-size: 0.9rem; color: #F05A2B; text-align: right; }

@media (max-width: 480px) {
    .taxcalc-row { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 0.35rem; }
    .taxcalc-row-label { grid-column: 1 / -1; }
    .taxcalc-row-head .taxcalc-row-label { display: none; }
}

/* Summary stat cards */
.taxcalc-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.9rem;
    margin-bottom: 2rem;
}
.taxcalc-stat {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    background: #F7F7FC;
    border-radius: 16px;
    padding: 1rem 1.1rem;
}
.taxcalc-stat span {
    font-family: Inter, sans-serif;
    font-weight: 600;
    font-size: 0.72rem;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.taxcalc-stat strong { font-family: Inter, sans-serif; font-weight: 700; font-size: 1.2rem; color: #202050; }
.taxcalc-stat--accent { background: linear-gradient(135deg, rgba(240, 90, 43, 0.09), rgba(250, 153, 27, 0.09)); border: 1px solid rgba(240, 90, 43, 0.18); }
.taxcalc-stat--accent strong { color: #F05A2B; }

/* Tax slab breakdown */
.taxcalc-slabs { border: 1px solid rgba(32, 32, 80, 0.08); border-radius: 16px; overflow: hidden; }
.taxcalc-slab-row {
    display: grid;
    grid-template-columns: 1fr 0.55fr 1fr;
    gap: 0.5rem;
    padding: 0.55rem 0.9rem;
    border-bottom: 1px solid rgba(32, 32, 80, 0.06);
    font-family: Inter, sans-serif;
    font-size: 0.86rem;
    color: #202050;
}
.taxcalc-slab-row:last-child { border-bottom: 0; }
.taxcalc-slab-row span:nth-child(2) { text-align: center; color: #6b7280; }
.taxcalc-slab-row span:last-child { text-align: right; font-weight: 600; }
.taxcalc-slab-head {
    background: #F1F0FF;
    font-weight: 700;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #5b5f77;
}
.taxcalc-slab-total { background: #FAFAFD; font-weight: 700; }
.taxcalc-slab-total span:last-child { color: #F05A2B; }

/* Investment / rebate panel */
.taxcalc-block--panel {
    background: #FBF9FF;
    border: 1px solid rgba(32, 32, 80, 0.06);
    border-radius: 20px;
    padding: 1.25rem 1.4rem;
}
.taxcalc-kv {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.25rem 1.25rem;
    margin-bottom: 1rem;
}
.taxcalc-kv div {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.5rem 0;
    border-bottom: 1px dashed rgba(32, 32, 80, 0.12);
    font-family: Inter, sans-serif;
    font-size: 0.86rem;
}
.taxcalc-kv div span { color: #6b7280; }
.taxcalc-kv div strong { color: #202050; font-weight: 700; }

/* Final result panel */
.taxcalc-result {
    background: #202050;
    border-radius: 20px;
    padding: 1.4rem 1.5rem;
    color: #fff;
    margin-bottom: 1.5rem;
}
.taxcalc-result-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
    padding: 0.5rem 0;
    font-family: Inter, sans-serif;
    font-size: 0.88rem;
    color: rgba(255, 255, 255, 0.72);
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}
.taxcalc-result-row em { font-style: normal; font-size: 0.76rem; opacity: 0.75; }
.taxcalc-result-row strong { color: #fff; font-weight: 600; }
.taxcalc-result-final {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    padding-top: 1rem;
}
.taxcalc-result-final span { font-family: Inter, sans-serif; font-weight: 600; font-size: 1rem; color: #fff; }
.taxcalc-result-final strong {
    font-family: Inter, sans-serif;
    font-weight: 800;
    font-size: 1.9rem;
    background-image: linear-gradient(90deg, #F05A2B, #FA991B);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.taxcalc-note {
    margin: 0 0 1.5rem;
    font-family: Inter, sans-serif;
    font-size: 0.82rem;
    line-height: 1.6;
    color: #6b7280;
    background: #F7F7FC;
    border-radius: 14px;
    padding: 0.9rem 1.1rem;
}

.taxcalc-actions { display: flex; justify-content: flex-end; gap: 0.75rem; flex-wrap: wrap; }
.taxcalc-print {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    border: 0;
    cursor: pointer;
    font-family: Inter, sans-serif;
    font-weight: 600;
    font-size: 0.92rem;
    color: #fff;
    background-image: linear-gradient(90deg, #F05A2B, #FA991B);
    padding: 0.75rem 1.5rem;
    border-radius: 9999px;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.taxcalc-print:hover { box-shadow: 0 10px 24px rgba(240, 90, 43, 0.3); transform: translateY(-1px); }
.taxcalc-print svg { width: 18px; height: 18px; flex-shrink: 0; }

.taxcalc-outline-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    border: 1px solid rgba(240, 90, 43, 0.35);
    cursor: pointer;
    font-family: Inter, sans-serif;
    font-weight: 600;
    font-size: 0.92rem;
    color: #F05A2B;
    background: #fff;
    padding: 0.75rem 1.5rem;
    border-radius: 9999px;
    transition: background-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}
.taxcalc-outline-btn:hover { background: rgba(240, 90, 43, 0.08); box-shadow: 0 6px 18px rgba(240, 90, 43, 0.14); transform: translateY(-1px); }
.taxcalc-outline-btn svg { width: 18px; height: 18px; flex-shrink: 0; }
.taxcalc-outline-btn[disabled], .taxcalc-print[disabled] { opacity: 0.7; cursor: progress; pointer-events: none; }

/* Popup asking for Name/Email/Mobile/TIN before printing/downloading. */
.taxcalc-modal { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; padding: 1.25rem; }
.taxcalc-modal[hidden] { display: none; }
.taxcalc-modal-backdrop { position: absolute; inset: 0; background: rgba(20, 23, 26, 0.55); backdrop-filter: blur(2px); }
.taxcalc-modal-box {
    position: relative;
    width: 100%;
    max-width: 420px;
    max-height: calc(100vh - 2.5rem);
    overflow-y: auto;
    background: #fff;
    border-radius: 22px;
    padding: 1.75rem;
    box-shadow: 0 30px 80px rgba(32, 32, 80, 0.35);
}
.taxcalc-modal-close {
    position: absolute;
    top: 0.9rem;
    right: 0.9rem;
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    background: #F7F7FC;
    color: #6b7280;
    border-radius: 9999px;
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
}
.taxcalc-modal-box h3 {
    margin: 0 0 0.35rem;
    font-family: Inter, sans-serif;
    font-weight: 700;
    font-size: 1.15rem;
    color: #202050;
}
.taxcalc-modal-box > p {
    margin: 0 0 1.25rem;
    font-family: Inter, sans-serif;
    font-size: 0.86rem;
    line-height: 1.55;
    color: #6b7280;
}
.taxcalc-modal-box .taxcalc-field { margin-bottom: 1rem; }
.taxcalc-hp {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
    opacity: 0;
}
.taxcalc-modal-error {
    margin: -0.25rem 0 1rem;
    font-family: Inter, sans-serif;
    font-size: 0.82rem;
    color: #dc2626;
}
.taxcalc-modal-actions { display: flex; justify-content: flex-end; gap: 0.75rem; margin-top: 0.5rem; }
.taxcalc-modal-cancel {
    border: 1px solid rgba(32, 32, 80, 0.14);
    background: #fff;
    color: #5b5f77;
    font-family: Inter, sans-serif;
    font-weight: 600;
    font-size: 0.9rem;
    padding: 0.7rem 1.3rem;
    border-radius: 9999px;
    cursor: pointer;
}
/* A manual browser Ctrl+P on this page (outside the Print/Download PDF buttons, which
   now open/download a generated PDF instead) still gets a clean print — chrome hidden,
   just the active calculator card. */
@media print {
    header, footer, .wa-float, .taxcalc-badge, .taxcalc-tabs-wrap, .taxcalc-actions, .taxcalc-modal { display: none !important; }
    .taxcalc-section { background: #fff; padding: 0; }
    .taxcalc-card { box-shadow: none; border: 1px solid #ddd; }
    .taxcalc-panel[hidden] { display: none !important; }
}
