/* Arc · application page (full screen, white) */
body.apply-page { background: #fff; }

/* Header */
.ap-header { position: fixed; inset: 0 0 auto; z-index: 20; height: 72px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 0 var(--gutter); background: rgba(255,255,255,.92); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.ap-logo { justify-self: start; font-size: 24px; font-weight: 500; letter-spacing: -0.05em; line-height: 1; }
.ap-exit { justify-self: end; font-size: 14px; color: rgb(var(--muted)); transition: color .2s; }
.ap-exit:hover { color: rgb(var(--fg)); }
.ap-segs { display: flex; gap: 8px; }
.ap-segs button { position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 6px 0; }
.ap-segs .bar { display: block; width: 72px; height: 4px; border-radius: 2px; background: #ebeaf0; transition: background-color .45s var(--ease-out), opacity .45s; }
.ap-segs .lbl { font-size: 12px; font-weight: 500; line-height: 1; color: #b3b1bd; white-space: nowrap; transition: color .3s; }
.ap-segs li.done .bar { background: rgb(var(--accent)); opacity: .4; }
.ap-segs li.done .lbl { color: rgb(var(--muted)); }
.ap-segs li.done button { cursor: pointer; }
.ap-segs li.done button:hover .bar { opacity: .7; }
.ap-segs li.done button:hover .lbl { color: rgb(var(--fg)); }
.ap-segs li.active .bar { background: rgb(var(--accent)); opacity: 1; }
.ap-segs li.active .lbl { color: rgb(var(--fg)); }
.ap-segs button:disabled { cursor: default; }
.ap-segs.complete li .bar { background: rgb(var(--accent)); opacity: 1; }
.ap-segs.complete li .lbl { color: rgb(var(--accent)); }
.ap-segs.complete li:nth-child(2) .bar, .ap-segs.complete li:nth-child(2) .lbl { transition-delay: .07s; }
.ap-segs.complete li:nth-child(3) .bar, .ap-segs.complete li:nth-child(3) .lbl { transition-delay: .14s; }
.ap-segs.complete li:nth-child(4) .bar, .ap-segs.complete li:nth-child(4) .lbl { transition-delay: .21s; }
.ap-segs.complete li:nth-child(5) .bar, .ap-segs.complete li:nth-child(5) .lbl { transition-delay: .28s; }
@media (max-width: 720px) {
  .ap-segs { gap: 5px; }
  .ap-segs .bar { width: 30px; }
  .ap-segs .lbl { position: absolute; top: 22px; left: 50%; transform: translateX(-50%); opacity: 0; }
  .ap-segs li.active .lbl { opacity: 1; }
  .ap-exit { font-size: 13px; }
}

/* Main column */
.ap-main { max-width: 680px; margin: 0 auto; padding: 136px var(--gutter) 160px; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.step { animation: step-in .5s var(--ease-out); }
@keyframes step-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.step-head { display: block; width: 100%; padding: 0; margin-bottom: 40px; }
.step-head h1 { font-size: clamp(34px, 5vw, 48px); font-weight: 500; letter-spacing: -0.035em; line-height: 1.05; outline: none; }
.step-head p { margin-top: 10px; font-size: 16px; color: rgb(var(--muted)); }

/* Fields */
.row { display: grid; gap: 0 16px; }
@media (min-width: 640px) { .row { grid-template-columns: 1fr 1fr; } }
.field { margin-bottom: 26px; min-width: 0; }
.field > label, .field .label { display: block; padding: 0; margin-bottom: 8px; font-size: 15px; font-weight: 500; line-height: 1.4; }
.field label em { font-style: normal; font-weight: 400; font-size: 13px; color: rgb(var(--muted)); margin-left: 6px; }
.hint { margin: -2px 0 10px; font-size: 14px; line-height: 1.5; color: rgb(var(--muted)); }
.field input[type="text"], .field input[type="email"], .field input[type="url"], .field select, .field textarea {
  width: 100%; font: inherit; font-size: 15px; color: rgb(var(--fg)); background: #fafafc;
  border: 1px solid #e4e3ea; border-radius: 12px; padding: 12px 14px; transition: border-color .2s, box-shadow .2s, background-color .2s;
}
.field input, .field select { height: 48px; }
.field select { appearance: none; -webkit-appearance: none; padding-right: 40px; background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 6l4 4 4-4' fill='none' stroke='%236a687a' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; background-size: 16px; }
.field textarea { resize: vertical; min-height: 120px; line-height: 1.6; }
.field ::placeholder { color: #aeacba; }
.field input:hover, .field select:hover, .field textarea:hover { border-color: #d3d1dc; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; background: #fff; border-color: rgba(var(--accent), .7); box-shadow: 0 0 0 4px rgba(var(--accent), .12); }
.field [aria-invalid="true"] { border-color: rgba(var(--rose), .8); box-shadow: 0 0 0 4px rgba(var(--rose), .1); }
.field-foot { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.count { flex: none; margin-left: auto; margin-top: 8px; font-family: var(--mono); font-size: 11.5px; color: rgb(var(--muted)); }
.count.ok { color: rgb(var(--accent)); }
.err { margin-top: 8px; font-size: 13px; color: rgb(198, 64, 120); }
.err:empty { display: none; }

/* Chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; cursor: pointer; }
.chip input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.chip span { display: inline-flex; align-items: center; height: 40px; padding: 0 16px; border-radius: 999px; font-size: 14px; background: #fafafc; border: 1px solid #e4e3ea; transition: background-color .2s, border-color .2s, color .2s; user-select: none; }
.chip:hover span { border-color: #cfcdd8; }
.chip input:checked + span { background: rgba(var(--accent), .1); border-color: rgba(var(--accent), .6); color: rgb(76, 52, 180); }
.chip input:focus-visible + span { outline: 2px solid rgb(var(--accent)); outline-offset: 2px; }
.group[aria-invalid="true"] .chip span { border-color: rgba(var(--rose), .6); }
.field > .confirm { display: flex; align-items: center; gap: 14px; margin: 0; padding: 16px 18px; font-weight: 400; border-radius: 14px; border: 1px solid #e4e3ea; background: #fafafc; cursor: pointer; font-size: 15px; line-height: 1.45; transition: border-color .2s, background-color .25s; user-select: none; }
.confirm:hover { border-color: #cfcdd8; }
.confirm input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.confirm .box { flex: none; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 8px; background: #fff; border: 1.5px solid #cfcdd8; transition: background-color .2s, border-color .2s, transform .35s cubic-bezier(.34, 1.56, .64, 1); }
.confirm .box svg { width: 16px; height: 16px; }
.confirm .box path { fill: none; stroke: #fff; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 16; stroke-dashoffset: 16; transition: stroke-dashoffset .3s .08s var(--ease-out); }
.confirm input:checked + .box { background: rgb(var(--accent)); border-color: rgb(var(--accent)); transform: scale(1.08); }
.confirm input:checked + .box path { stroke-dashoffset: 0; }
.confirm:has(input:checked) { border-color: rgba(var(--accent), .45); background: rgba(var(--accent), .05); }
.confirm input:focus-visible + .box { outline: 2px solid rgb(var(--accent)); outline-offset: 3px; }
.field[aria-invalid="true"] .confirm { border-color: rgba(var(--rose), .7); }

.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-error { padding: 12px 16px; border-radius: 12px; font-size: 14px; line-height: 1.5; background: rgba(var(--rose), .08); color: rgb(150, 40, 90); }
noscript .form-error { margin-bottom: 32px; }

/* Footer bar */
.ap-footer { position: fixed; inset: auto 0 0; z-index: 20; background: rgba(255,255,255,.94); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-top: 1px solid #efeef3; }
.ap-footer-in { max-width: 680px; margin: 0 auto; padding: 14px var(--gutter) calc(14px + env(safe-area-inset-bottom)); display: flex; align-items: center; gap: 12px; }
.ap-footer #next, .ap-footer #submit { margin-left: auto; min-width: 132px; }
.save-note { font-size: 12.5px; color: rgb(var(--muted)); opacity: 0; transition: opacity .4s; }
.save-note.show { opacity: 1; }
#submit[disabled] { opacity: .6; cursor: progress; }

/* Leaving the form */
#apply-flow { transition: opacity .35s, transform .45s var(--ease-out), filter .35s; }
#apply-flow.leaving { opacity: 0; transform: translateY(-12px) scale(.98); filter: blur(4px); }

/* Done */
.apply-done { min-height: calc(100svh - 280px); display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.burst { position: relative; width: 120px; height: 120px; }
.done-mark { position: relative; z-index: 2; width: 120px; height: 120px; overflow: visible; transform: scale(0); }
.ring-draw { fill: none; stroke: rgb(var(--accent)); stroke-width: 4; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 1; transform: rotate(-90deg); transform-origin: 60px 60px; }
.ring-fill { fill: rgb(var(--accent)); transform: scale(0); transform-origin: 60px 60px; }
.tick { fill: none; stroke: #fff; stroke-width: 7; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 1; }
.ripple { position: absolute; inset: 14px; border-radius: 50%; border: 2px solid rgba(var(--accent), .5); opacity: 0; }
.particle { position: absolute; left: 50%; top: 50%; width: var(--s); height: var(--s); margin: calc(var(--s) / -2) 0 0 calc(var(--s) / -2); border-radius: 50%; background: var(--c); opacity: 0; }
.apply-done h1 { margin-top: 28px; font-size: clamp(34px, 5vw, 52px); font-weight: 500; letter-spacing: -0.035em; line-height: 1.05; outline: none; }
.apply-done h1 .w { display: inline-block; opacity: 0; transform: translateY(18px); filter: blur(8px); }
.done-sub { margin: 14px 0 32px; font-size: 16px; color: rgb(var(--muted)); opacity: 0; transform: translateY(10px); }
.done-btn { opacity: 0; transform: translateY(10px); }

.apply-done.play .done-mark { animation: mark-pop .7s cubic-bezier(.34, 1.56, .64, 1) forwards; }
.apply-done.play .ring-draw { animation: dash-in .55s .12s var(--ease-out) forwards; }
.apply-done.play .ring-fill { animation: fill-pop .5s .6s cubic-bezier(.34, 1.56, .64, 1) forwards; }
.apply-done.play .tick { animation: dash-in .42s .82s cubic-bezier(.65, 0, .35, 1) forwards; }
.apply-done.play .ripple { animation: ripple 1.1s .78s var(--ease-out) forwards; }
.apply-done.play .ripple.r2 { animation-delay: .98s; }
.apply-done.play .particle { animation: particle .9s .8s cubic-bezier(.2, .8, .3, 1) forwards; }
.apply-done.play h1 .w { animation: word-in .7s var(--ease-out) forwards; }
.apply-done.play .done-sub { animation: rise .6s 1.45s var(--ease-out) forwards; }
.apply-done.play .done-btn { animation: rise .6s 1.6s var(--ease-out) forwards; }

@keyframes mark-pop { 0% { transform: scale(0); } 100% { transform: scale(1); } }
@keyframes dash-in { to { stroke-dashoffset: 0; } }
@keyframes fill-pop { 0% { transform: scale(0); } 100% { transform: scale(1); } }
@keyframes ripple { 0% { opacity: .8; transform: scale(.9); } 100% { opacity: 0; transform: scale(2.3); } }
@keyframes particle { 0% { opacity: 1; transform: translate(0, 0) scale(1); } 70% { opacity: 1; } 100% { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(.2); } }
@keyframes word-in { to { opacity: 1; transform: none; filter: none; } }
@keyframes rise { to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  .done-mark, .ring-fill, .apply-done h1 .w, .done-sub, .done-btn { transform: none !important; opacity: 1 !important; filter: none !important; }
  .ring-draw, .tick { stroke-dashoffset: 0 !important; }
  .particle, .ripple { display: none; }
}

/* Optional Cloudflare Turnstile box (only appears if a challenge is needed) */
.cf-box { margin: 4px 0 18px; min-height: 0; }
.cf-box:empty { display: none; }

/* Age, and the parent/guardian block that appears for under-18s */
.hint.after { margin: 8px 0 0; font-size: 13px; }
.guardian { margin: 4px 0 26px; padding: 22px 22px 0; border: 1px solid var(--line); border-radius: 14px; }
.guardian-head { margin: 0 0 6px; font-size: 15px; font-weight: 500; line-height: 1.4; }
.guardian .hint { margin-bottom: 18px; }
.confirm .txt a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
