/* Application page — extends site.css */
.secure { font-size: 13px; color: var(--body); font-weight: 500; }
.apply .apply-grid { display: grid; grid-template-columns: 320px 1fr; gap: 56px; padding-top: 56px; padding-bottom: 88px; align-items: start; }

.rail { position: sticky; top: 104px; }
.rail h1 { font-family: var(--serif); font-size: var(--fs-h2); line-height: 1.12; font-weight: 600; margin-top: 10px; text-wrap: pretty; }
.rail-lede { color: var(--body); margin-top: 14px; font-size: 15.5px; }
.progress { list-style: none; margin-top: 32px; display: grid; gap: 4px; counter-reset: p; }
.progress li { counter-increment: p; display: flex; align-items: center; gap: 14px; padding: 10px 0; color: var(--muted); font-weight: 500; font-size: 15px; }
.progress li::before { content: counter(p); width: 30px; height: 30px; border-radius: 50%; border: 1.5px solid var(--line); display: grid; place-items: center; font-size: 13px; font-weight: 600; background: var(--paper); flex: none; transition: all .2s; }
.progress li.active { color: var(--ink); }
.progress li.active::before { border-color: var(--berry); color: var(--berry); background: #fff; box-shadow: 0 0 0 4px rgba(165, 69, 126, .12); }
.progress li.done { color: var(--aubergine); }
.progress li.done::before { content: "✓"; background: var(--aubergine); border-color: var(--aubergine); color: var(--cream); }
.rail-help { margin-top: 32px; padding-top: 22px; border-top: 1px solid var(--line); display: grid; gap: 4px; font-size: 14px; }
.rail-help a { color: var(--berry); text-decoration: none; font-weight: 600; }

.form-card { padding: 40px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.country { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-bottom: 24px; margin-bottom: 28px; border-bottom: 1px solid var(--line); }
.country-q { font-weight: 600; font-size: 14.5px; }
.seg { display: inline-flex; background: var(--cream); border: 1px solid var(--line); border-radius: 99px; padding: 4px; }
.seg label { position: relative; padding: 9px 20px; border-radius: 99px; font-size: 14px; font-weight: 600; color: var(--body); cursor: pointer; transition: all .15s; }
.seg input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.seg label:has(input:checked) { background: var(--aubergine); color: var(--cream); }
.seg label:has(input:focus-visible) { box-shadow: 0 0 0 3px rgba(165, 69, 126, .35); }

.step-panel { border: 0; display: grid; gap: 18px; animation: rise .25s ease; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.step-head { margin-bottom: 6px; }
.step-num { font-family: var(--serif); font-style: italic; color: var(--berry); font-size: 15px; }
.step-head h2 { font-family: var(--serif); font-size: var(--fs-h3); font-weight: 600; margin-top: 2px; }
.step-head p { color: var(--body); font-size: 15px; margin-top: 4px; }
.fields.tight { margin-top: 0; gap: 10px; }
.opt { font-style: normal; font-weight: 400; color: var(--muted); }

.dropzone { display: grid; justify-items: center; gap: 6px; text-align: center; border: 1.5px dashed #D5C9D9; border-radius: var(--radius); padding: 40px 24px; background: var(--paper); cursor: pointer; transition: all .15s; color: var(--body); font-size: 14.5px; }
.dropzone:hover, .dropzone.drag { border-color: var(--berry); background: #fff; }
.dropzone b { color: var(--ink); font-size: 16px; }
.dropzone u { color: var(--berry); }
.dz-icon { width: 52px; height: 52px; border-radius: 50%; background: var(--cream); display: grid; place-items: center; font-size: 22px; color: var(--berry); margin-bottom: 6px; }
.dz-limit { font-size: 12.5px; color: var(--muted); }
.file-list { list-style: none; display: grid; gap: 8px; margin-top: 14px; }
.file-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; border: 1px solid var(--line); border-radius: 10px; padding: 11px 14px; font-size: 14px; background: #fff; }
.file-list li.bad { border-color: var(--error); color: var(--error); }
.file-list .fname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-list .fsize { color: var(--muted); font-size: 12.5px; flex: none; }
.file-list button { background: none; border: 0; color: var(--muted); font-size: 18px; cursor: pointer; flex: none; line-height: 1; }
.file-list button:hover { color: var(--error); }
.hint-box { font-size: 14px; color: var(--body); background: var(--cream); border-radius: 12px; padding: 14px 16px; }
.hint-box a { color: var(--berry); font-weight: 600; }

.review { display: grid; gap: 14px; }
.review section { border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px; background: var(--paper); }
.review header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.review h3 { font-family: var(--serif); font-size: var(--fs-h4); font-weight: 600; }
.review header button { background: none; border: 0; color: var(--berry); font-weight: 600; font-size: 13.5px; cursor: pointer; }
.review dl { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px 24px; font-size: 14px; }
.review dt { color: var(--muted); font-size: 12.5px; }
.review dd { color: var(--ink); overflow-wrap: anywhere; }

.sigpad { position: relative; border: 1px solid var(--line); border-radius: 14px; background: #fff; height: 180px; touch-action: none; }
.sigpad canvas { width: 100%; height: 100%; display: block; border-radius: 14px; cursor: crosshair; }
.sig-line { position: absolute; left: 24px; right: 24px; bottom: 34px; border-top: 1px solid var(--line); padding-top: 4px; font-size: 12px; color: var(--muted); pointer-events: none; }
.sig-clear { position: absolute; top: 10px; right: 12px; background: var(--cream); border: 1px solid var(--line); border-radius: 99px; padding: 5px 14px; font-size: 12.5px; font-weight: 600; color: var(--aubergine); cursor: pointer; }

.legal-box { border: 1px solid var(--line); border-radius: 14px; background: var(--paper); }
.legal-box summary { cursor: pointer; padding: 14px 18px; font-weight: 600; font-size: 14.5px; color: var(--aubergine); }
.legal-text { max-height: 320px; overflow: auto; padding: 0 18px 18px; font-size: 13px !important; color: var(--body); line-height: 1.6; }
.legal-text * { font-family: var(--sans) !important; color: var(--body) !important; font-size: 13px !important; background: none !important; }
.legal-text a { color: var(--berry) !important; }

.check { display: flex; gap: 12px; align-items: flex-start; font-size: 14.5px; color: var(--ink); cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--aubergine); margin-top: 2px; flex: none; }
#auth_field.invalid .check { color: var(--error); }

.nav-row { display: flex; justify-content: space-between; gap: 12px; margin-top: 32px; padding-top: 24px; border-top: 1px solid var(--line); }
.nav-row #next, .nav-row #submit { margin-left: auto; }

.done { text-align: center; padding: 40px 12px; display: grid; justify-items: center; gap: 14px; }
.done-mark { width: 72px; height: 72px; border-radius: 50%; background: var(--aubergine); color: var(--cream); display: grid; place-items: center; font-size: 34px; }
.done h2 { font-family: var(--serif); font-size: var(--fs-h2); font-weight: 600; }
.done p { color: var(--body); max-width: 460px; }
.done .sub { font-size: 14px; }
.done a:not(.btn) { color: var(--berry); }

.sending { position: relative; }
.sending::after { content: ""; width: 16px; height: 16px; border: 2px solid rgba(255,255,255,.5); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 960px) {
  .apply .apply-grid { grid-template-columns: 1fr; gap: 28px; padding-top: 32px; }
  .rail { position: static; }
  .rail h1 { font-size: 30px; }
  .progress { grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 20px; }
  .progress li { flex-direction: column; gap: 6px; font-size: 12px; text-align: center; padding: 0; }
  .rail-help { display: none; }
}
@media (max-width: 600px) {
  .form-card { padding: 24px 18px; }
  .review dl { grid-template-columns: 1fr; }
  .step-head h2 { font-size: var(--fs-h4); }
  .secure { display: none; }
}
