/* afford.css — VA Affordability Calculator v2, scoped under .aff2 */
.aff2 {
  --navy: #0A2540;
  --navy-deep: #061829;
  --navy-mid: #143256;
  --navy-light: #1E4470;
  --gold: #FFB800;
  --gold-soft: #FFC733;
  --blue: #2B7FFF;
  --blue-bright: #4A96FF;
  --white: #FFFFFF;
  --gray-400: #94A3B8;
  --green: #10B981;
  --green-soft: #34D399;
  --red: #C8102E;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  color: var(--white);
  background: radial-gradient(circle at 15% 0%, rgba(43,127,255,0.12) 0%, transparent 50%),
    radial-gradient(circle at 85% 100%, rgba(255,184,0,0.08) 0%, transparent 45%),
    linear-gradient(180deg, var(--navy) 0%, var(--navy-deep) 100%);
  border-radius: 12px;
  padding: 28px 24px 24px;
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  box-sizing: border-box;
}
.aff2 *, .aff2 *::before, .aff2 *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* Layout */
.aff2-head { margin-bottom: 20px; }
.aff2-title { font-family: 'Source Serif 4', Georgia, serif; font-size: 22px; font-weight: 700; margin-bottom: 4px; }
.aff2-subtitle { font-size: 12px; color: rgba(255,255,255,0.5); }

.aff2-body { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: start; }
@media (max-width: 768px) { .aff2-body { grid-template-columns: 1fr; } }

.aff2-inputs { min-width: 0; }
.aff2-results { position: sticky; top: 20px; min-width: 0; }

/* Mode toggle */
.aff2-mode { display: flex; gap: 0; border: 1px solid rgba(255,255,255,0.12); border-radius: 8px; overflow: hidden; margin-bottom: 16px; }
.aff2-mode label { flex: 1; text-align: center; padding: 9px 6px; font-size: 12px; font-weight: 600; cursor: pointer; transition: background 0.15s; border-right: 1px solid rgba(255,255,255,0.08); }
.aff2-mode label:last-child { border-right: none; }
.aff2-mode input { display: none; }
.aff2-mode label:has(input:checked) { background: var(--gold); color: var(--navy); }

/* Inputs */
.aff2-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 10px; }
.aff2-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; margin-bottom: 10px; }
@media (max-width: 480px) { .aff2-row, .aff2-row-3 { grid-template-columns: 1fr; } }
.aff2-field { margin-bottom: 10px; }
.aff2-label { display: block; font-size: 10px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: rgba(255,255,255,0.5); margin-bottom: 4px; }
.aff2-input { width: 100%; padding: 8px 10px; background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.12); border-radius: 6px; color: var(--white); font-size: 14px; font-family: inherit; outline: none; transition: border-color 0.15s; }
.aff2-input:focus { border-color: var(--blue); }
.aff2-hint { font-size: 10px; color: rgba(255,255,255,0.35); margin-top: 2px; }
select.aff2-input { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2394A3B8'%3E%3Cpath d='M2 4l4 4 4-4'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 28px; }
select.aff2-input option { background: var(--navy-deep); color: var(--white); }

/* Seg toggles */
.aff2-seg { display: flex; gap: 0; border: 1px solid rgba(255,255,255,0.12); border-radius: 6px; overflow: hidden; }
.aff2-seg label { flex: 1; text-align: center; padding: 7px 4px; font-size: 11px; font-weight: 600; cursor: pointer; transition: background 0.15s; border-right: 1px solid rgba(255,255,255,0.08); }
.aff2-seg label:last-child { border-right: none; }
.aff2-seg input { display: none; }
.aff2-seg label:has(input:checked) { background: var(--gold); color: var(--navy); }

/* Expander */
.aff2-expander { margin: 12px 0 6px; }
.aff2-expander summary { font-size: 11px; font-weight: 600; color: var(--blue-bright); cursor: pointer; letter-spacing: 0.03em; list-style: none; }
.aff2-expander summary::-webkit-details-marker { display: none; }
.aff2-expander summary::before { content: '+ '; }
.aff2-expander[open] summary::before { content: '− '; }
.aff2-expander-body { padding-top: 10px; }

/* Results panel */
.aff2-res { background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.08); border-radius: 10px; padding: 20px 18px; }

.aff2-hero-price { font-family: 'Source Serif 4', Georgia, serif; font-size: 32px; font-weight: 700; margin-bottom: 2px; }
.aff2-hero-sub { font-size: 12px; color: rgba(255,255,255,0.5); margin-bottom: 16px; }

.aff2-section { font-size: 10px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--gold-soft); margin: 16px 0 6px; }
.aff2-section:first-child { margin-top: 0; }

.aff2-ledger-row { display: flex; justify-content: space-between; padding: 4px 0; font-size: 12px; border-bottom: 1px solid rgba(255,255,255,0.05); }
.aff2-ledger-row:last-child { border-bottom: none; }
.aff2-ledger-total { font-weight: 700; border-top: 2px solid rgba(255,255,255,0.12); padding-top: 6px; border-bottom: none; }
.aff2-neg { color: #f87171; }

/* Status badges */
.aff2-badge { display: inline-block; padding: 3px 8px; border-radius: 4px; font-size: 10px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.aff2-badge-green { background: rgba(16,185,129,0.15); color: var(--green-soft); border: 1px solid rgba(16,185,129,0.3); }
.aff2-badge-gold { background: rgba(255,184,0,0.15); color: var(--gold-soft); border: 1px solid rgba(255,184,0,0.3); }
.aff2-badge-red { background: rgba(200,16,46,0.15); color: #f87171; border: 1px solid rgba(200,16,46,0.3); }

/* Stress / sensitivity */
.aff2-stress { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; margin: 8px 0; }
.aff2-stress-card { background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.06); border-radius: 6px; padding: 8px; text-align: center; }
.aff2-stress-label { font-size: 9px; color: var(--gray-400); text-transform: uppercase; letter-spacing: 0.06em; }
.aff2-stress-val { font-size: 15px; font-weight: 700; }
.aff2-stress-delta { font-size: 10px; color: #f87171; }
@media (max-width: 480px) { .aff2-stress { grid-template-columns: 1fr; } }

.aff2-sens { width: 100%; font-size: 11px; border-collapse: collapse; margin: 6px 0; }
.aff2-sens th, .aff2-sens td { padding: 4px 6px; text-align: left; border-bottom: 1px solid rgba(255,255,255,0.05); }
.aff2-sens th { font-size: 9px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--gray-400); }

.aff2-disclaimer { font-size: 10px; color: rgba(255,255,255,0.3); margin-top: 14px; line-height: 1.5; }

.aff2-cta { display: block; text-align: center; margin-top: 14px; padding: 12px; background: linear-gradient(135deg, var(--gold) 0%, var(--gold-soft) 100%); color: var(--navy); border-radius: 8px; font-size: 13px; font-weight: 700; text-decoration: none; letter-spacing: 0.02em; transition: transform 0.1s; }
.aff2-cta:hover { transform: scale(0.98); }
