/* Apply for an account — its own page (not the sign-in screen). Uses the tokens from site.css. */
.ap-body { min-height: 100vh; }

/* Header */
.ap-top { display: grid; justify-items: center; gap: 18px; padding-top: clamp(32px, 5vw, 64px); padding-bottom: clamp(28px, 4vw, 48px); text-align: center; }
.ap-badge { display: inline-flex; align-items: center; gap: 10px; height: 32px; padding: 0 14px; border-radius: 999px; background: var(--bg-soft); color: var(--text); font-size: 13px; font-weight: 500; }
.ap-badge i { width: 7px; height: 7px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 4px rgba(34, 197, 94, .16); }
.ap-top h1 { max-width: 14ch; font-size: clamp(42px, 6vw, 80px); line-height: .98; letter-spacing: -.05em; text-wrap: balance; }
.ap-lead { max-width: 600px; color: var(--muted); font-size: clamp(16px, 1.3vw, 18px); line-height: 1.6; }
.ap-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; width: min(920px, 100%); margin: 14px 0 0; padding: 0; list-style: none; text-align: left; counter-reset: apstep; }
.ap-steps li { position: relative; display: grid; grid-template-columns: 44px minmax(0, 1fr); align-items: center; gap: 14px; padding: 16px 18px; border-radius: 18px; background: var(--bg-soft); counter-increment: apstep; }
.ap-steps li::after { content: counter(apstep); position: absolute; top: 12px; right: 16px; color: var(--muted); font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.ap-step-ico { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; background: var(--text); color: var(--bg); font-size: 17px; }
.ap-steps strong { display: block; font-size: 15px; font-weight: 600; letter-spacing: -.01em; }
.ap-steps small { display: block; color: var(--muted); font-size: 13px; line-height: 1.45; }

.ap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 380px); gap: 20px; align-items: start; padding-bottom: clamp(48px, 6vw, 96px); }

/* Side: what you get */
.ap-side { position: sticky; top: 92px; display: grid; gap: 12px; }
.ap-perks { padding: 26px; border-radius: var(--r-lg); background: #0b0b0c; color: #fff; }
.ap-perks-k { margin-bottom: 14px !important; color: rgba(255, 255, 255, .6); font-size: 13px; font-weight: 500; }
.ap-perks ul { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.ap-perks li { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 14px; padding: 14px 0; border-top: 1px solid rgba(255, 255, 255, .1); }
.ap-perks li > i { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: rgba(255, 255, 255, .08); color: #fff; font-size: 16px; }
.ap-perks strong { display: block; font-size: 14.5px; font-weight: 600; }
.ap-perks span { display: block; color: rgba(255, 255, 255, .6); font-size: 13px; line-height: 1.5; }
.ap-have { padding: 4px 8px; color: var(--muted); font-size: 14px; text-align: center; }
.ap-have a { color: var(--text); font-weight: 600; text-underline-offset: 4px; }

/* Right: the application */
.ap-card {
    --text-2: var(--muted); --text-3: var(--muted); --surface: var(--card); --surface-2: var(--bg-soft); --line-strong: var(--line-2);
    padding: clamp(24px, 4vw, 44px); border-radius: var(--r-lg); background: var(--card); box-shadow: inset 0 0 0 1px var(--line-2);
}
.ap-form-head { padding-bottom: 24px; border-bottom: 1px solid var(--line); }
.ap-form-head h2 { font-size: 24px; letter-spacing: -.035em; }
.ap-form-head p { margin-top: 6px; color: var(--muted); font-size: 14.5px; }
.ap-card .req { margin-left: 2px; color: var(--accent); }
.ap-card form { display: grid; gap: 22px; margin-top: 24px; }
.ap-card .apply-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.ap-card .apply-group { min-width: 0; margin: 0; padding: 0; border: 0; }
.ap-card .apply-group legend { padding: 0; }
.ap-card .label { display: block; margin-bottom: 8px; color: var(--text); font-size: 13.5px; font-weight: 500; }
.ap-card .note { color: var(--muted); font-size: 13.5px; }
.ap-card .error { margin-top: 6px; color: #e5484d; font-size: 13px; }
.ap-card .form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 16px; }
.ap-card .form-grid .span-2 { grid-column: 1 / -1; }
.ap-card .field { min-width: 0; }
.ap-card .input, .ap-card .select, .ap-card .textarea {
    display: block; width: 100%; min-height: 48px; padding: 12px 16px; border: 0; border-radius: 14px; background: var(--bg-soft); color: var(--text);
    box-shadow: inset 0 0 0 1px transparent; font: inherit; font-size: 15px; outline: 0; transition: box-shadow .15s;
}
.ap-card .textarea { min-height: 120px; resize: vertical; }
.ap-card .input::placeholder, .ap-card .textarea::placeholder { color: var(--muted); opacity: .8; }
.ap-card .input:focus, .ap-card .select:focus, .ap-card .textarea:focus { box-shadow: inset 0 0 0 1.5px var(--text); }
.ap-card .is-invalid { box-shadow: inset 0 0 0 1.5px #e5484d; }
.ap-card .search-lg { position: relative; }

.ap-card .apply-section { display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: start; margin-top: 10px; padding-top: 26px; border-top: 1px solid var(--line); }
.ap-card .apply-section--first { margin-top: 0; padding-top: 0; border-top: 0; }
.ap-card .apply-section h2 { font-size: 18px; line-height: 28px; letter-spacing: -.025em; }
.ap-card .apply-section .note { margin-top: 2px; }
.ap-card .apply-num { display: grid; place-items: center; width: 28px; height: 28px; border: 0; border-radius: 50%; background: var(--text); color: var(--bg); font-size: 12.5px; font-weight: 600; letter-spacing: 0; }
.ap-card .apply-choice { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.ap-card .apply-option { position: relative; display: block; cursor: pointer; }
.ap-card .apply-option input { position: absolute; opacity: 0; pointer-events: none; }
.ap-card .apply-option > span { display: grid; grid-template-columns: auto 1fr; column-gap: 12px; align-items: center; padding: 16px; border: 0; border-radius: 16px; background: var(--bg-soft); box-shadow: inset 0 0 0 1px transparent; }
.ap-card .apply-option > span .icon { grid-row: span 2; color: var(--text); }
.ap-card .apply-option strong { color: var(--text); font-size: 15px; font-weight: 600; }
.ap-card .apply-option small { color: var(--muted); font-size: 13px; }
.ap-card .apply-option input:checked + span { box-shadow: inset 0 0 0 2px var(--text); }
.ap-card .apply-option input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

.ap-card .apply-song { display: grid; gap: 16px; }
.ap-card .apply-picked { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 0; border-radius: 14px; background: var(--bg-soft); }
.ap-card .apply-picked[hidden], .ap-card .apply-results[hidden], .ap-card .apply-status[hidden], .ap-card [data-song-search][hidden] { display: none; }
.ap-card .apply-results { max-height: 340px; margin: 10px 0 0; padding: 0; overflow: auto; list-style: none; display: grid; gap: 6px; }
.ap-card .apply-status { margin-top: 10px; }
.ap-card .import-row { display: flex; align-items: center; gap: 12px; padding: 8px 10px 8px 8px; border: 0; border-radius: 14px; background: var(--bg-soft); }
.ap-card .import-cover { flex: none; width: 44px; height: 44px; overflow: hidden; border-radius: 10px; background: var(--card); }
.ap-card .import-cover img { display: block; width: 100%; height: 100%; object-fit: cover; }
.ap-card .import-info { display: grid; gap: 2px; min-width: 0; flex: 1; }
.ap-card .import-info strong { overflow: hidden; font-size: 14px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.ap-card .import-sub-line { overflow: hidden; color: var(--muted); font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.ap-card .btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px; border: 0; border-radius: 999px; background: transparent; color: var(--text); box-shadow: inset 0 0 0 1px var(--line-2); font: inherit; font-size: 14px; font-weight: 500; text-decoration: none; cursor: pointer; }
.ap-card .btn-sm { height: 34px; padding: 0 14px; font-size: 13px; }
.ap-card .btn-ghost { box-shadow: none; }
.ap-card .btn-primary { background: var(--accent); color: #fff; box-shadow: none; }
.ap-card .apply-submit { width: 100%; height: 54px; font-size: 15.5px; font-weight: 600; }
.ap-card .signin-terms { color: var(--muted); font-size: 13px; text-align: center; }
.ap-card .link, .ap-card .signin-terms a { color: var(--text); font-weight: 500; text-underline-offset: 3px; }
.ap-card .alert { display: flex; gap: 10px; padding: 14px 16px; border-radius: 14px; background: var(--bg-soft); font-size: 14px; }

.ap-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 20px; padding-bottom: 28px; color: var(--muted); font-size: 13px; }
.ap-foot nav { display: flex; gap: 18px; }
.ap-foot a { text-decoration: none; }

@media (max-width: 960px) {
    .ap { grid-template-columns: minmax(0, 1fr); }
    .ap-side { position: static; }
    .ap-steps { grid-template-columns: minmax(0, 1fr); }
}
}
@media (max-width: 620px) {
    .ap-top { justify-items: start; text-align: left; }
    .ap-perks { padding: 20px; }
    .ap-card .form-grid, .ap-card .apply-choice { grid-template-columns: minmax(0, 1fr); }
}

.ap-card .search-lg .icon { position: absolute; left: 16px; top: 50%; width: 18px; height: 18px; transform: translateY(-50%); color: var(--muted); pointer-events: none; z-index: 1; }
.ap-card .search-lg .input { padding-left: 46px; }
.ap-card .select { appearance: none; -webkit-appearance: none; padding-right: 44px; background-repeat: no-repeat; background-position: right 16px center; background-size: 14px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%2366666e' d='M12 15.6 5.4 9l1.4-1.4 5.2 5.2 5.2-5.2L18.6 9z'/%3E%3C/svg%3E"); }
@media (max-width: 720px) { .ap-body .ws-signin { display: inline-flex; } }

/* ---- Fields: text always readable (dark mode, browser autofill, native lists) ---- */
html[data-theme="light"] { color-scheme: light; }
html[data-theme="dark"] { color-scheme: dark; }
html[data-theme="dark"] .ap-card { --field: #1c1c1f; --field-line: rgba(255, 255, 255, .08); }
.ap-card { --field: #f4f4f2; --field-line: rgba(11, 11, 12, .06); }
.ap-card :is(.input, .select, .textarea) {
    background-color: var(--field) !important; color: var(--text) !important; -webkit-text-fill-color: var(--text);
    caret-color: var(--text); box-shadow: inset 0 0 0 1px var(--field-line);
}
.ap-card :is(.input, .textarea)::placeholder { color: var(--muted) !important; -webkit-text-fill-color: var(--muted); opacity: 1; }
.ap-card :is(.input, .select, .textarea):focus { box-shadow: inset 0 0 0 1.5px var(--text); }
.ap-card :is(.input, .textarea):-webkit-autofill,
.ap-card :is(.input, .textarea):-webkit-autofill:hover,
.ap-card :is(.input, .textarea):-webkit-autofill:focus {
    -webkit-text-fill-color: var(--text); caret-color: var(--text);
    -webkit-box-shadow: 0 0 0 1000px var(--field) inset, inset 0 0 0 1px var(--field-line);
    transition: background-color 9999s ease-out 0s;
}
.ap-card select option { background: var(--card); color: var(--text); }
.ap-card .apply-option > span, .ap-card .apply-picked, .ap-card .import-row { background: var(--field); }

/* ---- Country picker with flags ---- */
.ap-country { position: relative; }
.ap-country.is-ready .ap-native { position: absolute; left: 0; bottom: 0; width: 100%; height: 1px; padding: 0; opacity: 0; pointer-events: none; }
.ap-country-btn {
    display: flex; align-items: center; gap: 10px; width: 100%; min-height: 48px; padding: 0 14px 0 16px; border: 0; border-radius: 14px;
    background: var(--field); color: var(--text); box-shadow: inset 0 0 0 1px var(--field-line); font: inherit; font-size: 15px; text-align: left; cursor: pointer;
}
.ap-country.is-open .ap-country-btn, .ap-country-btn:focus-visible { outline: 0; box-shadow: inset 0 0 0 1.5px var(--text); }
.ap-country-btn.is-invalid { box-shadow: inset 0 0 0 1.5px #e5484d; }
.ap-country-val { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; }
.ap-country-val > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ap-country-val.is-empty { color: var(--muted); }
.ap-country-chev { flex: none; width: 16px; height: 16px; color: var(--muted); transition: transform .15s; }
.ap-country.is-open .ap-country-chev { transform: rotate(180deg); }
.ap-flag { display: block; flex: none; width: 24px; height: 18px; border-radius: 4px; object-fit: cover; background: var(--chip); box-shadow: 0 0 0 1px var(--line); }
.ap-flag.is-missing { visibility: hidden; }

.ap-country-pop {
    position: absolute; z-index: 40; left: 0; right: 0; top: calc(100% + 8px); padding: 8px; border-radius: 18px;
    background: var(--card); box-shadow: inset 0 0 0 1px var(--line-2), 0 18px 40px rgba(0, 0, 0, .14);
}
html[data-theme="dark"] .ap-country-pop { background: #18181b; box-shadow: inset 0 0 0 1px var(--line-2), 0 18px 40px rgba(0, 0, 0, .5); }
.ap-country.is-up .ap-country-pop { top: auto; bottom: calc(100% + 8px); }
.ap-country-search { position: relative; margin-bottom: 6px; }
.ap-country-search svg { position: absolute; left: 12px; top: 50%; width: 17px; height: 17px; transform: translateY(-50%); color: var(--muted); }
.ap-country-search input {
    width: 100%; height: 42px; padding: 0 12px 0 38px; border: 0; border-radius: 12px; outline: 0;
    background: var(--field); color: var(--text); -webkit-text-fill-color: var(--text); caret-color: var(--text); font: inherit; font-size: 14.5px;
}
.ap-country-search input::placeholder { color: var(--muted); -webkit-text-fill-color: var(--muted); }
.ap-country-list { max-height: 296px; margin: 0; padding: 0; overflow-y: auto; list-style: none; overscroll-behavior: contain; scrollbar-width: thin; }
.ap-country-opt { display: flex; align-items: center; gap: 12px; height: 42px; padding: 0 12px; border-radius: 10px; color: var(--text); font-size: 14.5px; cursor: pointer; }
.ap-country-opt > span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ap-country-opt.is-active { background: var(--chip); }
.ap-country-opt.is-selected { font-weight: 600; }
.ap-country-opt.is-selected::after { content: ""; flex: none; width: 10px; height: 5px; border: 2px solid currentColor; border-top: 0; border-right: 0; transform: rotate(-45deg) translate(1px, -2px); }
.ap-country-empty { padding: 14px 12px; color: var(--muted); font-size: 14px; }

.ap-card .signin-turnstile { display: grid; justify-items: center; min-height: 65px; }
