/* Template CSS
   - Keep this file lean; rely on components/style.css for base typography, buttons, cards, etc.
   - Favor spacing consistency over pixel-perfect values; adjust sparingly per calculator.
*/

/* Match your existing template style + add explicit warn slot + results separator */
.calc-page .card {
    margin-top: 16px;
}

.lede {
    color: #374151;
    font-size: 1.05rem;
    margin: 6px 0 10px;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr; /* Default: single column */
    gap: 12px; /* Align spacing with existing calculators (bmi/mortgage) */
}

/* Use only when two inputs are tightly related (e.g., $ and %) */
.pair-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

@media (max-width: 700px) {
    .pair-grid {
        grid-template-columns: 1fr;
    }
}

/* Optional: force full-width rows when mixing with pair-grid */
.span-2 {
    grid-column: 1 / -1;
}

.field label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
}

.field input {
    width: 100%;
    margin-bottom: 1px; /* Keep warn tight to the input */
}

/*
  Validation vs hint:
  - warn: red, should appear directly under input.
  - hint: neutral, reserves space to avoid layout shift.
*/
.warn {
    color: #b91c1c;
    font-size: 0.9rem;
    margin-top: 1px;
    margin-bottom: 1px;
    min-height: 0; /* avoid extra gap when empty */
}

.hint {
    color: #6b7280;
    font-size: 0.85rem;
    margin-top: 4px; /* Match mortgage spacing */
    min-height: 0;
}

/* Actions row */
.actions {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 12px;
}

.small {
    font-size: 0.9rem;
    color: #6b7280;
}

/* Optional panel */
.panel {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.check {
    display: inline-flex;
    gap: 8px;
    align-items: center;
    cursor: pointer;
}

/* Results */
.table-scroll {
    overflow-x: auto;
}

.results-table.grid-table {
    display: grid;
    grid-template-columns: 1.1fr repeat(3, minmax(160px, 1fr));
    gap: 8px 12px;
    align-items: stretch;
    min-width: 640px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 12px;
    background: #f9fafb;
}

.results-table .head {
    font-weight: 600;
    color: #6b7280;
    text-align: center;
    font-size: 1rem;
    border-bottom: 1px solid rgba(0,0,0,0.08);
    padding: 6px 4px 10px;
}

.results-table .head .budget {
    display: block;
    color: #6b7280;
    font-weight: 600;
    margin-top: 2px;
}

.results-table .label {
    font-weight: 600;
    color: #374151;
    text-align: left;
}

.results-table .label.sub {
    color: #6b7280;
    font-weight: 600;
}

.results-table .label.sub small {
    font-size: 0.6em;
    display: inline-block;
}

.results-table .cell {
    text-align: center;
    font-weight: 700;
    font-size: 1.02rem;
    color: #111827;
}

.results-table .cell.strong {
    font-weight: 900;
}

.results-table .label,
.results-table .cell {
    padding: 8px 4px;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.results-table .label:not(.head),
.results-table .cell {
    border-right: 1px solid rgba(0,0,0,0.05);
}

.results-table .label:nth-last-child(-n+4),
.results-table .cell:nth-last-child(-n+3) {
    border-bottom: none; /* remove border on last row */
}

/* Remove right border on last column cells */
.results-table .cell:nth-child(4n),
.results-table .head:nth-child(4n) {
    border-right: none;
}

.warnblock {
    margin-top: 10px;
    color: #7f1d1d;
}

.text-block h2,
.text-block h3 {
    margin-top: 0;
}

.text-block ul {
    padding-left: 20px;
    margin: 8px 0;
}

/* UX/design principles (keep in mind)
   - Mobile-first: grid collapses cleanly; tap targets remain large; avoid horizontal scrolling.
   - Information hierarchy: headings, lede, and results use consistent type scale.
   - Feedback: warn + hint reserve space to reduce layout shift.
   - Brevity: short labels and hints; avoid verbose placeholders.
   - Performance: share assets from /components to minimize payload.
*/
