/* P4.AX: registration page. Builds on the sign-in page's styles (assets/css/p4av-signin.css): same colours, fields,
   buttons and layout; here the steps, wider card, selects, chips, review and dialogs. */

.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.p4ax .shell { grid-template-columns: minmax(0, .9fr) minmax(480px, 1.1fr); }
.p4ax .story-main { margin-top: 8vh; }

/* ---------- the steps (left) */
.rail { list-style: none; margin: 4px 0 28px; padding: 0; display: grid; gap: 4px; max-width: 420px; }
.rail-step { position: relative; display: flex; gap: 14px; align-items: flex-start; padding: 8px 10px; border-radius: 14px; transition: background .25s; }
.rail-step:not(:last-child)::after {
    content: ""; position: absolute; left: 27px; top: 46px; bottom: -10px; width: 2px; background: rgba(255, 255, 255, .25); border-radius: 2px;
}
.rail-step.is-done:not(:last-child)::after { background: rgba(255, 255, 255, .75); }
.rail-dot {
    flex: 0 0 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: .95rem;
    border: 2px solid rgba(255, 255, 255, .45); background: rgba(255, 255, 255, .08); transition: all .3s var(--ease);
}
.rail-step.is-done .rail-dot { background: #fff; color: var(--brand); border-color: #fff; }
.rail-step.is-now { background: rgba(255, 255, 255, .12); }
.rail-step.is-now .rail-dot { background: #fff; color: var(--brand); border-color: #fff; box-shadow: 0 0 0 6px rgba(255, 255, 255, .18); animation: pulse 2.4s var(--ease) infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 10px rgba(255, 255, 255, .06); } }
.rail-text { display: flex; flex-direction: column; line-height: 1.3; padding-top: 2px; }
.rail-text strong, .rail-text a { font-family: "Plus Jakarta Sans", Inter, sans-serif; font-weight: 700; font-size: 1rem; }
.rail-text a { text-decoration: none; }
.rail-text a:hover { text-decoration: underline; }
.rail-text small { opacity: .8; font-size: .84rem; }
.rail-step.is-next { opacity: .72; }
.perks { list-style: none; margin: auto 0 0; padding: 0; display: grid; gap: 10px; font-size: .93rem; max-width: 460px; }
.perks li { display: flex; gap: 12px; align-items: center; opacity: .92; }
.perks i { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: rgba(255, 255, 255, .14); font-size: .85rem; }

/* ---------- the card (right) */
.card-wide { max-width: 620px; }
.step-kicker { margin: 0 0 4px; font-size: .8rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--brand); }
@media (prefers-color-scheme: dark) { .step-kicker { color: #93c5fd; } }
.mini-progress { display: none; margin: -4px 0 18px; }
.mini-head { display: flex; justify-content: space-between; font-size: .82rem; color: var(--muted); font-weight: 600; margin-bottom: 6px; }
.mini-bar { height: 6px; border-radius: 99px; background: var(--line); overflow: hidden; }
.mini-bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), var(--glow)); border-radius: 99px; transition: width .6s var(--ease); }
.card .note { margin-bottom: 14px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.field .label, .field legend { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 6px; padding: 0; }
fieldset.field { border: 0; margin: 0 0 16px; padding: 0; min-width: 0; }
.opt { font-weight: 500; color: var(--muted); font-size: .8rem; margin-left: 4px; }
.hint { margin: 6px 2px 0; font-size: .84rem; color: var(--muted); }
.hint:empty { display: none; }
.msg.is-good { color: var(--ok); }
.control select, .control textarea, .control input[type="date"] {
    width: 100%; border-radius: 12px; border: 1.5px solid var(--field-line); background: var(--field); color: var(--ink);
    font: inherit; font-size: 1rem; transition: border-color .2s, box-shadow .2s;
}
.control select, .control input[type="date"] { height: 50px; padding: 0 14px; }
.control select { appearance: none; padding-right: 40px; background-image: linear-gradient(45deg, transparent 50%, #8a94a6 50%), linear-gradient(135deg, #8a94a6 50%, transparent 50%);
    background-position: calc(100% - 20px) 22px, calc(100% - 15px) 22px; background-size: 5px 5px; background-repeat: no-repeat; }
.control select:disabled { opacity: .6; cursor: not-allowed; }
.control textarea { padding: 12px 14px; min-height: 96px; resize: vertical; line-height: 1.45; }
.control input:not([type]), .control input[type="text"], .control input[type="tel"], .control input[type="email"], .control input[type="password"] { padding-left: 44px; }
.control:not(:has(.lead-icon)) input { padding-left: 14px; }
.control select:focus, .control textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px color-mix(in srgb, var(--glow) 22%, transparent); }
.control [aria-invalid="true"], .field.is-bad select, .field.is-bad textarea { border-color: var(--bad); }
.control input[readonly] { background: color-mix(in srgb, var(--ink) 4%, var(--field)); color: var(--muted); }

/* username suggestions */
.suggest { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 8px; font-size: .85rem; color: var(--muted); }
.suggest button { border: 1.5px dashed var(--brand); color: var(--brand); background: var(--brand-soft); border-radius: 99px; padding: 4px 12px; font: 600 .85rem Inter, sans-serif; cursor: pointer; }
@media (prefers-color-scheme: dark) { .suggest button { background: transparent; color: #93c5fd; border-color: #93c5fd; } }

/* password strength and rules */
.strength { height: 6px; border-radius: 99px; background: var(--line); overflow: hidden; margin: -4px 0 10px; }
.strength span { display: block; height: 100%; width: 0; border-radius: 99px; transition: width .35s var(--ease), background .35s; }
.rules { list-style: none; padding: 0; margin: 0 0 8px; display: grid; grid-template-columns: 1fr 1fr; gap: 6px 16px; font-size: .86rem; color: var(--muted); }
.rules li { display: flex; align-items: center; gap: 8px; transition: color .2s; }
.rules i { font-size: .5rem; transition: transform .2s; }
.rules li.is-met { color: var(--ok); }
.rules li.is-met i::before { content: "\f00c"; }
.rules li.is-met i { font-size: .8rem; }

/* gender */
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.seg-item { position: relative; cursor: pointer; }
.seg-item input { position: absolute; opacity: 0; }
.seg-item span { display: flex; align-items: center; justify-content: center; height: 50px; border-radius: 12px; border: 1.5px solid var(--field-line); background: var(--field); font-weight: 600; transition: all .2s; }
.seg-item input:checked + span { border-color: var(--brand); background: var(--brand); color: #fff; box-shadow: 0 8px 18px -10px var(--glow); }
.seg-item input:focus-visible + span { outline: 3px solid var(--glow); outline-offset: 2px; }

/* parent / guardian block from P2.15 */
.guardian #p215Guardian { border: 1.5px solid #fedf89 !important; border-radius: 14px !important; padding: 16px !important; background: #fffaeb !important; margin-bottom: 16px; color: #713f12; }
.guardian h6 { margin: 0 0 4px; font-size: 1rem; }
.guardian .row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.guardian .form-label { display: block; font-weight: 600; font-size: .88rem; margin-bottom: 4px; }
.guardian .form-control, .guardian .form-select { width: 100%; height: 44px; border-radius: 10px; border: 1.5px solid #e9c46a; padding: 0 12px; font: inherit; background: #fff; color: #111; }
.guardian .mb-3 { margin-bottom: 12px; }
.guardian .small { font-size: .85rem; }
.guardian .invalid-feedback { color: #b42318; font-size: .84rem; margin-top: 4px; }
@media (prefers-color-scheme: dark) { .guardian #p215Guardian { background: #2e1d05 !important; border-color: #713f12 !important; color: #fde68a; } }

/* languages */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; cursor: pointer; }
.chip input { position: absolute; opacity: 0; }
.chip span { display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; border-radius: 99px; border: 1.5px solid var(--field-line); background: var(--field); font-weight: 600; font-size: .92rem; transition: all .2s var(--ease); }
.chip i { width: 0; overflow: hidden; font-size: .75rem; transition: width .2s; }
.chip input:checked + span { background: var(--brand); border-color: var(--brand); color: #fff; }
.chip input:checked + span i { width: 12px; }
.chip input:focus-visible + span { outline: 3px solid var(--glow); outline-offset: 2px; }
.chip:hover span { border-color: var(--brand); }
.range { width: 100%; accent-color: var(--brand); height: 28px; }
output { display: inline-block; min-width: 2.2em; margin-left: 6px; padding: 1px 8px; border-radius: 99px; background: var(--brand-soft); color: var(--brand); font-weight: 700; text-align: center; }
@media (prefers-color-scheme: dark) { output { background: #1e2a44; color: #93c5fd; } }

/* photo */
.photo { margin-bottom: 18px; }
.drop { position: relative; display: flex; gap: 16px; align-items: center; padding: 14px; border: 2px dashed var(--field-line); border-radius: 16px; cursor: pointer; transition: border-color .2s, background .2s; }
.drop:hover, .drop.is-over { border-color: var(--brand); background: color-mix(in srgb, var(--glow) 6%, transparent); }
.drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.drop input:focus-visible ~ * { outline: none; }
.drop:focus-within { border-color: var(--brand); box-shadow: 0 0 0 4px color-mix(in srgb, var(--glow) 22%, transparent); }
.avatar { width: 76px; height: 76px; border-radius: 50%; object-fit: cover; background: var(--line); border: 3px solid var(--card); box-shadow: 0 0 0 2px var(--brand); flex: 0 0 auto; }
.drop-text { display: flex; flex-direction: column; gap: 2px; }
.drop-text small { color: var(--muted); }

/* review */
.review { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 18px; }
.review-card { border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; background: color-mix(in srgb, var(--ink) 2%, var(--card)); }
.review-card header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.review-card h3 { margin: 0; font: 700 .95rem "Plus Jakarta Sans", Inter, sans-serif; display: flex; gap: 8px; align-items: center; }
.review-card h3 i { color: var(--brand); }
@media (prefers-color-scheme: dark) { .review-card h3 i { color: #93c5fd; } }
.edit { font-size: .84rem; font-weight: 700; text-decoration: none; padding: 2px 10px; border-radius: 99px; border: 1px solid var(--line); }
.edit:hover { border-color: var(--brand); }
.review dl { display: grid; grid-template-columns: auto 1fr; gap: 3px 12px; margin: 0; font-size: .88rem; }
.review dt { color: var(--muted); }
.review dd { margin: 0; overflow-wrap: anywhere; }

/* referral */
.referral { border: 1px solid var(--line) !important; border-radius: 14px; padding: 12px 14px 14px !important; }
.referral legend { padding: 0 6px; }
.referral legend i { color: var(--brand); }
.ref-set { margin: 0 0 6px; }
.link-btn { background: none; border: 0; padding: 0; color: var(--brand); font: inherit; font-weight: 700; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
@media (prefers-color-scheme: dark) { .link-btn { color: #93c5fd; } }
.agree { display: grid; gap: 10px; margin: 6px 0 4px; }
.agree .msg { margin-top: -4px; }

/* buttons */
.nav { display: flex; gap: 12px; margin-top: 22px; }
.nav .primary { flex: 1; }
.ghost {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 52px; padding: 0 20px; border-radius: 12px;
    border: 1.5px solid var(--field-line); background: var(--field); color: var(--ink) !important; font-weight: 600; text-decoration: none; cursor: pointer; font-size: .98rem;
}
.ghost:hover { border-color: #a9b3c4; }
.ghost.wide { width: 100%; margin-top: 10px; }
.primary.small { width: auto; height: 42px; padding: 0 20px; }
a.primary { text-decoration: none; color: #fff !important; }
.socials-top { grid-template-columns: 1fr 1fr; }
.socials-top:has(> :only-child) { grid-template-columns: 1fr; }

/* finished */
.done-card { text-align: center; }
.done-badge { width: 76px; height: 76px; margin: 0 auto 14px; border-radius: 50%; display: grid; place-items: center; font-size: 2rem; color: #fff; background: var(--ok); box-shadow: 0 0 0 10px color-mix(in srgb, var(--ok) 16%, transparent); animation: pop .6s var(--ease) both; }
@keyframes pop { from { transform: scale(.4); opacity: 0; } 70% { transform: scale(1.08); } to { transform: none; opacity: 1; } }
.regno { display: grid; gap: 4px; justify-items: center; padding: 16px; border-radius: 16px; background: linear-gradient(135deg, var(--brand), var(--deep)); color: #fff; margin: 6px 0 20px; }
.regno strong { font: 800 1.6rem "Plus Jakarta Sans", Inter, sans-serif; letter-spacing: .06em; }
.regno-label, .regno small { font-size: .84rem; opacity: .9; }
.regno .copy { height: 34px; padding: 0 14px; font-size: .85rem; background: rgba(255, 255, 255, .15); border-color: rgba(255, 255, 255, .4); color: #fff !important; }
.next-steps { list-style: none; padding: 0; margin: 0 0 22px; display: grid; gap: 10px; text-align: left; }
.next-steps li { display: flex; gap: 14px; align-items: flex-start; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line); }
.next-steps li > i { width: 36px; height: 36px; flex: 0 0 36px; border-radius: 10px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); }
.next-steps li.is-now { border-color: var(--brand); }
.next-steps li.is-warn > i { background: #fffaeb; color: var(--warn); }
.next-steps div { display: flex; flex-direction: column; }
.next-steps span { color: var(--muted); font-size: .9rem; }

/* dialogs */
.dlg { width: min(720px, calc(100vw - 32px)); max-height: min(80vh, 760px); padding: 0; border: 1px solid var(--line); border-radius: 18px; background: var(--card); color: var(--ink); box-shadow: var(--shadow); }
.dlg[open] { display: flex; flex-direction: column; animation: rise .3s var(--ease); }
.dlg::backdrop { background: rgba(15, 23, 42, .55); backdrop-filter: blur(2px); }
.dlg-head, .dlg-foot { display: flex; justify-content: space-between; align-items: center; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.dlg-foot { border-top: 1px solid var(--line); border-bottom: 0; justify-content: flex-end; }
.dlg-head h2 { margin: 0; font: 800 1.2rem "Plus Jakarta Sans", Inter, sans-serif; }
.dlg-x { background: none; border: 0; font-size: 1.6rem; line-height: 1; color: var(--muted); cursor: pointer; width: 36px; height: 36px; border-radius: 10px; }
.dlg-x:hover { background: var(--line); color: var(--ink); }
.dlg-body { padding: 16px 20px; overflow: auto; font-size: .94rem; }

/* ---------- tablet and phone */
@media (max-width: 1023px) {
    .p4ax .shell { grid-template-columns: 1fr; }
    .p4ax .story-main { margin-top: 0; }
    .rail, .perks, .p4ax .stats { display: none; }
    .mini-progress { display: block; }
    .step-kicker { display: none; }
    .card-wide { max-width: 640px; }
}
@media (max-width: 600px) {
    .grid-2, .review, .rules, .guardian .row, .socials-top { grid-template-columns: 1fr; }
    .nav { flex-direction: column-reverse; }
    .nav .primary { flex: none; }
    .ghost { width: 100%; }
    .drop { flex-direction: column; text-align: center; }
}
.suggest[hidden] { display: none; }
