/* Online application form — multi-step wizard (maroon / silver theme, uses variables from index.css) */

.af-section { background: var(--silver-pale, #F1F5F9); padding-top: 2.5rem; padding-bottom: 4rem; }
.af-container { max-width: 880px; }
.af-section [hidden], .af-section [data-off], .af-modal[hidden], .af-modal [hidden] { display: none !important; }
.af-step { display: none; }
.af-step.is-current { display: block; }
.af-card { scroll-margin-top: 90px; }

.af-intro { text-align: center; margin-bottom: 1.75rem; }
.af-intro h2 { color: var(--maroon); font-size: clamp(1.5rem, 3vw, 2rem); margin: 0 0 .5rem; }
.af-intro p { color: var(--gray-600); margin: 0 auto .35rem; max-width: 640px; }
.af-pdf-alt { font-size: .9rem; }
.af-pdf-alt a { color: var(--maroon); font-weight: 600; text-decoration: underline; }

.af-card { background: #fff; border-radius: var(--radius-lg, 16px); box-shadow: var(--shadow-lg); border: 1px solid var(--silver-light); overflow: hidden; }

/* progress */
.af-progress { padding: 1.1rem 1.5rem 1rem; background: linear-gradient(135deg, var(--maroon-dark), var(--maroon)); color: #fff; }
.af-progress-top { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; flex-wrap: wrap; margin-bottom: .6rem; }
.af-progress-step { font-size: .8rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--silver-light); }
.af-progress-title { font-weight: 600; font-size: 1.05rem; }
.af-bar { height: 6px; background: rgba(255, 255, 255, .22); border-radius: 99px; overflow: hidden; }
.af-bar-fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--silver-light), #fff); border-radius: 99px; transition: width .35s ease; }

#afForm { padding: 1.75rem 1.5rem 1.5rem; }

/* step header */
.af-step-head { margin-bottom: 1.4rem; padding-bottom: 1rem; border-bottom: 2px solid var(--silver-light); }
.af-step-num { display: inline-block; font-size: .72rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--maroon); background: rgba(123, 31, 48, .08); padding: .2rem .65rem; border-radius: 99px; margin-bottom: .45rem; }
.af-step-head h3 { margin: 0; font-size: 1.4rem; color: var(--gray-800); }
.af-step-head p { margin: .25rem 0 0; color: var(--gray-500); font-size: .95rem; }
.af-step { animation: afIn .3s ease; }
@keyframes afIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* field grid */
.af-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 1.15rem 1rem; }
.af-w-full { grid-column: span 6; }
.af-w-half { grid-column: span 3; }
.af-w-third { grid-column: span 2; }
.af-subhead { grid-column: span 6; margin: .6rem 0 -.2rem; padding-top: .9rem; border-top: 1px dashed var(--silver); font-size: 1rem; color: var(--maroon); font-weight: 700; }
.af-grid > .af-subhead:first-child { border-top: 0; padding-top: 0; margin-top: 0; }

.af-field { min-width: 0; }
.af-field label:not(.af-choice):not(.af-check), .af-label { display: block; font-weight: 600; font-size: .92rem; color: var(--gray-700); margin-bottom: .4rem; }
.af-req { color: #C0263F; }
.af-opt { font-weight: 400; color: var(--gray-400); font-size: .82rem; }
.af-field input[type=text], .af-field input[type=email], .af-field input[type=tel], .af-field input[type=date], .af-field select, .af-field textarea {
  width: 100%; padding: .8rem .95rem; border: 1.5px solid var(--silver-light); border-radius: var(--radius-md, 10px);
  font: inherit; font-size: 1rem; color: var(--gray-800); background: var(--off-white, #FAFAF7); transition: border-color .2s, box-shadow .2s, background .2s;
}
.af-field textarea { resize: vertical; min-height: 84px; }
.af-field input:focus, .af-field select:focus, .af-field textarea:focus { outline: none; border-color: var(--maroon); background: #fff; box-shadow: 0 0 0 3px rgba(123, 31, 48, .14); }
.af-hint { margin: .35rem 0 0; font-size: .82rem; color: var(--gray-500); line-height: 1.45; }
.af-error { margin: .35rem 0 0; font-size: .84rem; color: #B3213B; font-weight: 500; display: none; }
.af-field.af-invalid .af-error { display: block; }
.af-field.af-invalid input:not([type=radio]):not([type=checkbox]), .af-field.af-invalid select, .af-field.af-invalid textarea { border-color: #C0263F; background: #FFF6F7; }
.af-field.af-invalid .af-choice span, .af-field.af-invalid .af-doc-box, .af-field.af-invalid .af-sig-wrap { border-color: #C0263F; }

/* radio / checkbox "pills" */
.af-choices { display: flex; flex-wrap: wrap; gap: .6rem; }
.af-choice { position: relative; cursor: pointer; margin: 0 !important; }
.af-choice input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; cursor: pointer; margin: 0; }
.af-choice span { display: inline-flex; align-items: center; gap: .5rem; padding: .65rem 1.05rem; border: 1.5px solid var(--silver-light); border-radius: 99px; background: var(--off-white, #FAFAF7); font-weight: 500; font-size: .95rem; color: var(--gray-700); transition: all .2s; }
.af-choice span::before { content: ""; width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--silver); background: #fff; flex: none; transition: all .2s; }
.af-choice input[type=checkbox] + span::before { border-radius: 4px; }
.af-choice:hover span { border-color: var(--maroon-light); }
.af-choice input:focus-visible + span { box-shadow: 0 0 0 3px rgba(123, 31, 48, .22); }
.af-choice input:checked + span { background: rgba(123, 31, 48, .07); border-color: var(--maroon); color: var(--maroon-dark); font-weight: 600; }
.af-choice input:checked + span::before { border-color: var(--maroon); background: var(--maroon); box-shadow: inset 0 0 0 3px #fff; }

.af-check { display: flex; align-items: flex-start; gap: .65rem; cursor: pointer; font-weight: 500; font-size: .95rem; color: var(--gray-700); line-height: 1.45; }
.af-check input { width: 19px; height: 19px; flex: none; margin-top: .1rem; accent-color: var(--maroon); }

/* documents */
.af-docs { display: grid; gap: 1.25rem; }
.af-doc > .af-hint { margin: -.15rem 0 .55rem; }
.af-doc-box { border: 1.5px dashed var(--silver); border-radius: var(--radius-md, 10px); background: var(--off-white, #FAFAF7); padding: 1rem; display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
.af-doc-preview { display: flex; align-items: center; gap: .75rem; min-width: 0; }
.af-doc-img { width: 96px; height: 64px; object-fit: cover; border-radius: 8px; border: 1px solid var(--silver-light); background: #fff; }
.af-doc-pdf { width: 64px; height: 64px; display: grid; place-items: center; border-radius: 8px; background: var(--maroon); color: #fff; font-weight: 700; letter-spacing: .05em; }
.af-doc-name { font-size: .85rem; color: var(--gray-600); word-break: break-all; }
.af-doc-actions { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin-left: auto; }
.af-doc.af-has-file .af-doc-box { border-style: solid; border-color: var(--maroon-light); background: #fff; }

/* signature */
.af-sigs { display: grid; gap: 1.25rem; }
.af-sig-wrap { position: relative; border: 1.5px dashed var(--silver); border-radius: var(--radius-md, 10px); background: #fff; touch-action: none; }
.af-sig-canvas { display: block; width: 100%; height: 170px; cursor: crosshair; touch-action: none; }
.af-sig-ph { position: absolute; inset: 0; display: grid; place-items: center; color: var(--gray-400); pointer-events: none; font-size: .95rem; }
.af-sig.af-signed .af-sig-ph { display: none; }
.af-sig-tools { text-align: right; margin-top: .3rem; }
.af-date-note { margin: 1.25rem 0 0; color: var(--gray-600); }
.af-declare { margin-top: 1.5rem; padding: 1.25rem; background: var(--silver-pale, #F1F5F9); border-radius: var(--radius-md, 10px); border: 1px solid var(--silver-light); }
.af-declare .af-subhead { grid-column: auto; margin: 1.25rem 0 .75rem; border-top: 1px dashed var(--silver); padding-top: 1rem; }

/* summary */
.af-summary { display: grid; gap: 1rem; }
.af-sum-block { border: 1px solid var(--silver-light); border-radius: var(--radius-md, 10px); overflow: hidden; }
.af-sum-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .6rem 1rem; background: rgba(123, 31, 48, .07); }
.af-sum-head h4 { margin: 0; font-size: .95rem; color: var(--maroon-dark); }
.af-sum-list { margin: 0; padding: .35rem 1rem .6rem; display: grid; grid-template-columns: minmax(130px, 38%) 1fr; gap: .35rem 1rem; font-size: .9rem; }
.af-sum-list dt { color: var(--gray-500); }
.af-sum-list dd { margin: 0; color: var(--gray-800); font-weight: 500; white-space: pre-line; word-break: break-word; }

/* buttons */
.af-btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; font: inherit; font-weight: 600; font-size: .95rem; padding: .75rem 1.4rem; border-radius: var(--radius-full, 99px); border: 1.5px solid transparent; cursor: pointer; text-decoration: none; transition: all .2s; line-height: 1.2; }
.af-btn svg { width: 18px; height: 18px; fill: currentColor; }
.af-btn-primary { background: var(--maroon); color: #fff; box-shadow: var(--shadow-md); }
.af-btn-primary:hover { background: var(--maroon-dark); transform: translateY(-1px); }
.af-btn-primary[disabled] { opacity: .65; cursor: wait; transform: none; }
.af-btn-outline { background: #fff; color: var(--maroon); border-color: var(--maroon); }
.af-btn-outline:hover { background: rgba(123, 31, 48, .07); }
.af-btn-ghost { background: transparent; color: var(--gray-600); border-color: var(--silver); }
.af-btn-ghost:hover { background: var(--silver-pale); }
.af-link { background: none; border: 0; padding: .2rem; color: var(--maroon); font: inherit; font-size: .88rem; font-weight: 600; text-decoration: underline; cursor: pointer; }

.af-nav { display: flex; justify-content: space-between; gap: .75rem; margin-top: 1.75rem; padding-top: 1.25rem; border-top: 1px solid var(--silver-light); }
.af-nav .af-btn-primary { margin-left: auto; min-width: 150px; }

.af-alert { padding: .85rem 1rem; border-radius: var(--radius-md, 10px); background: var(--silver-pale); border: 1px solid var(--silver); margin-bottom: 1rem; }
.af-alert-error { background: #FFF1F3; border-color: #C0263F; color: #8A1830; margin: 1.25rem 0 0; font-weight: 500; }

/* honeypot */
.af-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* success */
.af-success { padding: 3rem 1.5rem; text-align: center; }
.af-success-icon { width: 72px; height: 72px; margin: 0 auto 1rem; border-radius: 50%; background: linear-gradient(135deg, var(--maroon), var(--maroon-light)); display: grid; place-items: center; box-shadow: var(--shadow-lg); }
.af-success-icon svg { width: 38px; height: 38px; fill: #fff; }
.af-success h3 { font-size: 1.7rem; color: var(--maroon); margin: 0 0 .75rem; }
.af-ref { display: inline-block; margin: 0 0 1.25rem; padding: .8rem 1.5rem; border: 1.5px dashed var(--maroon-light); border-radius: var(--radius-md, 10px); background: rgba(123, 31, 48, .05); color: var(--gray-600); font-size: .9rem; }
.af-ref strong { display: block; font-size: 1.35rem; letter-spacing: .06em; color: var(--maroon-dark); }
.af-success p { max-width: 540px; margin-left: auto; margin-right: auto; color: var(--gray-600); }
.af-success-actions { display: flex; gap: .75rem; justify-content: center; flex-wrap: wrap; margin-top: 1.5rem; }

/* camera modal */
.af-modal { position: fixed; inset: 0; z-index: 2000; background: rgba(17, 17, 17, .78); display: grid; place-items: center; padding: 1rem; }
.af-modal-box { width: min(560px, 100%); background: #fff; border-radius: var(--radius-lg, 16px); padding: 1rem; box-shadow: var(--shadow-xl); }
.af-cam-stage { position: relative; background: #111; border-radius: var(--radius-md, 10px); overflow: hidden; aspect-ratio: 4 / 3; }
.af-cam-stage video, .af-cam-stage img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.af-cam-guide { position: absolute; left: 7%; right: 7%; top: 50%; aspect-ratio: 1.586; transform: translateY(-50%); max-height: 86%; margin: 0 auto; border: 3px dashed rgba(255, 255, 255, .85); border-radius: 14px; box-shadow: 0 0 0 999px rgba(0, 0, 0, .28); pointer-events: none; }
.af-cam-tip { margin: .75rem 0; font-size: .88rem; color: var(--gray-600); text-align: center; }
.af-cam-actions { display: flex; flex-wrap: wrap; gap: .6rem; justify-content: center; }

@media (max-width: 680px) {
  .af-w-half, .af-w-third { grid-column: span 6; }
  #afForm { padding: 1.35rem 1rem 1.15rem; }
  .af-progress { padding: 1rem; }
  .af-doc-actions { margin-left: 0; width: 100%; }
  .af-doc-actions .af-btn { flex: 1 1 auto; }
  .af-sum-list { grid-template-columns: 1fr; gap: .1rem; }
  .af-sum-list dd { margin-bottom: .45rem; }
  .af-nav .af-btn { padding-left: 1rem; padding-right: 1rem; }
  .af-choice span { padding: .6rem .9rem; }
}

@media print {
  .header, .nav-mobile, footer, .af-nav, .hero, .af-intro { display: none !important; }
  .af-card { box-shadow: none; border: 0; }
  .af-section { background: #fff; }
}

/* options that exist but cannot be chosen yet (e.g. Growth Fund "coming soon") */
.af-choice.is-disabled { cursor: not-allowed; }
.af-choice.is-disabled input { cursor: not-allowed; }
.af-choice.is-disabled span { opacity: .55; background: var(--gray-100, #F3F3F3); border-style: dashed; color: var(--gray-500); }
.af-choice.is-disabled:hover span { border-color: var(--silver-light); }
.af-choice.is-disabled span::before { background: var(--gray-200, #E8E8E8); border-color: var(--gray-300, #D1D1D1); }
.af-soon { font-style: normal; font-size: .7rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--maroon); background: rgba(123, 31, 48, .1); padding: .12rem .5rem; border-radius: 99px; }

.af-legal { font-size: .82rem; color: var(--gray-500); max-width: 700px; padding: .7rem 1rem; margin: .75rem auto .25rem; border-left: 3px solid var(--maroon-light); background: rgba(123, 31, 48, .04); text-align: left; border-radius: 0 var(--radius-md, 10px) var(--radius-md, 10px) 0; }

/* date of birth: day / month / year dropdowns */
.af-date { display: grid; grid-template-columns: 1fr 1.7fr 1.2fr; gap: .5rem; }
.af-date select { min-width: 0; }
.af-field.af-invalid .af-date select { border-color: #C0263F; background: #FFF6F7; }
.af-date { grid-template-columns: .9fr 1.55fr 1.15fr; gap: .4rem; }
.af-field .af-date select { padding-left: .55rem; padding-right: .3rem; font-size: .95rem; text-overflow: clip; }
@media (min-width: 681px) { .af-date { gap: .6rem; } .af-field .af-date select { padding-left: .95rem; padding-right: .6rem; font-size: 1rem; } }

/* upload box placed inside a step (e.g. optional proof of address under the contact fields) */
.af-docs-inline { margin-top: 1.4rem; padding-top: 1.2rem; border-top: 1px dashed var(--silver); }

/* camera dialog: readable message when the live camera cannot start */
.af-cam-stage.is-error { display: grid; place-items: center; background: #2b2b2b; }
.af-cam-stage.is-error::before { content: ""; width: 64px; height: 64px; opacity: .55; background: center / contain no-repeat url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'><path d='M9 3 7.17 5H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2h-3.17L15 3H9zm3 15a5 5 0 1 1 0-10 5 5 0 0 1 0 10zm0-2a3 3 0 1 0 0-6 3 3 0 0 0 0 6z'/><path d='M3 3l18 18' stroke='white' stroke-width='2'/></svg>"); }
.af-cam-stage.is-error .af-cam-guide { display: none; }
.af-cam-tip.is-err { color: #B3213B; font-weight: 600; line-height: 1.5; }
