/* SparkX team registration page (register.html). Tokens and base styles come from sparkx.css. */
.reg-page { background: var(--soft); }
.reg-page [hidden] { display: none !important; }
.reg-back { color: var(--ink); font: 700 15px/1.2 var(--font-head); text-decoration: none; white-space: nowrap; }
.reg-back-arrow { display: inline-block; transition: transform .2s; }
.reg-back:hover .reg-back-arrow { transform: translateX(-4px); }

/* Entrance */
.reg-rise { animation: reg-rise .7s cubic-bezier(.2, .7, .2, 1) var(--d, 0s) backwards; }
@keyframes reg-rise { from { opacity: 0; transform: translateY(18px); } }

/* ---------- Hero band ---------- */
.reg-hero { position: relative; isolation: isolate; overflow: hidden; padding: clamp(36px, 5vw, 60px) 16px clamp(96px, 10vw, 128px); background: #262A6E; color: #fff; text-align: center; }
.reg-hero::after { content: ""; position: absolute; inset: 0; z-index: -2; background: linear-gradient(180deg, rgba(38, 42, 110, .86), rgba(20, 23, 74, .97)); }
.reg-hero-bg { position: absolute; inset: 0; z-index: -3; width: 100%; height: 100%; object-fit: cover; object-position: 50% 35%; filter: grayscale(1); }
.reg-glow { position: absolute; z-index: -1; width: 420px; height: 420px; border-radius: 50%; filter: blur(70px); opacity: .34; animation: reg-drift 11s ease-in-out infinite alternate; }
.reg-glow-a { top: -180px; left: 8%; background: var(--teal); }
.reg-glow-b { bottom: -220px; right: 8%; background: var(--coral); animation-delay: -5s; }
@keyframes reg-drift { to { transform: translate3d(70px, 36px, 0) scale(1.15); } }
.reg-hero-inner { max-width: 720px; margin: 0 auto; }
.reg-hero-logo { width: min(280px, 62vw); height: auto; margin: 0 auto 18px; }
.reg-hero h1 { margin: 0; color: #fff; font: 900 clamp(34px, 5vw, 52px)/1.1 var(--font-head); letter-spacing: -.02em; }
.reg-hero-lede { margin: 14px auto 0; max-width: 600px; color: #E3E5F8; font: 400 clamp(16px, 1.6vw, 18px)/1.6 var(--font-body); text-wrap: pretty; }
.reg-facts { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 20px 0 0; padding: 0; list-style: none; }
.reg-facts li { padding: 7px 14px; border: 1px solid rgba(255, 255, 255, .24); border-radius: 999px; background: rgba(255, 255, 255, .08); color: #fff; font: 700 13.5px/1.2 var(--font-head); }

/* ---------- Layout ---------- */
.reg-layout { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 304px; gap: 24px; align-items: start; max-width: 1040px; margin: -68px auto 0; padding: 0 16px clamp(48px, 7vw, 80px); }
.reg-form { min-width: 0; }
.reg-layout.is-done { display: block; max-width: 640px; }

/* ---------- Team panel ---------- */
.reg-panel { position: sticky; top: calc(var(--header-h) + 16px); padding: 20px; border: 1px solid var(--line); border-radius: 20px; background: #fff; box-shadow: 0 22px 50px -28px rgba(11, 13, 46, .4); }
.reg-panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.reg-panel-head h2 { min-width: 0; margin: 0; color: var(--ink); font: 800 18px/1.25 var(--font-head); overflow-wrap: anywhere; }
.reg-panel-size { color: var(--teal-ink); font: 700 13px/1.2 var(--font-head); white-space: nowrap; }
.reg-slots { display: grid; gap: 6px; }
.reg-slot { display: flex; align-items: center; gap: 11px; width: 100%; padding: 8px; border: 1px solid transparent; border-radius: 12px; background: none; color: var(--ink); text-align: left; cursor: pointer; transition: background-color .2s, border-color .2s; }
.reg-slot:hover { background: var(--soft); }
.reg-slot.is-open { border-color: #BDE7DF; background: #F0FAF8; }
.reg-slot-av { position: relative; flex: none; display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 50%; background: #E8EAF3; color: var(--muted); font: 800 13px/1 var(--font-head); transition: background-color .3s, color .3s; }
.reg-slot.has-member .reg-slot-av { background: #262A6E; color: #fff; }
.reg-slot.is-ok .reg-slot-av { background: var(--teal-ink); color: #fff; animation: reg-pop .45s cubic-bezier(.3, 1.6, .5, 1); }
.reg-slot.is-empty .reg-slot-av { border: 1.5px dashed #B9BFD3; background: none; }
.reg-slot-text { min-width: 0; }
.reg-slot-name { display: block; overflow: hidden; font: 700 14.5px/1.3 var(--font-head); white-space: nowrap; text-overflow: ellipsis; }
.reg-slot.is-empty .reg-slot-name { color: var(--muted); font-weight: 600; }
.reg-slot-state { display: block; color: var(--muted); font: 400 13px/1.3 var(--font-body); }
.reg-slot.is-ok .reg-slot-state { color: var(--teal-ink); font-weight: 700; }
@keyframes reg-pop { 0% { transform: scale(.7); } 60% { transform: scale(1.14); } 100% { transform: none; } }
.reg-panel-sub { margin: 12px 0 0; color: var(--muted); font: 400 13.5px/1.4 var(--font-body); }
.reg-meter { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.reg-meter-top { display: flex; justify-content: space-between; margin-bottom: 7px; color: var(--text); font: 600 13.5px/1.2 var(--font-head); }
.reg-meter-top strong { color: var(--ink); font-weight: 800; }
.reg-meter-track { overflow: hidden; height: 8px; border-radius: 4px; background: #E8EAF3; }
.reg-meter-track span { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--teal), var(--cyan)); transform: scaleX(0); transform-origin: left; transition: transform .5s cubic-bezier(.2, .7, .2, 1); }

/* ---------- Member card ---------- */
.reg-team { margin-bottom: 14px; padding: clamp(16px, 3vw, 22px); border: 1px solid var(--line); border-radius: 20px; background: #fff; box-shadow: 0 22px 50px -28px rgba(11, 13, 46, .4); }
.reg-team label { font-size: 16px; font-weight: 800; }
.reg-members { display: grid; gap: 14px; }
.reg-card { overflow: hidden; border: 1px solid var(--line); border-radius: 20px; background: #fff; box-shadow: 0 22px 50px -28px rgba(11, 13, 46, .4); scroll-margin-top: calc(var(--header-h) + 16px); transition: height .3s ease, opacity .3s ease, margin .3s ease, border-color .25s; }
.reg-card.is-new { animation: reg-card-in .5s cubic-bezier(.2, .7, .2, 1); }
@keyframes reg-card-in { from { opacity: 0; transform: translateY(16px) scale(.98); } }
.reg-card.is-leaving { opacity: 0; }
.reg-card-h { margin: 0; }
.reg-card-toggle { display: flex; align-items: center; gap: 12px; width: 100%; padding: 16px clamp(16px, 3vw, 22px); border: 0; background: none; color: var(--ink); text-align: left; cursor: pointer; }
.reg-card-num { flex: none; display: flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 50%; background: #262A6E; color: #fff; font: 800 14px/1 var(--font-head); transition: background-color .3s; }
.reg-card.is-ok .reg-card-num { background: var(--teal-ink); }
.reg-card-titles { flex: 1; min-width: 0; }
.reg-card-title { display: block; font: 800 18px/1.25 var(--font-head); }
.reg-card-sub { display: block; overflow: hidden; color: var(--muted); font: 400 14px/1.3 var(--font-body); white-space: nowrap; text-overflow: ellipsis; }
.reg-chip { flex: none; padding: 4px 10px; border-radius: 999px; background: #F0F1F7; color: var(--muted); font: 700 12.5px/1.3 var(--font-head); transition: background-color .25s, color .25s; }
.reg-card.is-ok .reg-chip { background: #DFF6F2; color: var(--teal-ink); }
.reg-chev { flex: none; width: 20px; height: 20px; color: var(--muted); transition: transform .3s; }
.reg-card.is-collapsed .reg-chev { transform: rotate(-90deg); }
.reg-card-body { display: grid; grid-template-rows: 1fr; transition: grid-template-rows .35s cubic-bezier(.2, .7, .2, 1); }
.reg-card.is-collapsed .reg-card-body { grid-template-rows: 0fr; }
.reg-card-inner { overflow: hidden; min-height: 0; }
.reg-card-pad { padding: 2px clamp(16px, 3vw, 22px) clamp(18px, 3vw, 24px); }

.reg-step { display: flex; align-items: center; gap: 9px; margin: 0 0 12px; color: var(--ink); font: 800 15px/1.3 var(--font-head); }
.reg-step-n { flex: none; display: flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%; background: #DFF6F2; color: var(--teal-ink); font: 800 12.5px/1 var(--font-head); }
.reg-block + .reg-block { margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--line); }

/* Verify box */
.reg-verify { padding: 14px; border: 1.5px dashed #8FD8CC; border-radius: 14px; background: #F0FAF8; transition: border-color .3s, background-color .3s; }
.reg-verify.is-ok { border-style: solid; border-color: var(--teal); background: #E8F9F5; }
.reg-verify.is-bad { border-color: var(--coral-600); background: #FFF5F6; }
.reg-verify-row { display: grid; grid-template-columns: 1fr 1fr auto; gap: 10px; align-items: start; }
.reg-verify-btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-width: 112px; min-height: 46px; margin-top: 25px; padding: 0 16px; border: 0; border-radius: 11px; background: var(--teal-ink); color: #fff; font: 800 15px/1.2 var(--font-head); cursor: pointer; transition: background-color .2s, transform .15s; }
.reg-verify-btn:hover { background: #066B5E; }
.reg-verify-btn:active { transform: scale(.97); }
.reg-verify-btn:disabled { opacity: .8; cursor: wait; }
.reg-verify-btn .reg-spinner { display: none; }
.reg-verify-btn.is-busy svg { display: none; }
.reg-verify-btn.is-busy .reg-spinner { display: block; }
.reg-verify-btn.is-ok path:last-child { stroke-dasharray: 12; animation: reg-draw .4s ease; }
.reg-verify-msg { margin: 10px 0 0; font: 400 14px/1.45 var(--font-body); animation: reg-msg-in .3s ease; }
.reg-verify-msg.ok { color: var(--teal-ink); font-weight: 700; }
.reg-verify-msg.bad { color: var(--coral-600); font-weight: 700; }
@keyframes reg-msg-in { from { opacity: 0; transform: translateY(-5px); } }
@keyframes reg-draw { from { stroke-dashoffset: 12; } to { stroke-dashoffset: 0; } }
.reg-spinner { display: none; width: 18px; height: 18px; border: 2.5px solid rgba(255, 255, 255, .4); border-top-color: #fff; border-radius: 50%; animation: reg-spin .7s linear infinite; }
@keyframes reg-spin { to { transform: rotate(360deg); } }

/* Fields */
.reg-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.reg-grid-3 { grid-template-columns: 2fr 1fr 1fr; }
.reg-field { min-width: 0; }
.reg-field-wide { grid-column: 1 / -1; }
.reg-field label { display: block; margin-bottom: 6px; color: var(--ink); font: 700 14px/1.25 var(--font-head); transition: color .2s; }
.reg-field:focus-within label { color: var(--teal-ink); }
.reg-req { color: var(--coral-600); }
.reg-field input, .reg-field select, .reg-field textarea { display: block; width: 100%; min-height: 46px; padding: 10px 13px; border: 1.5px solid #D5D9E5; border-radius: 11px; background-color: #fff; color: var(--ink); font: 400 16px/1.35 var(--font-body); transition: border-color .2s, box-shadow .2s; }
.reg-field input::placeholder, .reg-field textarea::placeholder { color: #8589A6; opacity: 1; }
.reg-field input:hover, .reg-field select:hover, .reg-field textarea:hover { border-color: #AEB4CA; }
.reg-field input:focus, .reg-field select:focus, .reg-field textarea:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 4px rgba(14, 185, 162, .16); }
.reg-field select { appearance: none; -webkit-appearance: none; padding-right: 38px; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5 7.5l5 5 5-5' fill='none' stroke='%2364688A' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") right 12px center / 18px no-repeat; cursor: pointer; }
.reg-field textarea { min-height: 76px; resize: vertical; }
.reg-field.is-valid input, .reg-field.is-valid textarea { padding-right: 38px; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M4.5 10.5l3.5 3.5 7.5-8' fill='none' stroke='%2308806F' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") right 12px top 13px / 18px no-repeat; }
.reg-field.is-bad input, .reg-field.is-bad textarea { border-color: var(--coral-600); animation: reg-shake .35s; }
.reg-field.is-bad input:focus, .reg-field.is-bad textarea:focus { box-shadow: 0 0 0 4px rgba(212, 43, 67, .14); }
@keyframes reg-shake { 25% { transform: translateX(-5px); } 50% { transform: translateX(4px); } 75% { transform: translateX(-2px); } }
.reg-err { margin: 6px 0 0; color: var(--coral-600); font: 700 13.5px/1.35 var(--font-body); animation: reg-msg-in .25s ease; }

.reg-remove { display: inline-flex; margin-top: 16px; padding: 6px 0; border: 0; background: none; color: var(--coral-600); font: 700 14.5px/1.2 var(--font-head); cursor: pointer; }
.reg-remove:hover { text-decoration: underline; text-underline-offset: 3px; }

/* Add member */
.reg-add { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 66px; margin-top: 14px; border: 1.5px dashed #8FD8CC; border-radius: 18px; background: transparent; color: var(--teal-ink); font: 800 16px/1.2 var(--font-head); cursor: pointer; transition: background-color .2s, border-color .2s; }
.reg-add:hover { border-color: var(--teal); background: #F0FAF8; }
.reg-add small { color: var(--muted); font: 600 13.5px/1 var(--font-head); }
.reg-add-icon { position: relative; width: 30px; height: 30px; border-radius: 50%; background: var(--teal-ink); transition: transform .35s cubic-bezier(.3, 1.6, .5, 1); }
.reg-add-icon::before, .reg-add-icon::after { content: ""; position: absolute; top: 50%; left: 50%; width: 14px; height: 2.5px; border-radius: 2px; background: #fff; transform: translate(-50%, -50%); }
.reg-add-icon::after { transform: translate(-50%, -50%) rotate(90deg); }
.reg-add:hover .reg-add-icon { transform: rotate(90deg) scale(1.08); }

/* Consents */
.reg-consents { margin-top: 26px; }
.reg-consents h2 { margin: 0 0 12px; color: var(--ink); font: 800 18px/1.25 var(--font-head); }
.reg-check { display: grid; grid-template-columns: 22px 1fr; gap: 0 12px; margin-bottom: 10px; padding: 14px; border: 1.5px solid var(--line); border-radius: 14px; background: #fff; color: var(--text); font: 400 15px/1.55 var(--font-body); transition: border-color .25s, background-color .25s; }
.reg-check:has(input:checked) { border-color: var(--teal); background: #F0FAF8; }
.reg-check label { cursor: pointer; }
.reg-check input { appearance: none; -webkit-appearance: none; width: 22px; height: 22px; margin: 1px 0 0; border: 2px solid var(--teal-ink); border-radius: 50%; background: #fff; cursor: pointer; transition: background-color .2s; }
.reg-check input:checked { background: var(--teal-ink) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 8.5l3 3 6-7' fill='none' stroke='%23fff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 15px no-repeat; animation: reg-pop .35s cubic-bezier(.3, 1.6, .5, 1); }
.reg-check input[aria-invalid="true"] { border-color: var(--coral-600); }
.reg-check .reg-err { grid-column: 2; }
.reg-terms-link { display: inline; padding: 0; border: 0; background: none; color: var(--teal-ink); font: 800 15px/1.3 var(--font-head); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

.reg-form-msg { margin: 6px 0 12px; padding: 13px 16px; border-radius: 12px; background: #FDECEE; color: #8E1B2D; font: 600 14.5px/1.5 var(--font-body); animation: reg-msg-in .3s ease; }

/* Submit */
.reg-submit { position: relative; overflow: hidden; display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 58px; margin-top: 6px; border: 0; border-radius: 14px; background: var(--yellow); color: var(--ink); font: 800 17px/1.2 var(--font-head); cursor: pointer; box-shadow: 0 14px 28px -14px rgba(180, 125, 20, .8); transition: transform .2s, box-shadow .2s, background-color .2s; }
.reg-submit::before { content: ""; position: absolute; top: 0; bottom: 0; left: -40%; width: 30%; background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .55), transparent); transform: skewX(-18deg); transition: left .7s ease; }
.reg-submit:hover { background: #F7B92D; transform: translateY(-2px); box-shadow: 0 20px 34px -14px rgba(180, 125, 20, .9); }
.reg-submit:hover::before { left: 115%; }
.reg-submit:active { transform: none; }
.reg-submit-plane { transition: transform .25s; }
.reg-submit:hover .reg-submit-plane { transform: translate(4px, -4px); }
.reg-submit .reg-spinner { border-color: rgba(11, 13, 46, .25); border-top-color: var(--ink); }
.reg-submit:disabled { cursor: wait; }
.reg-submit:disabled .reg-submit-plane { display: none; }
.reg-submit:disabled .reg-spinner { display: block; }
.reg-foot { margin: 14px 0 0; color: var(--muted); font: 400 14px/1.45 var(--font-body); text-align: center; }

/* Success */
.reg-done { position: relative; overflow: hidden; padding: clamp(32px, 6vw, 52px) clamp(20px, 5vw, 44px); border: 1px solid var(--line); border-radius: 24px; background: #fff; box-shadow: 0 22px 50px -28px rgba(11, 13, 46, .4); text-align: center; animation: reg-card-in .5s cubic-bezier(.2, .7, .2, 1); }
.reg-done:focus { outline: none; }
.reg-done h2 { margin: 16px 0 10px; color: var(--ink); font: 900 30px/1.2 var(--font-head); }
.reg-done p { margin: 0 0 8px; color: var(--text); font: 400 16px/1.55 var(--font-body); }
.reg-done a[data-email] { color: var(--teal-ink); font-weight: 700; }
.reg-done .reg-back { display: inline-block; margin-top: 14px; }
.reg-done-check { display: block; margin: 0 auto; }
.reg-done-check circle { fill: var(--teal-ink); transform-origin: center; animation: reg-pop .5s cubic-bezier(.3, 1.6, .5, 1); }
.reg-done-check path { fill: none; stroke: #fff; stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 44; animation: reg-tick .45s ease .25s backwards; }
@keyframes reg-tick { from { stroke-dashoffset: 44; } to { stroke-dashoffset: 0; } }
.reg-confetti { position: absolute; inset: 0; pointer-events: none; }
.reg-confetti span { position: absolute; top: 96px; left: 50%; width: 8px; height: 12px; border-radius: 2px; opacity: 0; animation: reg-burst 1.3s cubic-bezier(.15, .7, .3, 1) var(--cd) forwards; }
@keyframes reg-burst { 0% { opacity: 1; transform: translate(0, 0) rotate(0); } 100% { opacity: 0; transform: translate(var(--cx), var(--cy)) rotate(var(--cr)); } }

/* Terms dialog */
.reg-terms { width: min(620px, calc(100vw - 32px)); max-height: min(82vh, 740px); padding: 0; border: 0; border-radius: 20px; color: var(--text); box-shadow: 0 30px 80px rgba(11, 13, 46, .35); }
.reg-terms[open] { display: flex; flex-direction: column; animation: reg-dialog-in .28s cubic-bezier(.2, .7, .2, 1); }
.reg-terms[open]::backdrop { background: rgba(7, 10, 36, .62); animation: reg-fade .28s ease; }
@keyframes reg-dialog-in { from { opacity: 0; transform: translateY(14px) scale(.97); } }
@keyframes reg-fade { from { opacity: 0; } }
.reg-terms-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 22px; border-bottom: 1px solid var(--line); }
.reg-terms-head h2 { margin: 0; color: var(--ink); font: 800 21px/1.2 var(--font-head); }
.reg-terms-x { width: 40px; height: 40px; border: 0; border-radius: 10px; background: var(--soft); color: var(--ink); font-size: 22px; line-height: 1; cursor: pointer; transition: background-color .2s; }
.reg-terms-x:hover { background: var(--line); }
.reg-terms-body { overflow-y: auto; padding: 18px 22px; font: 400 15.5px/1.6 var(--font-body); }
.reg-terms-draft { margin: 0 0 14px; padding: 10px 13px; border-radius: 10px; background: #FFF8E6; color: #5F4708; font-size: 14px; }
.reg-terms-body ol { margin: 0; padding-left: 22px; }
.reg-terms-body li { margin-bottom: 10px; }
.reg-terms-body strong { color: var(--ink); font-family: var(--font-head); }
.reg-terms-actions { display: flex; justify-content: flex-end; padding: 12px 22px; border-top: 1px solid var(--line); }

.reg-footer { padding: 22px 16px 30px; border-top: 1px solid var(--line); background: #fff; color: var(--muted); font: 400 14px/1.5 var(--font-body); text-align: center; }
.reg-footer p { margin: 0 0 4px; }
.reg-footer a { color: var(--teal-ink); font-weight: 700; }

@media (max-width: 900px) {
  .reg-layout { grid-template-columns: minmax(0, 1fr); max-width: 680px; gap: 14px; }
  .reg-panel { position: static; order: -1; padding: 16px; }
  .reg-slots { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; }
  .reg-slot { flex-direction: column; gap: 5px; padding: 8px 2px; text-align: center; }
  .reg-slot-text { width: 100%; }
  .reg-slot-name { font-size: 13px; }
  .reg-slot.is-empty .reg-slot-name { line-height: 1.2; white-space: normal; }
  .reg-slot-state { display: none; }
}
@media (max-width: 560px) {
  .reg-grid, .reg-grid-3 { grid-template-columns: minmax(0, 1fr); }
  .reg-verify-row { grid-template-columns: minmax(0, 1fr); }
  .reg-verify-btn { width: 100%; margin-top: 0; }
  .reg-chip { display: none; }
  .reg-facts li { font-size: 13px; }
}
@media (prefers-reduced-motion: reduce) {
  .reg-rise, .reg-glow, .reg-card.is-new, .reg-done, .reg-done-check circle, .reg-done-check path, .reg-field.is-bad input, .reg-field.is-bad textarea, .reg-slot.is-ok .reg-slot-av, .reg-check input:checked, .reg-terms[open], .reg-terms[open]::backdrop { animation: none; }
  .reg-confetti { display: none; }
  .reg-card, .reg-card-body, .reg-meter-track span, .reg-submit, .reg-submit::before { transition: none; }
}
