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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background: #231F20;
    min-height: 100vh;
    position: relative;
    padding-bottom: 40px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Logo */
.logo-container {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 1000;
}
.company-logo {
    max-height: 80px;
    max-width: 200px;
    height: auto;
    width: auto;
    object-fit: contain;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 40px;
    color: white;
}
header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}
header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* Main content card */
.main-content {
    background: white;
    border-radius: 15px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    overflow: visible;
    margin-bottom: 30px;
}

/* ===== FORM ELEMENTS ===== */
.disclaimer-section {
    padding: 20px 30px;
    background: #fff3cd;
    border-bottom: 1px solid #ffeaa7;
    border-top: 3px solid #f39c12;
    border-radius: 15px 15px 0 0;
}
.disclaimer-content p {
    margin-bottom: 0;
    font-size: 0.9rem;
    line-height: 1.5;
    color: #856404;
}
.disclaimer-content strong {
    color: #b7791f;
    font-weight: 600;
}
.input-section {
    padding: 30px;
    border-bottom: 1px solid #e9ecef;
}
.input-section h2 {
    color: #231F20;
    margin-bottom: 25px;
    font-size: 1.8rem;
}
.input-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
}
.step-intro {
    color: #555;
    margin-bottom: 10px;
    font-size: 1rem;
    max-width: 820px;
}
.field-note {
    font-size: 0.85rem;
    color: #888;
    line-height: 1.5;
    margin-top: 8px;
}
.form-group {
    margin-bottom: 24px;
}
.form-group > label {
    display: block;
    font-weight: 600;
    color: #495057;
    margin-bottom: 8px;
    font-size: 1rem;
}
.form-input {
    padding: 12px 15px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    width: 100%;
    max-width: 400px;
}
.form-input-sm { max-width: 160px; }
.form-input:focus {
    outline: none;
    border-color: #E6A800;
    box-shadow: 0 0 0 3px rgba(230,168,0,0.15);
}
select.form-input { cursor: pointer; max-width: 400px; }

/* Sliders */
.slider {
    width: 100%;
    max-width: 480px;
    height: 8px;
    border-radius: 4px;
    background: #e9ecef;
    appearance: none;
    cursor: pointer;
}
.slider::-webkit-slider-thumb {
    appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #E6A800;
    border: 3px solid #231F20;
    cursor: pointer;
}
.slider::-moz-range-thumb {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #E6A800;
    border: 3px solid #231F20;
    cursor: pointer;
}

/* Radio options */
.radio-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.radio-option {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 10px 15px;
    border-radius: 8px;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}
.radio-option:hover { background: #f8f9fa; border-color: #e9ecef; }
.radio-option input[type="radio"] {
    margin-right: 10px;
    transform: scale(1.2);
    accent-color: #E6A800;
}
.radio-option:has(input:checked) {
    background: #fdf5e0;
    border-color: #E6A800;
}
.radio-option span { font-size: 1rem; color: #495057; }

/* Spread slider scale */
.spread-scale {
    display: flex;
    justify-content: space-between;
    max-width: 480px;
    font-size: 0.8rem;
    color: #888;
    margin-top: 4px;
}

.action-section {
    padding: 30px;
    text-align: center;
}
.calculate-btn {
    background: #231F20;
    color: white;
    border: none;
    padding: 16px 50px;
    font-size: 1.2rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}
.calculate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(35,31,32,0.35);
}

/* ===== RESULTS ===== */
.results-disclaimer {
    padding: 16px 30px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    border-radius: 15px 15px 0 0;
    font-size: 0.75rem;
    color: #999;
    line-height: 1.5;
}

.results-verdict {
    margin: 30px;
    padding: 24px 28px;
    border-radius: 12px;
    border: 2px solid #E6A800;
    background: #fdf5e0;
    font-size: 1.1rem;
    color: #231F20;
    line-height: 1.6;
}
.results-verdict strong { color: #8a6200; }
.results-verdict.verdict-neutral {
    border-color: #ced4da;
    background: #f8f9fa;
}

.summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    padding: 0 30px;
    margin-bottom: 10px;
}
.summary-card {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    padding: 18px 20px;
    text-align: center;
}
.summary-card h3 {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #888;
    margin-bottom: 8px;
}
.summary-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #231F20;
}
.summary-sub {
    font-size: 0.78rem;
    color: #999;
    margin-top: 4px;
}
.summary-card.penalty-card {
    background: #fdf5e0;
    border-color: #E6A800;
}

.table-section {
    padding: 30px;
}
.table-section h3 {
    color: #231F20;
    font-size: 1.4rem;
    margin-bottom: 16px;
}
.table-container {
    overflow-x: auto;
    border: 1px solid #e9ecef;
    border-radius: 10px;
}
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}
th, td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid #e9ecef;
}
thead th {
    background: #231F20;
    color: white;
    font-weight: 600;
    white-space: nowrap;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #fafafa; }
td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
th.col-convert { background: #8a6200; }
th.col-delta { background: #E6A800; color: #231F20; }
td.delta-pos { color: #1b6e2f; font-weight: 700; }
td.delta-neg { color: #a02020; font-weight: 700; }
.row-note { font-size: 0.78rem; color: #999; display: block; margin-top: 2px; font-weight: 400; }

.chart-note {
    font-size: 0.85rem;
    color: #888;
    margin-bottom: 14px;
    max-width: 820px;
}

.charts-dashboard {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 20px;
    padding: 0 30px 10px;
}
.chart-card {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    padding: 20px;
}
.chart-card h3 {
    color: #231F20;
    margin-bottom: 14px;
    font-size: 1.1rem;
}

.advisory-notes {
    padding: 20px 30px 0;
}
.advisory-note {
    background: #e3f2fd;
    border-left: 4px solid #1976d2;
    padding: 14px 18px;
    border-radius: 0 8px 8px 0;
    margin: 12px 0;
    font-size: 0.9rem;
    color: #1565c0;
    line-height: 1.5;
}
.advisory-note.warning {
    background: #fff3cd;
    border-left-color: #f39c12;
    color: #856404;
}

.irs-citation {
    padding: 16px 30px;
    font-size: 0.78rem;
    color: #aaa;
    line-height: 1.5;
}

.results-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    padding: 10px 30px 40px;
    justify-content: center;
}
.export-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #231F20;
    color: white;
    border: none;
    padding: 14px 28px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s ease;
}
.export-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(35,31,32,0.3);
    color: white;
}
.action-book { background: #E6A800; color: #231F20; }
.action-book:hover { color: #231F20; box-shadow: 0 6px 18px rgba(230,168,0,0.4); }
.action-catalog { background: white; color: #231F20; border: 2px solid #231F20; }
.action-catalog:hover { color: #231F20; }
.back-btn {
    background: none;
    border: 2px solid #ced4da;
    color: #666;
    padding: 14px 24px;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
}
.back-btn:hover { border-color: #231F20; color: #231F20; }

/* ===== MODALS ===== */
.soft-gate-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.65);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 20px;
}
.soft-gate-modal {
    background: white;
    border-radius: 14px;
    padding: 36px;
    max-width: 440px;
    width: 100%;
    box-shadow: 0 30px 60px rgba(0,0,0,0.3);
}
.soft-gate-modal h2 {
    color: #231F20;
    margin-bottom: 8px;
    font-size: 1.4rem;
}
.soft-gate-modal > p {
    color: #777;
    font-size: 0.92rem;
    margin-bottom: 22px;
}
.soft-gate-field { margin-bottom: 16px; }
.soft-gate-field label {
    display: block;
    font-weight: 600;
    font-size: 0.88rem;
    color: #495057;
    margin-bottom: 6px;
}
.soft-gate-field input {
    width: 100%;
    padding: 11px 14px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 1rem;
}
.soft-gate-field input:focus {
    outline: none;
    border-color: #E6A800;
}
.soft-gate-buttons {
    display: flex;
    gap: 12px;
    margin-top: 22px;
}
.soft-gate-buttons .calculate-btn {
    padding: 12px 28px;
    font-size: 1rem;
    flex: 1;
}
.soft-gate-buttons .back-btn { padding: 12px 20px; }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    header h1 { font-size: 1.8rem; }
    .company-logo { max-height: 54px; }
    .input-section { padding: 20px; }
    .input-section h2 { font-size: 1.4rem; }
    .table-section { padding: 20px; }
    .results-verdict { margin: 20px; padding: 18px; font-size: 1rem; }
    .summary-cards { padding: 0 20px; }
    .results-actions { padding: 10px 20px 30px; }
    .export-btn, .back-btn { width: 100%; justify-content: center; }
    .entry-buttons { grid-template-columns: 1fr; }
}
