﻿/* ==========================================================================
   LIC BIMA PLATINUM (PLAN 770) CALCULATOR - ENHANCED RESPONSIVE STYLES
   Pixel-Perfect Full-Width Grid Alignment (2026 Engine)
   ========================================================================== */

:root {
    --primary: #0b3c6d;          /* LIC Navy Blue */
    --primary-dark: #072a4d;
    --primary-light: #f0f7ff;
    --secondary: #0284c7;        /* Sky Blue */
    --accent: #d97706;           /* Amber Gold */
    --success: #16a34a;          /* Green */
    --danger: #dc2626;           /* Red */
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --card-bg: #ffffff;
    --body-bg: #f8fafc;
    --shadow-sm: 0 2px 8px rgba(11, 60, 109, 0.04);
    --shadow-md: 0 8px 24px rgba(11, 60, 109, 0.08);
}

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

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--body-bg);
    color: var(--text-main);
    line-height: 1.6;
    margin: 0;
    overflow-x: hidden;
}

.tool-page-main {
    width: 100%;
    padding: 1.5rem 0 3rem;
    box-sizing: border-box;
}

.container {
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    padding: 0 1.5rem;
    box-sizing: border-box;
}

/* Breadcrumbs */
.breadcrumbs {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    padding: 0;
    margin: 0 0 1.5rem 0;
    font-size: 0.88rem;
    color: var(--text-muted);
}

.breadcrumbs a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.2s;
}

.breadcrumbs a:hover {
    color: var(--secondary);
    text-decoration: underline;
}

.breadcrumbs li+li::before {
    content: "/";
    margin-right: 0.5rem;
    color: #cbd5e1;
}

/* Page Header */
.page-header {
    text-align: center;
    margin-bottom: 2.5rem;
    width: 100%;
}

.page-header h1 {
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--primary);
    margin: 0 0 0.75rem 0;
    line-height: 1.25;
}

.page-header .subtitle {
    font-size: 1.05rem;
    color: var(--text-muted);
    max-width: 900px;
    margin: 0 auto 0.75rem;
    line-height: 1.6;
}

.atomic-answer {
    background: #f0fdf4;
    border-left: 4px solid var(--success);
    border-radius: 8px;
    padding: 1rem 1.25rem;
    margin: 1.25rem auto;
    max-width: 950px;
    text-align: left;
    font-size: 0.95rem;
    color: #166534;
    box-shadow: var(--shadow-sm);
}

.last-updated {
    font-size: 0.85rem;
    color: #94a3b8;
    margin: 0.75rem 0 0;
}

/* Main 2-Column Grid Layout with Strict min-width:0 to Prevent Overflow */
.main-container {
    display: grid;
    grid-template-columns: 460px minmax(0, 1fr);
    gap: 2rem;
    align-items: start;
    margin-bottom: 2.5rem;
    width: 100%;
    box-sizing: border-box;
}

.calculator-column,
.results-column {
    min-width: 0;
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
}

@media (max-width: 1080px) {
    .main-container {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}

/* Card Components */
.card {
    background-color: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: var(--shadow-md);
    margin-bottom: 2rem;
    overflow: hidden;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    transition: transform 0.2s, box-shadow 0.2s;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.1rem 1.5rem;
    background-color: #fcfdfe;
    border-bottom: 1px solid var(--border);
}

.card-header h2 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.section-lang-switcher {
    display: flex;
    gap: 0.35rem;
}

.section-lang-switcher .lang-btn {
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 0.25rem 0.65rem;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.2s;
}

.section-lang-switcher .lang-btn.active {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
}

.calculator {
    padding: 1.5rem;
}

/* Form Groups & Inputs */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.45rem;
    color: #334155;
    font-size: 0.92rem;
}

.form-group small {
    font-size: 0.8rem;
    color: #64748b;
    margin-top: 0.35rem;
    display: block;
}

.input-with-stepper {
    display: flex;
    align-items: center;
    width: 100%;
}

.input-with-stepper .input-with-icon {
    flex-grow: 1;
    border-radius: 0;
}

.input-with-stepper .stepper-btn {
    background-color: #f1f5f9;
    border: 1px solid var(--border);
    color: var(--primary);
    font-size: 1.2rem;
    font-weight: 700;
    cursor: pointer;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
    flex-shrink: 0;
}

.input-with-stepper .stepper-btn:first-of-type {
    border-radius: 8px 0 0 8px;
    border-right: none;
}

.input-with-stepper .stepper-btn:last-of-type {
    border-radius: 0 8px 8px 0;
    border-left: none;
}

.input-with-stepper .stepper-btn:hover {
    background-color: #e2e8f0;
}

.input-with-icon {
    display: flex;
    align-items: center;
    border: 1px solid var(--border);
    border-radius: 8px;
    background-color: #ffffff;
    overflow: hidden;
    height: 48px;
    width: 100%;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.input-with-icon:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(11, 60, 109, 0.12);
}

.input-with-icon i {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.input-with-icon .icon-blue { background-color: #0b3c6d; }
.input-with-icon .icon-gold { background-color: #d97706; }
.input-with-icon .icon-green { background-color: #10b981; }
.input-with-icon .icon-purple { background-color: #8b5cf6; }

.input-with-icon input,
.input-with-icon select.input-select {
    flex: 1;
    border: none;
    outline: none;
    padding: 0 1rem;
    font-size: 0.98rem;
    font-weight: 500;
    color: var(--text-main);
    background: transparent;
    width: 100%;
    height: 100%;
    min-width: 0;
    -moz-appearance: none;
    appearance: none;
}

.input-with-icon input::-webkit-outer-spin-button,
.input-with-icon input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.slider {
    -webkit-appearance: none;
    width: 100%;
    height: 6px;
    background: #e2e8f0;
    border-radius: 3px;
    outline: none;
    margin-top: 0.65rem;
    cursor: pointer;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background: var(--primary);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

.slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: var(--primary);
    border-radius: 50%;
    cursor: pointer;
}

.form-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.btn {
    padding: 0.85rem 1.5rem;
    border-radius: 8px;
    border: none;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.2s;
}

.btn-primary {
    background-color: var(--primary);
    color: #ffffff;
    flex: 2;
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    transform: translateY(-1px);
}

.btn-secondary {
    background-color: #f1f5f9;
    color: #475569;
    border: 1px solid var(--border);
    flex: 1;
}

.btn-secondary:hover {
    background-color: #e2e8f0;
}

.btn-edit {
    background: #f1f5f9;
    border: 1px solid var(--border);
    color: var(--primary);
    padding: 0.35rem 0.85rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-edit:hover {
    background-color: #e2e8f0;
}

.error-box {
    background-color: #fef2f2;
    color: #b91c1c;
    margin-top: 1rem;
    padding: 0.85rem 1.25rem;
    font-weight: 600;
    border-radius: 8px;
    border: 1px solid #fca5a5;
    font-size: 0.9rem;
}

/* Results Card & Tabs */
.results-tabs {
    padding: 0 1.25rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: flex-start;
    align-items: center;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    background: #f8fafc;
    width: 100%;
}

.tab-btn-group {
    display: flex;
    gap: 0.25rem;
}

.tab-btn {
    background: none;
    border: none;
    padding: 0.9rem 1.1rem;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
    border-bottom: 3px solid transparent;
    margin-bottom: -1px;
    white-space: nowrap;
    transition: all 0.2s;
}

.tab-btn:hover {
    color: var(--primary);
}

.tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    background: #ffffff;
}

.tab-panel {
    display: none;
    padding: 1.5rem;
    width: 100%;
    box-sizing: border-box;
}

.tab-panel.active {
    display: block;
    animation: fadeIn 0.3s ease-in-out;
}

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

/* Summary Grid & Boxes */
.summary-grid-3-col {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.25rem;
    margin-bottom: 1.5rem;
    width: 100%;
}

@media (max-width: 640px) {
    .summary-grid-3-col {
        grid-template-columns: 1fr;
    }
}

.result-box {
    background-color: #f8fafc;
    padding: 1.25rem;
    border-radius: 12px;
    text-align: center;
    border: 1px solid var(--border);
    position: relative;
    min-width: 0;
}

.result-box p {
    margin: 0 0 0.35rem 0;
    font-weight: 600;
    color: #475569;
    font-size: 0.9rem;
}

.result-box .subtitle {
    font-size: 0.8rem;
    color: #64748b;
    font-weight: 400;
    display: block;
    margin-top: 0.25rem;
}

.result-box .value {
    font-size: 1.65rem;
    font-weight: 700;
    color: var(--primary);
    line-height: 1.2;
}

.premium-box .value { color: var(--danger); }
.ga-box .value { color: var(--accent); }

.maturity-box {
    grid-column: 1 / -1;
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border: 2px solid #86efac;
    padding: 1.75rem 1.25rem;
    width: 100%;
}

.maturity-box p {
    font-size: 1.05rem;
    color: #166534;
}

.maturity-box .value {
    color: #15803d;
    font-size: 2.5rem;
    font-weight: 800;
}

.tax-tag {
    display: inline-block;
    background-color: #dbeafe;
    color: #1e40af;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 0.3rem 0.85rem;
    border-radius: 20px;
    margin-top: 0.6rem;
}

/* Tables with Strict Responsive Overflow */
.table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid var(--border);
    border-radius: 10px;
    margin-top: 1rem;
    background: #ffffff;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

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

th, td {
    padding: 12px 14px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    font-size: 0.88rem;
    white-space: nowrap;
}

th {
    background-color: #f1f5f9;
    position: sticky;
    top: 0;
    font-weight: 600;
    color: var(--primary);
}

tr:last-child td { border-bottom: none; }
tr:nth-child(even) { background-color: #f8fafc; }

/* IRR & FD Comparison */
.irr-badge-box {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 12px;
    padding: 1.75rem;
    text-align: center;
    margin-bottom: 1.5rem;
    width: 100%;
}

.irr-badge-box .irr-num {
    font-size: 3rem;
    font-weight: 800;
    color: #1d4ed8;
    line-height: 1.1;
    margin: 0.5rem 0;
}

.fd-compare-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    margin-top: 1rem;
    width: 100%;
}

@media (max-width: 640px) {
    .fd-compare-grid {
        grid-template-columns: 1fr;
    }
}

.fd-card {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1rem;
    text-align: center;
    box-shadow: var(--shadow-sm);
    min-width: 0;
}

.fd-card .bracket {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-muted);
}

.fd-card .rate {
    font-size: 1.6rem;
    font-weight: 700;
    margin: 0.25rem 0;
}

/* Full Width Container & Editorial Sections */
.full-width-container {
    width: 100%;
    max-width: 100%;
    margin-top: 1rem;
    box-sizing: border-box;
}

.info-card-full {
    margin-bottom: 2rem;
    width: 100%;
}

.info-card-full .card-body {
    padding: 1.75rem;
}

.info-section h3 {
    color: var(--primary);
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
    border-bottom: 2px solid #e0e7ff;
    padding-bottom: 0.35rem;
    font-size: 1.15rem;
}

.info-section h3:first-child {
    margin-top: 0;
}

.info-section p, .info-section ul {
    margin-bottom: 1rem;
    font-size: 0.95rem;
    color: #334155;
    line-height: 1.7;
}

.info-section ul {
    padding-left: 1.5rem;
}

.disclaimer {
    margin-top: 1.5rem;
    padding: 1rem 1.25rem;
    background-color: #fffbeb;
    border-radius: 8px;
    font-size: 0.85rem;
    color: #92400e;
    border-left: 4px solid #f59e0b;
    line-height: 1.6;
    width: 100%;
}

/* FAQs */
.faq-card .card-body,
.faq-content {
    padding: 0 1.5rem 1.5rem;
    width: 100%;
}

.faq-item {
    border-bottom: 1px solid var(--border);
    padding: 1.1rem 0;
    width: 100%;
}

.faq-item:last-child {
    border-bottom: none;
}

.faq-item summary {
    font-weight: 600;
    cursor: pointer;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.02rem;
    color: var(--primary);
}

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

.faq-item summary::after {
    content: "\f078";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    transition: transform 0.3s ease-in-out;
    color: var(--secondary);
    font-size: 0.85rem;
}

.faq-item[open] > summary::after {
    transform: rotate(180deg);
}

.faq-item div {
    padding-top: 0.75rem;
    color: #475569;
    font-size: 0.92rem;
    line-height: 1.7;
}

/* Related Tools Silo */
.related-tools-silo {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.75rem;
    margin-top: 2.5rem;
    box-shadow: var(--shadow-md);
    width: 100%;
    box-sizing: border-box;
}

.related-tools-silo h3 {
    margin: 0 0 1.25rem 0;
    font-size: 1.25rem;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.silo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 1rem;
    width: 100%;
}

.silo-item {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 1rem 1.25rem;
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 10px;
    text-decoration: none;
    color: var(--text-main);
    font-weight: 600;
    font-size: 0.92rem;
    transition: all 0.25s ease;
    min-width: 0;
}

.silo-item:hover {
    background: #ffffff;
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(11, 60, 109, 0.1);
    color: var(--primary);
}

.silo-item i {
    font-size: 1.25rem;
    color: var(--primary);
    width: 24px;
    text-align: center;
    flex-shrink: 0;
}
