* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: transparent;
    border-radius: 0;
    box-shadow: none;
    padding: 20px;
    overflow: hidden;
}

.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 40px 20px;
    text-align: center;
    border-radius: 0;
    margin-bottom: 30px;
    box-shadow: 0 10px 40px rgba(102, 126, 234, 0.3);
}

.header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.header p {
    font-size: 1.1rem;
    opacity: 0.95;
}

.tabs {
    display: flex;
    background: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
    border-radius: 12px 12px 0 0;
    overflow-x: auto;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.tab-button {
    flex: 1;
    padding: 15px 20px;
    text-align: center;
    cursor: pointer;
    background: #f8f9fa;
    border: none;
    font-size: 0.95rem;
    font-weight: 600;
    transition: all 0.3s;
    white-space: nowrap;
}

.tab-button:hover {
    background: #e9ecef;
}

.tab-button.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.tab-button:first-child {
    border-radius: 12px 0 0 0;
}

.tab-button:last-child {
    border-radius: 0 12px 0 0;
}

.content {
    padding: 30px;
    background: white;
    border-radius: 0 0 15px 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.section {
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
    border-left: 4px solid #2a5298;
}

.section h3 {
    color: #1e3c72;
    margin-bottom: 15px;
    font-size: 1.2rem;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin-bottom: 15px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-weight: 600;
    margin-bottom: 5px;
    color: #495057;
    font-size: 0.9rem;
}

.form-group input,
.form-group select {
    padding: 12px;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    font-size: 1rem;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #2a5298;
}

.input-group {
    position: relative;
}

.input-group span {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
}

.input-group input {
    padding-left: 35px;
}

.calculate-btn {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    border: none;
    padding: 15px 40px;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    display: block;
    margin: 30px auto;
    transition: transform 0.3s;
}

.calculate-btn:hover {
    transform: translateY(-2px);
}

.results {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 30px;
    border-radius: 15px;
    margin-top: 30px;
}

.comparison-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 30px;
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.comparison-table th {
    background: #1e3c72;
    color: white;
    padding: 15px;
    text-align: left;
}

.comparison-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #dee2e6;
}

.text-right {
    text-align: right;
}

.total-row {
    font-weight: bold;
    background: #e3f2fd !important;
}

.savings-row {
    background: #e8f5e9 !important;
    color: #2e7d32;
}

.recommendation {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    padding: 25px;
    border-radius: 15px;
    text-align: center;
    margin-top: 20px;
}

.recommendation .savings-amount {
    font-size: 2.5rem;
    font-weight: bold;
    margin: 15px 0;
}

.note {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    padding: 15px;
    margin-top: 20px;
    border-radius: 5px;
}

.download-btn {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: white;
    border: none;
    padding: 15px 40px;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    display: block;
    margin: 20px auto;
}

.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: white;
    padding: 30px;
    border-radius: 15px;
    max-width: 500px;
    width: 90%;
}

.modal h3 {
    color: #1e3c72;
    margin-bottom: 20px;
    text-align: center;
}

.modal-buttons {
    display: flex;
    gap: 15px;
    margin-top: 25px;
}

.modal-btn {
    flex: 1;
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
}

.modal-btn.old {
    background: #6c757d;
    color: white;
}

.modal-btn.new {
    background: #28a745;
    color: white;
}

.pdf-template {
    display: none;
    background: white;
    padding: 40px;
    max-width: 800px;
    margin: 0 auto;
}

.pdf-template .pdf-header {
    text-align: center;
    border-bottom: 3px solid #1e3c72;
    padding-bottom: 20px;
    margin-bottom: 30px;
}

.pdf-template .pdf-header h1 {
    color: #1e3c72;
    font-size: 1.8rem;
}

.pdf-template .pdf-section {
    margin-bottom: 25px;
}

.pdf-template .pdf-section h3 {
    background: #f8f9fa;
    padding: 10px 15px;
    border-left: 4px solid #1e3c72;
    margin-bottom: 15px;
    color: #1e3c72;
}

.pdf-template table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

.pdf-template th, .pdf-template td {
    padding: 10px;
    text-align: left;
    border-bottom: 1px solid #dee2e6;
}

.pdf-template .amount {
    text-align: right;
}

.pdf-template .signature-section {
    margin-top: 60px;
    display: flex;
    justify-content: space-between;
}

.pdf-template .signature-box {
    text-align: center;
    width: 250px;
}

.pdf-template .signature-line {
    border-top: 1px solid #000;
    margin-top: 60px;
    padding-top: 10px;
}

@media print {
    body * {
        visibility: hidden;
    }
    .pdf-template, .pdf-template * {
        visibility: visible;
    }
    .pdf-template {
        display: block;
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
    }
}

@media (max-width: 768px) {
    .header h1 {
        font-size: 1.5rem;
    }
    
    .tabs {
        flex-wrap: wrap;
    }
    
    .tab-button {
        flex: 1 1 50%;
        font-size: 0.85rem;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .regime-columns {
        grid-template-columns: 1fr;
    }
}

.regime-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 20px;
}

.breakdown-section {
    margin-top: 20px;
    padding: 20px;
    background: white;
    border-radius: 10px;
}

.breakdown-section h4 {
    color: #1e3c72;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e9ecef;
}

.breakdown-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px dashed #dee2e6;
}

.error {
    border-color: #dc3545 !important;
    background-color: #fff5f5;
}

.error-message {
    color: #dc3545;
    font-size: 0.85rem;
    margin-top: 5px;
}

.balance-positive {
    color: #dc3545;
    font-weight: bold;
}

.balance-negative {
    color: #28a745;
    font-weight: bold;
}

/* 2026 visual refresh for income-tax template */
:root {
    --ink: #0f172a;
    --muted: #64748b;
    --bg-1: #eef2ff;
    --bg-2: #f8fafc;
    --card: #ffffff;
    --line: #dbe5f1;
    --brand-1: #4f46e5;
    --brand-2: #7c3aed;
    --ok-1: #0ea5a4;
}

body {
    font-family: Inter, "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    color: var(--ink);
    background:
        radial-gradient(1200px 400px at 90% -10%, rgba(124, 58, 237, 0.20), transparent 60%),
        radial-gradient(1000px 380px at 0% -10%, rgba(79, 70, 229, 0.18), transparent 55%),
        linear-gradient(180deg, var(--bg-1) 0%, var(--bg-2) 38%, #ffffff 100%);
}

.header {
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.95), rgba(124, 58, 237, 0.92));
    box-shadow: 0 22px 42px rgba(79, 70, 229, 0.28);
}

.header p {
    margin: 0 auto;
    max-width: 860px;
}

.header-meta {
    margin-top: 16px;
    display: inline-flex;
    gap: 8px;
    flex-wrap: wrap;
}

.meta-pill {
    border: 1px solid rgba(255,255,255,0.35);
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 0.8rem;
    background: rgba(255,255,255,0.14);
}

.container {
    max-width: 1280px;
}

.tabs {
    border: 1px solid var(--line);
    border-bottom: none;
    background: rgba(255,255,255,0.9);
    backdrop-filter: blur(6px);
    box-shadow: 0 16px 30px rgba(15, 23, 42, 0.08);
}

.tab-button {
    color: #334155;
    border-right: 1px solid #e8edf5;
}

.tab-button:last-child {
    border-right: none;
}

.tab-button.active {
    background: linear-gradient(135deg, var(--brand-1), var(--brand-2));
}

.content {
    border: 1px solid var(--line);
    border-radius: 0 0 16px 16px;
    box-shadow: 0 20px 45px rgba(15, 23, 42, 0.1);
}

.section {
    border: 1px solid #dce6fb;
    border-left: 5px solid var(--brand-1);
    background: linear-gradient(180deg, #f8fbff, #f3f8ff);
}

.section h3 {
    color: #1e1b4b;
}

.form-group input,
.form-group select {
    border: 1.5px solid #cfd8e6;
    background: #fff;
    color: var(--ink);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-group input:focus,
.form-group select:focus {
    border-color: var(--brand-1);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.16);
}

.action-buttons {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 28px;
}

.calculate-btn,
.download-btn {
    margin: 0;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.2);
}

.calculate-btn {
    background: linear-gradient(135deg, var(--ok-1), #14b8a6);
}

#resultsContainer .download-btn {
    margin-top: 22px;
}

.secondary-btn {
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #334155;
    border-radius: 999px;
    padding: 13px 28px;
    font-weight: 600;
    cursor: pointer;
}

.secondary-btn:hover {
    background: #f8fafc;
}

.autosave-note {
    text-align: center;
    margin-top: 10px;
    color: var(--muted);
    font-size: 0.86rem;
}

.faq-section {
    margin-top: 24px;
    background: #ffffff;
    border: 1px solid #dbe5f1;
    border-radius: 14px;
    padding: 20px;
}

.faq-section h3 {
    margin-bottom: 12px;
    color: #1e1b4b;
}

.faq-item {
    border-top: 1px dashed #dbe5f1;
    padding: 12px 0;
}

.faq-item:first-of-type {
    border-top: none;
    padding-top: 0;
}

.faq-item h4 {
    margin-bottom: 6px;
    color: #1e293b;
}

.faq-item p {
    margin: 0;
    color: #475569;
    line-height: 1.6;
}

.comparison-table th {
    background: linear-gradient(135deg, #312e81, #4338ca);
}

.recommendation {
    background: linear-gradient(135deg, #0f766e, #14b8a6);
}

@media (max-width: 768px) {
    .header-meta {
        justify-content: center;
    }
    .action-buttons .calculate-btn,
    .action-buttons .secondary-btn {
        width: 100%;
    }
}
