/* Commercial loan application - uses the site variables from index.php */
.ap-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 40px; align-items: start; }
.app-form { display: block; }
.af-hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.af-step { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow-sm); margin-bottom: 20px; animation: afIn .25s ease; }
.af-step[hidden], .af-block[hidden], .af-field[hidden] { display: none !important; }
@keyframes afIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.af-step-head { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.af-num { width: 32px; height: 32px; border-radius: 50%; background: var(--ink); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: 15px; flex: none; }
.af-step-head h2 { font-size: 21px; }
.af-block + .af-block { margin-top: 22px; padding-top: 22px; border-top: 1px dashed var(--line); }
.af-block { animation: afIn .25s ease; }
.af-block h3 { font-size: 16px; margin-bottom: 4px; color: var(--blue-dark); }
.af-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
.af-field.full { grid-column: 1 / -1; }
.af-field { min-width: 0; margin: 0; padding: 0; border: 0; }
.af-field > label, .af-field > legend { display: block; font-size: 12.5px; font-weight: 700; color: var(--muted); margin-bottom: 6px; text-transform: uppercase; letter-spacing: .03em; padding: 0; }
.af-field > legend { font-size: 15px; color: var(--text); text-transform: none; letter-spacing: 0; margin-bottom: 10px; }
.af-req { color: #b42318; }
.af-field input, .af-field select, .af-field textarea { width: 100%; padding: 12px 14px; border-radius: var(--radius-sm); border: 1px solid #c9d1db; background: var(--paper); color: var(--text); font-size: 16px; font-family: inherit; }
.af-field input:focus, .af-field select:focus, .af-field textarea:focus { outline: 2px solid var(--blue); outline-offset: 1px; border-color: var(--blue); }
.af-field input:user-invalid, .af-field select:user-invalid, .af-field textarea:user-invalid { border-color: #d92d20; }
.af-help { font-size: 12.5px; color: var(--muted); margin-top: 6px; line-height: 1.45; }
.af-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.af-card { position: relative; display: block; border: 1.5px solid var(--line); border-radius: 12px; padding: 14px 14px 14px 42px; cursor: pointer; transition: border-color .15s, background .15s; background: var(--paper); }
.af-card:hover { border-color: var(--blue); }
.af-card input { position: absolute; left: 14px; top: 16px; width: 18px; height: 18px; accent-color: var(--blue-dark); margin: 0; }
.af-card strong { display: block; font-size: 15px; }
.af-card small { display: block; margin-top: 3px; font-size: 12.5px; color: var(--muted); line-height: 1.4; }
.af-card.is-on { border-color: var(--blue-dark); background: #effaff; box-shadow: 0 0 0 1px var(--blue-dark) inset; }
.af-card:focus-within { outline: 3px solid var(--blue); outline-offset: 2px; }
.af-toggle { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; padding: 14px 16px; border: 1.5px dashed #c9d1db; border-radius: 12px; font-weight: 600; font-size: 15px; }
.af-toggle input { width: 20px; height: 20px; margin-top: 1px; accent-color: var(--blue-dark); flex: none; }
.af-toggle:has(input:checked) { border-style: solid; border-color: var(--blue-dark); background: #effaff; }
.af-consent { margin: 18px 0 4px; font-weight: 500; font-size: 14px; line-height: 1.5; border-style: solid; }
.af-ltv { margin: 0 0 16px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--mist); border: 1px solid var(--line); font-size: 14px; line-height: 1.5; }
.af-ltv.warn { background: #fffaeb; border-color: #fedf89; }
.af-review { margin-top: 18px; outline: none; }
.af-sum-block { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin-bottom: 12px; background: var(--mist); }
.af-sum-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 8px; }
.af-sum-head h4 { margin: 0; font-size: 15px; }
.af-edit { font-size: 13px; font-weight: 700; color: var(--blue-dark); text-decoration: underline; }
.af-sum-block dl { margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 6px 18px; }
.af-sum-block dl div { min-width: 0; }
.af-sum-block dt { font-size: 11.5px; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); font-weight: 700; }
.af-sum-block dd { margin: 1px 0 0; font-size: 14.5px; font-weight: 600; overflow-wrap: anywhere; white-space: pre-line; }
#af-submit { width: 100%; margin-top: 12px; }
.af-success { background: var(--paper); border: 1px solid var(--line); border-top: 4px solid var(--blue); border-radius: var(--radius); padding: 32px; box-shadow: var(--shadow-md); outline: none; }
.af-success h2 { font-size: 24px; }
.af-success p { margin-top: 12px; color: var(--muted); font-size: 16px; line-height: 1.6; }
.af-success a { color: var(--blue-dark); font-weight: 700; }
/* Side panel */
.ap-side { position: sticky; top: 100px; display: grid; gap: 16px; }
.ap-card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow-sm); }
.ap-card h2 { font-size: 16px; margin-bottom: 10px; }
.ap-progress { height: 8px; border-radius: 99px; background: var(--mist); overflow: hidden; border: 1px solid var(--line); }
.ap-progress span { display: block; height: 100%; width: 0; background: var(--blue); transition: width .25s; }
#af-progress-txt { font-size: 12.5px; color: var(--muted); margin-top: 6px; font-weight: 700; }
.ap-steps { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 6px; counter-reset: s; }
.ap-steps li { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 600; }
.ap-steps li::before { counter-increment: s; content: counter(s); width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--line); display: inline-flex; align-items: center; justify-content: center; font-size: 11.5px; flex: none; }
.ap-steps li.is-done::before { content: "\2713"; background: var(--blue-dark); border-color: var(--blue-dark); color: #fff; }
.ap-steps li.is-locked { color: #98a2b3; }
.ap-card ul.ap-facts { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 13.5px; color: #344054; }
.ap-card ul.ap-facts li { padding-left: 18px; position: relative; line-height: 1.45; }
.ap-card ul.ap-facts li::before { content: ""; position: absolute; left: 2px; top: 7px; width: 7px; height: 7px; border-radius: 50%; background: var(--blue); }
.ap-card p { font-size: 13.5px; color: var(--muted); line-height: 1.5; }
.ap-card a { color: var(--blue-dark); font-weight: 700; }
.ap-side.is-sent .ap-progress-card { display: none; }
@media (max-width: 900px) {
  .ap-layout { grid-template-columns: 1fr; }
  .ap-side { position: static; }
  .ap-progress-card { display: none; }
}
@media (max-width: 620px) {
  .af-step { padding: 20px 16px; }
  .af-grid, .af-sum-block dl { grid-template-columns: 1fr; }
  .af-cards { grid-template-columns: 1fr; }
}
