/* --- Brand Colors (shared across all TBV tools) --- */
:root {
    --primary: #1a365d;
    --primary-light: #2b6cb0;
    --accent: #e53e3e;
    --accent-gold: #C4A55A;
    --text-primary: #1a202c;
    --text-secondary: #4a5568;
    --text-light: #ffffff;
    --bg-page: #edf2f7;
    --bg-surface: #f7fafc;
    --bg-card: #ffffff;
    --border-color: #cbd5e0;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.1), 0 4px 10px rgba(0,0,0,0.05);
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --green: #276749;
    --green-light: #38a169;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-page);
    color: var(--text-primary);
    margin: 0;
    padding: 24px;
}

/* --- Header --- */
.header-container { text-align: center; margin-bottom: 32px; }
.brand-header { margin-bottom: 8px; position: relative; }

.home-btn {
    position: absolute; left: 0; top: 50%; transform: translateY(-50%);
    display: inline-block; padding: 8px 20px;
    background-color: var(--primary); color: var(--text-light);
    text-decoration: none; font-weight: 600; font-size: 0.85em;
    border-radius: var(--radius-sm); letter-spacing: 0.03em;
    transition: background-color 0.2s ease, box-shadow 0.2s ease;
}
.home-btn:hover { background-color: var(--primary-light); box-shadow: var(--shadow-sm); }

.brand-name { font-size: 1.6em; font-weight: 800; letter-spacing: -0.02em; }
.brand-the, .brand-better { color: var(--primary); }
.brand-veteran { color: var(--accent-gold); }

h1 { text-align: center; color: var(--primary); margin-bottom: 8px; font-size: 1.8em; letter-spacing: -0.02em; }
.tool-subtitle { font-size: 1em; color: var(--text-secondary); margin: 0; }

h2 {
    color: var(--primary); border-bottom: 2px solid var(--primary-light);
    padding-bottom: 12px; margin-top: 0; font-size: 1.1em; letter-spacing: -0.01em;
}

.section-subtitle { font-size: 0.9em; color: var(--text-secondary); margin: -8px 0 16px 0; font-style: italic; }
.section-footnote { font-size: 0.82em; color: var(--text-secondary); margin-top: 16px; line-height: 1.5; }

/* --- Calculator Inputs --- */
#calculator-container {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 16px; margin-bottom: 20px;
}

.input-group-wrapper {
    background-color: var(--bg-surface); border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md); overflow: hidden;
}

.input-group-toggle {
    display: flex; align-items: center; justify-content: space-between;
    width: 100%; padding: 16px 24px; background: none; border: none; cursor: pointer; text-align: left;
}
.input-group-toggle h2 { margin: 0; padding: 0; border: none; font-size: 0.95em; }
.toggle-indicator { font-size: 0.7em; color: var(--text-secondary); transition: transform 0.2s ease; }

.input-group {
    padding: 0 24px 24px; display: flex; flex-direction: column; gap: 10px;
    transition: max-height 0.3s ease, opacity 0.3s ease, padding 0.3s ease;
    max-height: 900px; opacity: 1; overflow: visible;
}
.input-group.collapsed { max-height: 0; opacity: 0; padding-top: 0; padding-bottom: 0; overflow: hidden; }

label { font-weight: 600; font-size: 0.8em; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.04em; }

select, input[type="number"], input[type="text"] {
    width: 100%; padding: 10px 12px; border: 1.5px solid var(--border-color);
    border-radius: var(--radius-sm); font-size: 1em;
    background-color: var(--bg-card); color: var(--text-primary);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
select:focus, input[type="number"]:focus, input[type="text"]:focus {
    outline: none; border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(43, 108, 176, 0.15);
}

.input-hint {
    font-size: 0.78em; color: var(--text-secondary); line-height: 1.4;
    margin: 2px 0 0 0; font-style: italic; text-transform: none;
    letter-spacing: normal; font-weight: 400;
}
.input-hint a { color: var(--primary-light); text-decoration: underline; }

/* --- School Search Autocomplete --- */
.school-search-wrapper {
    position: relative;
}

.school-search-wrapper input[type="text"] {
    width: 100%;
}

.autocomplete-dropdown {
    position: absolute; top: 100%; left: 0; right: 0; z-index: 100;
    background: var(--bg-card); border: 1.5px solid var(--primary-light);
    border-top: none; border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    box-shadow: var(--shadow-md); max-height: 280px; overflow-y: auto;
    display: none;
}
.autocomplete-dropdown.open { display: block; }

.autocomplete-item {
    padding: 10px 14px; cursor: pointer; font-size: 0.9em;
    border-bottom: 1px solid rgba(0,0,0,0.05); transition: background 0.1s ease;
}
.autocomplete-item:last-child { border-bottom: none; }
.autocomplete-item:hover, .autocomplete-item.highlighted {
    background-color: rgba(43, 108, 176, 0.08);
}
.autocomplete-item-name { font-weight: 600; color: var(--text-primary); }
.autocomplete-item-location { font-size: 0.82em; color: var(--text-secondary); margin-top: 2px; }
.autocomplete-item-type {
    display: inline-block; font-size: 0.7em; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.04em; padding: 1px 6px; border-radius: 3px; margin-top: 3px;
    background: rgba(26, 54, 93, 0.08); color: var(--primary);
}
.autocomplete-loading {
    padding: 12px 14px; font-size: 0.88em; color: var(--text-secondary); font-style: italic;
}
.autocomplete-empty {
    padding: 12px 14px; font-size: 0.88em; color: var(--text-secondary); font-style: italic;
}

.school-selected-card {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 14px; background: rgba(39, 103, 73, 0.06);
    border: 1.5px solid var(--green); border-radius: var(--radius-sm);
    margin-top: 4px;
}
.school-selected-info { display: flex; flex-direction: column; gap: 2px; }
.school-selected-name { font-weight: 700; font-size: 0.92em; color: var(--text-primary); }
.school-selected-location { font-size: 0.78em; color: var(--text-secondary); }
.school-clear-btn {
    background: none; border: none; cursor: pointer; font-size: 1em;
    color: var(--text-secondary); padding: 4px 6px; border-radius: var(--radius-sm);
    transition: color 0.2s ease; flex-shrink: 0;
}
.school-clear-btn:hover { color: var(--accent); }

/* --- Calculate Bar --- */
.calculate-bar { text-align: center; margin-bottom: 28px; }
.calculate-btn {
    padding: 14px 40px; background: var(--primary); color: var(--text-light);
    border: none; border-radius: var(--radius-sm); font-size: 1.05em;
    font-weight: 700; cursor: pointer; letter-spacing: 0.01em;
    transition: background 0.2s ease, box-shadow 0.2s ease;
    box-shadow: var(--shadow-md);
}
.calculate-btn:hover:not(:disabled) { background: var(--primary-light); box-shadow: var(--shadow-lg); }
.calculate-btn:disabled { opacity: 0.5; cursor: not-allowed; box-shadow: none; }

/* --- Section Containers --- */
.section-container {
    background-color: var(--bg-surface); color: var(--text-primary);
    padding: 32px; border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg); margin-bottom: 24px; text-align: center;
}

/* --- Verdict Card --- */
.verdict-card {
    padding: 32px; border-radius: var(--radius-md);
    text-align: center; box-shadow: var(--shadow-md); margin-top: 16px;
}
.verdict-card.winner-vre {
    background: linear-gradient(135deg, var(--green) 0%, var(--green-light) 100%);
}
.verdict-card.winner-gibill {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
}
.verdict-card.winner-both {
    background: linear-gradient(135deg, #553c9a 0%, #6b46c1 100%);
}
.verdict-label {
    font-size: 0.82em; color: rgba(255,255,255,0.8);
    text-transform: uppercase; letter-spacing: 0.08em; margin: 0 0 8px 0;
}
.verdict-winner {
    font-size: 2em; font-weight: 800; color: white;
    margin: 0 0 8px 0; letter-spacing: -0.02em;
}
.verdict-amount {
    font-size: 1.1em; color: rgba(255,255,255,0.9); margin: 0 0 12px 0;
}
.verdict-reason {
    font-size: 0.88em; color: rgba(255,255,255,0.8); margin: 0;
    line-height: 1.5; max-width: 560px; margin: 0 auto;
}
.verdict-vre-ineligible {
    padding: 20px; background: rgba(229,62,62,0.08);
    border: 1px solid rgba(229,62,62,0.25); border-radius: var(--radius-sm);
    font-size: 0.88em; color: var(--text-secondary); margin-top: 16px; line-height: 1.5;
}

/* --- Comparison Table --- */
.comparison-table {
    width: 100%; border-collapse: collapse; margin-top: 16px; font-size: 0.9em;
}
.comparison-table th {
    padding: 12px 16px; font-size: 0.8em; text-transform: uppercase;
    letter-spacing: 0.05em; font-weight: 700; border-bottom: 2px solid var(--border-color);
}
.comparison-table th.col-gibill { color: var(--primary); }
.comparison-table th.col-vre { color: var(--green); }
.comparison-table td {
    padding: 11px 16px; border-bottom: 1px solid rgba(0,0,0,0.05);
    text-align: center; vertical-align: middle;
}
.comparison-table td.row-label {
    text-align: left; font-weight: 600; font-size: 0.82em;
    color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.03em;
}
.comparison-table tr:last-child td { border-bottom: none; }
.comparison-table tr.total-row td {
    font-weight: 700; font-size: 1em; background: var(--bg-card);
    border-top: 2px solid var(--border-color);
}
.comparison-table .winner-cell {
    font-weight: 800; color: var(--green);
}
.comparison-table .amount { font-weight: 600; }
.comparison-table .na { color: var(--text-secondary); font-style: italic; font-weight: 400; }
.comparison-table .tag {
    display: inline-block; font-size: 0.7em; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.04em; padding: 2px 7px; border-radius: 3px; margin-left: 4px;
    vertical-align: middle;
}
.tag.yes { background: rgba(39,103,73,0.1); color: var(--green); }
.tag.no { background: rgba(229,62,62,0.08); color: var(--accent); }
.tag.yr { background: rgba(26,54,93,0.08); color: var(--primary); }

/* --- Sequencing Strategy --- */
.sequencing-steps {
    display: flex; flex-direction: column; gap: 0; margin: 20px 0;
    max-width: 560px; margin: 20px auto;
}
.sequencing-step {
    display: flex; align-items: flex-start; gap: 16px;
    padding: 14px 0; border-bottom: 1px solid rgba(0,0,0,0.06); text-align: left;
}
.sequencing-step:last-child { border-bottom: none; }
.step-num {
    width: 28px; height: 28px; border-radius: 50%; background: var(--primary);
    color: white; font-weight: 800; font-size: 0.82em;
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.step-text { font-size: 0.88em; color: var(--text-primary); line-height: 1.5; }
.step-text strong { color: var(--primary); }

.sequencing-savings {
    margin: 20px auto 0; max-width: 420px; padding: 20px 24px;
    background: linear-gradient(135deg, var(--green) 0%, var(--green-light) 100%);
    border-radius: var(--radius-md); text-align: center; color: white;
}
.sequencing-savings .savings-label {
    font-size: 0.8em; color: rgba(255,255,255,0.8);
    text-transform: uppercase; letter-spacing: 0.06em; margin: 0 0 4px 0;
}
.sequencing-savings .savings-amount {
    font-size: 2em; font-weight: 800; color: white; margin: 0 0 4px 0;
}
.sequencing-savings .savings-detail {
    font-size: 0.82em; color: rgba(255,255,255,0.8); margin: 0;
}

/* --- Program Notes --- */
.program-note-list {
    max-width: 580px; margin: 0 auto; text-align: left;
    list-style: none; padding: 0;
}
.program-note-list li {
    padding: 12px 0 12px 28px; border-bottom: 1px solid rgba(0,0,0,0.06);
    font-size: 0.9em; line-height: 1.55; color: var(--text-primary);
    position: relative;
}
.program-note-list li:last-child { border-bottom: none; }
.program-note-list li::before {
    content: "→"; position: absolute; left: 0;
    color: var(--accent-gold); font-weight: 700;
}

.warning-banner {
    margin: 16px auto 0; max-width: 560px; padding: 14px 18px;
    background: rgba(229,62,62,0.07); border: 1px solid rgba(229,62,62,0.2);
    border-radius: var(--radius-sm); font-size: 0.85em; color: var(--text-primary);
    line-height: 1.5; text-align: left;
}
.warning-banner strong { color: var(--accent); }

/* --- Bottom Line --- */
.bottom-line-list {
    max-width: 600px; margin: 0 auto; text-align: left;
    list-style: none; padding: 0;
}
.bottom-line-list li {
    padding: 12px 0; border-bottom: 1px solid rgba(0,0,0,0.06);
    font-size: 0.92em; line-height: 1.5;
}
.bottom-line-list li:last-child { border-bottom: none; }
.highlight-green { font-weight: 800; color: var(--green); font-size: 1.05em; }
.highlight-primary { font-weight: 800; color: var(--primary); }
.highlight-accent { font-weight: 800; color: var(--accent); }

.bottom-line-cta {
    max-width: 600px; margin: 20px auto 0; padding: 20px 24px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    border-radius: var(--radius-md); text-align: center; color: white;
}
.bottom-line-cta p { margin: 0; font-size: 0.92em; line-height: 1.5; }
.bottom-line-cta a { color: rgba(255,255,255,0.9); text-decoration: underline; }

/* --- Email Results Form --- */
#email-results-container {
    background: linear-gradient(135deg, var(--bg-surface) 0%, rgba(26, 54, 93, 0.12) 100%);
    border: 1px solid var(--primary); text-align: center;
}
.email-form-row {
    display: flex; gap: 10px; justify-content: center;
    max-width: 480px; margin: 0 auto;
}
.email-form-row input[type="email"] {
    flex: 1; padding: 12px 16px; border: 2px solid var(--border-color);
    border-radius: var(--radius-sm); background: var(--bg-card);
    color: var(--text-primary); font-size: 0.95em;
}
.email-form-row input[type="email"]:focus {
    outline: none; border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(43,108,176,0.15);
}
.email-status { margin-top: 10px; font-size: 0.9em; min-height: 1.4em; }
.email-success { color: var(--green); font-weight: 600; }
.email-error { color: var(--accent); font-weight: 600; }

/* --- Action Bar --- */
.action-bar { display: flex; justify-content: center; gap: 12px; margin-bottom: 24px; flex-wrap: wrap; }
.action-btn {
    padding: 12px 24px; border: 2px solid var(--primary); background: var(--primary);
    color: var(--text-light); border-radius: var(--radius-sm);
    font-weight: 600; font-size: 0.88em; cursor: pointer; transition: all 0.2s ease;
}
.action-btn:hover { background: var(--primary-light); border-color: var(--primary-light); }
.action-btn-secondary { background: none; color: var(--primary); }
.action-btn-secondary:hover { background: rgba(26, 54, 93, 0.08); }

/* --- More Tools --- */
.more-tools { max-width: 800px; margin: 2rem auto; padding: 1.5rem 2rem; text-align: center; border-top: 1px solid var(--border-color); }
.more-tools h3 { font-size: 1rem; color: #999; margin-bottom: 0.75rem; font-weight: 500; }
.more-tools .tools-links { display: flex; justify-content: center; gap: 1.5rem; flex-wrap: wrap; }
.more-tools .tools-links a { color: var(--accent-gold); text-decoration: none; font-size: 0.9rem; transition: color 0.2s; }
.more-tools .tools-links a:hover { color: #e0c675; text-decoration: underline; }

.verdict-caveat {
    margin: 12px 0 0;
    padding: 10px 14px;
    background: rgba(0,0,0,0.18);
    border-left: 3px solid rgba(255,255,255,0.5);
    border-radius: var(--radius-sm);
    font-size: 0.82em;
    line-height: 1.5;
    color: rgba(255,255,255,0.92);
    text-align: left;
}

/* --- School Compare Section --- */
.compare-slot {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 12px;
}
.compare-slot-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}
.compare-slot-label { font-weight: 600; font-size: 0.9em; color: var(--text-primary); }
.compare-slot-remove {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 0.82em;
    cursor: pointer;
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    transition: background 0.15s;
}
.compare-slot-remove:hover { background: #fed7d7; color: var(--accent); }
.compare-slot-search-wrapper { position: relative; }
.compare-school-input {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.95em;
    background: white;
}
.compare-school-input:focus { outline: none; border-color: var(--primary-light); box-shadow: 0 0 0 3px rgba(43,108,176,0.15); }
.compare-school-selected-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    gap: 12px;
}
.compare-school-selected-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.compare-school-selected-name { font-weight: 600; font-size: 0.9em; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.compare-school-selected-loc  { font-size: 0.78em; color: var(--text-secondary); }
.compare-school-clear-btn {
    background: none; border: none; color: var(--text-secondary); cursor: pointer;
    font-size: 1em; padding: 4px 8px; border-radius: var(--radius-sm); flex-shrink: 0;
    transition: background 0.15s;
}
.compare-school-clear-btn:hover { background: #e2e8f0; }

/* Compare Grid Table */
.compare-grid-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.compare-grid-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88em;
    min-width: 480px;
}
.compare-grid-table thead tr { background: var(--primary); }
.cg-label-col { width: 140px; }
.cg-school-col {
    text-align: center;
    padding: 12px 14px;
    color: white;
    vertical-align: top;
    min-width: 160px;
}
.cg-school-col.cg-primary { background: rgba(255,255,255,0.12); }
.cg-primary-badge {
    display: inline-block;
    background: var(--accent-gold);
    color: var(--primary);
    font-size: 0.7em;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 20px;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.cg-school-name { font-weight: 700; font-size: 0.95em; line-height: 1.3; }
.cg-school-loc  { font-size: 0.78em; opacity: 0.8; margin-top: 3px; }
.compare-grid-table tbody tr { border-bottom: 1px solid var(--border-color); }
.compare-grid-table tbody tr:nth-child(even) { background: var(--bg-surface); }
.compare-grid-table tbody tr:hover { background: #ebf4ff; }
.cg-row-label {
    padding: 10px 14px;
    font-size: 0.82em;
    font-weight: 600;
    color: var(--text-secondary);
    white-space: nowrap;
    background: var(--bg-surface);
}
.compare-grid-table tbody td:not(.cg-row-label) {
    text-align: center;
    padding: 10px 14px;
    color: var(--text-primary);
}
.cg-winner {
    background: #f0fff4 !important;
    color: var(--green) !important;
    font-weight: 700;
}
.cg-verdict-row td { padding: 12px 14px; }
.cg-verdict {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8em;
    font-weight: 700;
    letter-spacing: 0.02em;
}
.cvb-gibill { background: #ebf4ff; color: var(--primary); }
.cvb-vre    { background: #f0fff4; color: var(--green); }
.cvb-both   { background: #faf5ff; color: #553c9a; }
.cvb-none   { background: #f7fafc; color: var(--text-secondary); }

/* --- Footer --- */
footer { text-align: center; margin-top: 40px; padding: 0 20px; color: var(--text-secondary); }
footer p { max-width: 800px; margin: 0 auto; font-size: 0.78em; line-height: 1.7; }
footer a { color: var(--primary-light); text-decoration: underline; }
.footer-sources { margin-top: 8px; font-style: italic; }

/* --- Responsive --- */
@media (max-width: 768px) {
    body { padding: 12px; }
    #calculator-container { grid-template-columns: 1fr; }
    h1 { font-size: 1.3em; }
    .home-btn { position: static; transform: none; display: block; text-align: center; margin-bottom: 12px; }
    .comparison-table { font-size: 0.82em; }
    .comparison-table th, .comparison-table td { padding: 8px 10px; }
    .email-form-row { flex-direction: column; }
    .email-form-row button { width: 100%; }
    .verdict-winner { font-size: 1.5em; }
    .section-container { padding: 20px; }
}

/* --- Print --- */
@media print {
    body { padding: 0; background: white; }
    .no-print, .action-bar, #email-results-container, #calculator-container,
    .calculate-bar, .more-tools, .toggle-indicator { display: none !important; }
    .section-container { box-shadow: none; border: 1px solid #ddd; break-inside: avoid; page-break-inside: avoid; }
    .verdict-card { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    footer { margin-top: 20px; }
}
