/* ========================
   SALARY CALCULATOR CSS
   FY 2025-26 · India
   ======================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ── Reset & Base ── */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --bg: #0a0f1e;
    --surface: rgba(255, 255, 255, 0.04);
    --surface-hover: rgba(255, 255, 255, 0.08);
    --border: rgba(255, 255, 255, 0.08);
    --border-focus: rgba(99, 102, 241, 0.6);
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --accent: #6366f1;
    --accent-light: #818cf8;
    --accent-glow: rgba(99, 102, 241, 0.3);
    --green: #10b981;
    --green-light: rgba(16, 185, 129, 0.15);
    --orange: #f59e0b;
    --red: #ef4444;
    --red-light: rgba(239, 68, 68, 0.12);
    --card-radius: 24px;
    --input-radius: 12px;
    --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', system-ui, sans-serif;
    background: var(--bg);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* ── Background Blobs ── */
.bg-blobs {
    position: fixed;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 0;
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(90px);
    animation: blobDrift 18s ease-in-out infinite alternate;
}

.blob-1 {
    width: 520px;
    height: 520px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.25) 0%, transparent 70%);
    top: -180px;
    left: -180px;
}

.blob-2 {
    width: 420px;
    height: 420px;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.18) 0%, transparent 70%);
    bottom: -150px;
    right: -150px;
    animation-delay: -9s;
}

.blob-3 {
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(245, 158, 11, 0.12) 0%, transparent 70%);
    top: 40%;
    left: 55%;
    animation-delay: -4s;
}

@keyframes blobDrift {
    0% {
        transform: translate(0, 0) scale(1);
    }

    100% {
        transform: translate(40px, 30px) scale(1.08);
    }
}

/* ── Calculator Card ── */
.calculator-card {
    position: relative;
    z-index: 1;
    max-width: 900px;
    margin: 2.5rem auto;
    padding: 0 1rem 3rem;
}

/* ── Header ── */
header {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: var(--card-radius);
    padding: 1.5rem 2rem 2rem;
    margin-bottom: 1.5rem;
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.header-badges {
    display: flex;
    gap: 0.5rem;
}

.badge {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 0.3rem 0.7rem;
    border-radius: 50px;
}

.badge-fy {
    background: rgba(99, 102, 241, 0.2);
    color: var(--accent-light);
    border: 1px solid rgba(99, 102, 241, 0.35);
}

.badge-india {
    background: rgba(255, 153, 51, 0.15);
    color: #fb923c;
    border: 1px solid rgba(255, 153, 51, 0.3);
}

.header-actions {
    display: flex;
    gap: 0.5rem;
}

.title-area {
    text-align: center;
}

.title-icon {
    font-size: 2.8rem;
    line-height: 1;
    margin-bottom: 0.5rem;
}

h1 {
    font-size: clamp(1.6rem, 4vw, 2.2rem);
    font-weight: 800;
    background: linear-gradient(135deg, #f1f5f9, var(--accent-light), var(--green));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.1;
    margin-bottom: 0.4rem;
}

header p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* ── Input Section ── */
.input-section {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: var(--card-radius);
    padding: 2rem;
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
}

.info-banner {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: 10px;
    padding: 0.75rem 1rem;
    font-size: 0.82rem;
    color: var(--green);
    margin-bottom: 1.5rem;
}

.info-icon {
    font-size: 1rem;
}

/* ── Two-column Row ── */
.input-row.two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
    margin-bottom: 1.25rem;
}

@media (max-width: 640px) {
    .input-row.two-col {
        grid-template-columns: 1fr;
    }
}

/* ── Input Group ── */
.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.input-group label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: 0.02em;
}

.label-hint {
    font-weight: 400;
    color: var(--text-muted);
}

.field-hint {
    font-size: 0.73rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
}

.field-error {
    font-size: 0.75rem;
    color: var(--red);
    min-height: 1rem;
}

/* ── Inputs ── */
.text-input,
.num-input,
.select-input {
    width: 100%;
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: var(--input-radius);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
    padding: 0.75rem 1rem;
    transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
    outline: none;
}

.text-input:focus,
.num-input:focus,
.select-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
    background: rgba(99, 102, 241, 0.06);
}

.text-input:hover,
.num-input:hover,
.select-input:hover {
    background: var(--surface-hover);
}

.text-input.error,
.num-input.error {
    border-color: var(--red);
    box-shadow: 0 0 0 3px var(--red-light);
}

.select-input {
    cursor: pointer;
}

.select-input option,
.select-input optgroup {
    background: #1e2433;
    color: var(--text-primary);
}

input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type=number] {
    -moz-appearance: textfield;
}

.input-with-currency {
    position: relative;
    display: flex;
    align-items: center;
}

.currency-symbol {
    position: absolute;
    left: 0.9rem;
    color: var(--accent-light);
    font-weight: 700;
    font-size: 1rem;
    pointer-events: none;
    z-index: 1;
}

.input-with-currency .num-input {
    padding-left: 2rem;
}

/* ── Regime Toggle ── */
.regime-section {
    margin: 1.5rem 0 1rem;
}

.section-label {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-secondary);
    display: block;
    margin-bottom: 0.75rem;
}

.regime-toggle {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.regime-btn {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
    padding: 1rem 1.25rem;
    border-radius: 14px;
    cursor: pointer;
    font-family: inherit;
    background: var(--surface);
    border: 1.5px solid var(--border);
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 600;
    transition: all var(--transition);
    text-align: center;
}

.regime-btn:hover {
    background: var(--surface-hover);
    border-color: var(--accent);
    color: var(--text-primary);
}

.regime-btn.active {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(99, 102, 241, 0.08));
    border-color: var(--accent);
    color: var(--text-primary);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.regime-badge {
    position: absolute;
    top: -0.55rem;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    background: linear-gradient(90deg, var(--green), #34d399);
    color: #fff;
    padding: 0.15rem 0.6rem;
    border-radius: 50px;
    white-space: nowrap;
}

.regime-sub {
    font-size: 0.72rem;
    font-weight: 400;
    color: var(--text-muted);
}

.regime-btn.active .regime-sub {
    color: var(--accent-light);
}

/* ── Old Regime Deductions ── */
.old-regime-section {
    background: rgba(245, 158, 11, 0.05);
    border: 1px solid rgba(245, 158, 11, 0.2);
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 1.25rem;
    animation: fadeSlide 0.3s ease;
}

@keyframes fadeSlide {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.collapsible-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
}

.collapsible-header h3 {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--orange);
}

.collapsible-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.deductions-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

@media (max-width: 560px) {
    .deductions-grid {
        grid-template-columns: 1fr;
    }
}

/* ── Action Buttons ── */
.action-buttons {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.75rem;
    flex-wrap: wrap;
}

.btn-calculate {
    flex: 1;
    min-width: 200px;
    padding: 0.9rem 2rem;
    border-radius: 50px;
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    background: linear-gradient(135deg, var(--accent), #7c3aed);
    color: #fff;
    box-shadow: 0 4px 24px rgba(99, 102, 241, 0.4);
    transition: transform var(--transition), box-shadow var(--transition), filter var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-calculate:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(99, 102, 241, 0.5);
    filter: brightness(1.1);
}

.btn-calculate:active {
    transform: translateY(0);
}

.btn-contribute {
    padding: 0.9rem 1.5rem;
    border-radius: 50px;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    background: rgba(16, 185, 129, 0.15);
    border: 1.5px solid rgba(16, 185, 129, 0.4);
    color: var(--green);
    transition: all var(--transition);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.btn-contribute:hover {
    background: rgba(16, 185, 129, 0.25);
    border-color: var(--green);
    transform: translateY(-1px);
}

.btn-ghost {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    border-radius: 8px;
    padding: 0.4rem 0.9rem;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 500;
    transition: all var(--transition);
}

.btn-ghost:hover {
    background: var(--surface-hover);
    color: var(--text-primary);
    border-color: var(--accent);
}

.btn-link {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-family: inherit;
    font-size: 0.9rem;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    transition: color var(--transition);
}

.btn-link:hover {
    color: var(--red);
}

.btn-sm {
    padding: 0.35rem 0.75rem;
    font-size: 0.78rem;
}

.btn-icon {
    font-size: 1.1em;
}

/* ── Results Section ── */
.results-section {
    margin-top: 1.5rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: var(--card-radius);
    padding: 2rem;
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    animation: fadeSlide 0.4s ease;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.results-header h2 {
    font-size: 1.2rem;
    font-weight: 700;
}

.regime-chip {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 0.3rem 0.8rem;
    border-radius: 50px;
    background: rgba(99, 102, 241, 0.2);
    color: var(--accent-light);
    border: 1px solid rgba(99, 102, 241, 0.35);
}

/* ── KPI Cards ── */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

@media (max-width: 800px) {
    .kpi-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 480px) {
    .kpi-grid {
        grid-template-columns: 1fr;
    }
}

.kpi-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.25rem 1rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    transition: transform var(--transition), box-shadow var(--transition);
}

.kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.kpi-card.highlight {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.18), rgba(99, 102, 241, 0.06));
    border-color: rgba(99, 102, 241, 0.4);
}

.kpi-label {
    font-size: 0.73rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.kpi-value {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text-primary);
}

.kpi-card.highlight .kpi-value {
    color: var(--accent-light);
}

.kpi-sub {
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* ── Dashboard Body ── */
.dashboard-body {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

@media (max-width: 720px) {
    .dashboard-body {
        grid-template-columns: 1fr;
    }
}

/* ── Chart Panel ── */
.chart-panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.5rem;
}

.chart-panel h3,
.breakdown-panel h3 {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
}

.chart-wrapper {
    width: 220px;
    height: 220px;
    margin: 0 auto 1rem;
    position: relative;
}

.chart-legend {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.legend-pct {
    margin-left: auto;
    font-weight: 600;
    color: var(--text-primary);
}

/* ── Breakdown Panel ── */
.breakdown-panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.5rem;
    overflow: hidden;
}

.breakdown-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.breakdown-table thead th {
    text-align: left;
    padding: 0.6rem 0.8rem;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
}

.breakdown-table thead th:not(:first-child) {
    text-align: right;
}

.breakdown-table tbody tr {
    transition: background var(--transition);
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.breakdown-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.04);
}

.breakdown-table tbody td {
    padding: 0.65rem 0.8rem;
    color: var(--text-secondary);
}

.breakdown-table tbody td:not(:first-child) {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.breakdown-table tbody tr.row-deduct td {
    color: var(--red);
}

.breakdown-table tbody tr.row-deduct td:first-child {
    color: var(--text-secondary);
}

.breakdown-table tbody tr.row-highlight td {
    color: var(--green);
    font-weight: 700;
}

.breakdown-table tfoot tr {
    border-top: 2px solid rgba(99, 102, 241, 0.4);
}

.breakdown-table tfoot td {
    padding: 0.8rem;
    font-weight: 800;
    font-size: 1rem;
    color: var(--accent-light);
}

.breakdown-table tfoot td:not(:first-child) {
    text-align: right;
}

/* ── Slab Section ── */
.slab-section {
    margin-top: 1rem;
}

.slab-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0.8rem 1.2rem;
    cursor: pointer;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all var(--transition);
}

.slab-toggle:hover {
    background: var(--surface-hover);
    color: var(--text-primary);
    border-color: var(--accent);
}

.slab-toggle.open {
    border-radius: 12px 12px 0 0;
    border-color: var(--accent);
    color: var(--text-primary);
}

.toggle-arrow {
    margin-left: auto;
    transition: transform 0.25s;
}

.slab-toggle.open .toggle-arrow {
    transform: rotate(180deg);
}

.slab-body {
    background: var(--surface);
    border: 1px solid var(--accent);
    border-top: none;
    border-radius: 0 0 12px 12px;
    padding: 1.25rem;
    animation: fadeSlide 0.25s ease;
}

.slab-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.84rem;
}

.slab-table th {
    text-align: left;
    padding: 0.5rem 0.75rem;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
}

.slab-table th:not(:first-child) {
    text-align: right;
}

.slab-table td {
    padding: 0.6rem 0.75rem;
    color: var(--text-secondary);
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.slab-table td:not(:first-child) {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.slab-table tr.slab-active td {
    background: rgba(99, 102, 241, 0.08);
    color: var(--text-primary);
}

.slab-summary {
    margin-top: 1rem;
    padding: 1rem;
    background: rgba(16, 185, 129, 0.07);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: 10px;
    font-size: 0.83rem;
    color: var(--text-secondary);
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.slab-summary span {
    display: flex;
    gap: 0.4rem;
}

.slab-summary strong {
    color: var(--text-primary);
}

/* ── Modal ── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.modal-card {
    background: #12172a;
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 2.5rem;
    max-width: 480px;
    width: 100%;
    position: relative;
    animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-close {
    position: absolute;
    top: 1.2rem;
    right: 1.2rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1rem;
    padding: 0.3rem 0.6rem;
    transition: all var(--transition);
}

.modal-close:hover {
    background: var(--red-light);
    color: var(--red);
}

.modal-icon {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 0.75rem;
}

.modal-card h2 {
    text-align: center;
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
}

.modal-card>p {
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.modal-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.modal-field label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    display: block;
    margin-bottom: 0.4rem;
}

.modal-preview {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.75rem 1rem;
    font-size: 0.82rem;
    color: var(--text-muted);
    line-height: 1.6;
}

.modal-actions {
    display: flex;
    gap: 0.75rem;
    flex-direction: column;
}

.submitted-icon {
    font-size: 3rem;
    text-align: center;
    margin-bottom: 0.75rem;
}

.modal-submitted {
    text-align: center;
    padding-top: 0.5rem;
    color: var(--green);
}

.modal-submitted p {
    font-size: 0.95rem;
}