/* ============================================================================
   Labocine — SIGNUP, revamped 2026-07 in the homepage's cinematic black-OTT
   design language. Scoped under `.sx` (the page renders on the bare
   falconLayout, so these rules also override Bootstrap defaults). The left
   brand panel reuses the homepage's generative Three.js particle field
   (/assets/js/home-hero.js on #hx-canvas) with the CSS aurora as fallback.
   The signup FLOW (fields, ids, steps, Stripe, analytics) is untouched —
   only the shell around it is new.
   ============================================================================ */

.sx {
    --sx-bg: #07070a;
    --sx-surface: #131318;
    --sx-surface-2: #1b1b22;
    --sx-surface-3: #26262e;
    --sx-border: rgba(255, 255, 255, 0.1);
    --sx-border-strong: rgba(255, 255, 255, 0.2);
    --sx-text: #f3f3f5;
    --sx-muted: #b9b9c4;
    --sx-muted-2: #8b8b96;
    --sx-red: #f40000;
    --sx-red-hover: #ff2b2b;
    --sx-green: #34e08a;
    --sx-radius: 16px;
    --sx-radius-sm: 11px;

    min-height: 100vh;
    background: var(--sx-bg);
    color: var(--sx-text);
    font-family: "Roboto", "Helvetica Neue", Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    /* NO overflow on .sx — any overflow here creates a clip context that
       silently disables position:sticky for the field backdrop AND the form
       column. Horizontal clipping lives on body.sx-page instead (propagates
       to the viewport, where sticky still works). */

    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(460px, 640px);
    grid-template-areas: "left form";
    align-items: start;
}
.sx__left { grid-area: left; position: relative; }

/* NO overflow-x:hidden anywhere on html/body/.sx — it kills position:sticky
   for the field backdrop and the form column (verified empirically). The grid
   uses minmax(0,…) columns so nothing overflows horizontally by construction. */
html.sx-page, body.sx-page { background: #07070a !important; margin: 0; padding: 0; }
.sx *, .sx *::before, .sx *::after { box-sizing: border-box; }
.sx a { color: inherit; text-decoration: none; }
.sx h1, .sx h2, .sx h3, .sx h4, .sx strong { color: inherit; }

/* ============================================================ LEFT COLUMN
   The particle field is a STICKY full-viewport backdrop: it pins to the
   screen while the brand copy and the info sections scroll over it — the
   3D rides along with the user instead of being left behind. */
.sx__left-bg {
    position: sticky; top: 0; height: 100vh; margin-bottom: -100vh;
    overflow: hidden; pointer-events: none; z-index: 0;
}
.sx__left-scrim {
    position: absolute; inset: 0;
    background:
        radial-gradient(58% 42% at 32% 20%, rgba(7, 7, 10, 0.82), rgba(7, 7, 10, 0.32) 58%, transparent 80%),
        linear-gradient(180deg, transparent 78%, rgba(7, 7, 10, 0.65));
}
.sx__brand {
    position: relative; z-index: 2;
    padding: 44px 56px 10px;
    display: flex; flex-direction: column;
}
.sx__aurora {
    position: absolute; inset: -12%;
    background:
        radial-gradient(38% 46% at 24% 34%, rgba(244, 0, 0, 0.16), transparent 70%),
        radial-gradient(30% 42% at 76% 26%, rgba(90, 96, 112, 0.24), transparent 70%),
        radial-gradient(46% 52% at 60% 78%, rgba(52, 224, 138, 0.07), transparent 72%);
    filter: blur(30px);
    animation: sx-aurora 26s ease-in-out infinite alternate;
}
@keyframes sx-aurora {
    from { transform: translate3d(-1.5%, -1%, 0) scale(1); }
    to { transform: translate3d(1.5%, 1.5%, 0) scale(1.06); }
}
#hx-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; opacity: 0; transition: opacity 1.6s ease 0.2s; }
html.hx-webgl #hx-canvas { opacity: 1; }

.sx__logo img { width: 168px; height: auto; display: block; }

.sx__title {
    margin: 24px 0 0; font-weight: 900; text-transform: uppercase;
    font-size: clamp(2.2rem, 4.4vw, 3.8rem); line-height: 1.04; letter-spacing: -0.015em; color: #fff;
    text-shadow: 0 2px 30px rgba(0, 0, 0, 0.85);
}
.sx__title .sx-w { display: inline-block; opacity: 0; transform: translateY(0.55em) rotate(1.5deg); animation: sx-word 0.9s cubic-bezier(0.2, 0.75, 0.2, 1) forwards; }
.sx__title .sx-w:nth-child(1) { animation-delay: 0.1s; }
.sx__title .sx-w:nth-child(2) { animation-delay: 0.22s; color: var(--sx-red); text-shadow: 0 0 38px rgba(244, 0, 0, 0.4); }
@keyframes sx-word { to { opacity: 1; transform: none; } }

.sx__subs { margin-top: 14px; opacity: 0; animation: sx-fade 0.9s ease 0.5s forwards; }
@keyframes sx-fade { to { opacity: 1; } }
.sx__subs .subtitle { margin: 0 0 9px; font-size: clamp(0.98rem, 1.4vw, 1.1rem); line-height: 1.6; color: var(--sx-muted); }
.sx__subs .subtitle strong { color: #fff; }
.sx__subs .subtitle a { color: #fff; border-bottom: 1px solid rgba(244, 0, 0, 0.65); transition: color 0.2s ease, border-color 0.2s ease; }
.sx__subs .subtitle a:hover { color: var(--sx-red-hover); border-color: var(--sx-red-hover); }

/* the six membership perks — checkmark grid */
.sx .feature-box {
    margin: 20px 0 0; padding: 20px 24px;
    background: rgba(19, 19, 24, 0.6);
    border: 1px solid var(--sx-border); border-radius: var(--sx-radius);
    -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
    opacity: 0; animation: sx-fade 0.9s ease 0.7s forwards;
}
.sx .feature-box-header { display: none; }
.sx .feature-list {
    list-style: none; margin: 0; padding: 0;
    display: grid; grid-template-columns: 1fr 1fr; gap: 12px 22px;
}
.sx .feature-list li {
    position: relative; padding-left: 26px;
    font-size: 0.9rem; color: var(--sx-muted); line-height: 1.45;
}
.sx .feature-list li::before {
    content: ""; position: absolute; left: 0; top: 3px; width: 15px; height: 8px;
    border-left: 2px solid var(--sx-green); border-bottom: 2px solid var(--sx-green);
    transform: rotate(-45deg);
}

/* ============================================================ INFO PANEL */
.sx__info { position: relative; z-index: 2; padding: 16px 56px 44px; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.sx .info-box { grid-column: 1 / -1; }
/* INQUIRY + SUBMISSION share one row */
.sx .info-box:nth-child(3) { grid-column: 1; }
.sx .info-box:nth-child(4) { grid-column: 2; }
.sx .info-box {
    padding: 22px 24px; border-radius: var(--sx-radius-sm);
    background: rgba(19, 19, 24, 0.72); border: 1px solid var(--sx-border);
    -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
    transition: border-color 0.25s ease, transform 0.25s ease;
}
/* assemble as they enter the viewport (html.sx-anim is set by JS only) */
html.sx-anim .sx__info .info-box { opacity: 0; transform: translateY(26px); transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1); }
html.sx-anim .sx__info .info-box.is-in { opacity: 1; transform: none; }
.sx .info-box:hover { border-color: var(--sx-border-strong); transform: translateY(-2px); }
.sx .info-box h3 {
    margin: 0 0 10px; font-size: 0.78rem; font-weight: 800;
    letter-spacing: 0.22em; text-transform: uppercase; color: var(--sx-red-hover);
}
.sx .info-box h3 em { color: var(--sx-muted-2); text-transform: none; letter-spacing: 0; font-style: normal; }
.sx .info-box p { margin: 0 0 10px; font-size: 0.88rem; line-height: 1.65; color: var(--sx-muted); }
.sx .info-box p:last-child { margin-bottom: 0; }
.sx .info-box a { color: #fff; border-bottom: 1px solid rgba(244, 0, 0, 0.55); transition: color 0.2s ease; }
.sx .info-box a:hover { color: var(--sx-red-hover); }

/* ============================================================ FORM PANEL */
.sx__form {
    grid-area: form;
    position: sticky; top: 0;
    min-height: 100vh;
    display: flex; align-items: flex-start; justify-content: center;
    padding: 44px 44px 60px;
    background: linear-gradient(180deg, rgba(19, 19, 24, 0.55), rgba(13, 13, 16, 0.85));
    border-left: 1px solid var(--sx-border);
    -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
    overflow-y: auto; max-height: 100vh;
}
.sx__form-inner { width: 100%; max-width: 460px; }
.sx #form__section { animation: sx-rise 0.7s cubic-bezier(0.16, 0.84, 0.3, 1) 0.15s both; }
@keyframes sx-rise { from { opacity: 0; transform: translateY(26px); } }

.sx #form__section h2 {
    margin: 4px 0 22px; text-align: center;
    font-size: 1.42rem; font-weight: 900; letter-spacing: 0.02em; color: #fff;
}

/* step progress */
.sx .step-indicator { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 26px; }
.sx .step-dot {
    width: 34px; height: 5px; border-radius: 4px;
    background: var(--sx-surface-3); transition: background 0.3s ease, width 0.3s ease;
}
.sx .step-dot.active { width: 52px; background: var(--sx-red); box-shadow: 0 0 14px -2px rgba(244, 0, 0, 0.7); }
.sx .step-dot.done { background: rgba(244, 0, 0, 0.45); }

/* labels + inputs (beat Bootstrap) */
.sx label { display: block; margin: 14px 0 7px; font-size: 0.8rem; font-weight: 600; letter-spacing: 0.04em; color: var(--sx-muted); }
.sx .form__input {
    display: block; width: 100%; height: 50px; padding: 0 16px;
    background: rgba(255, 255, 255, 0.045); color: var(--sx-text);
    border: 1px solid var(--sx-border-strong); border-radius: 12px;
    font-family: inherit; font-size: 0.96rem; outline: none;
    transition: border-color 0.22s ease, box-shadow 0.22s ease, background 0.22s ease;
    -webkit-appearance: none; appearance: none;
}
.sx select.form__input {
    background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%238b8b96' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 16px center;
}
.sx .form__input::placeholder { color: var(--sx-muted-2); }
.sx .form__input:focus {
    border-color: rgba(244, 0, 0, 0.75);
    box-shadow: 0 0 0 4px rgba(244, 0, 0, 0.13);
    background: rgba(255, 255, 255, 0.07);
}
.sx select.form__input option { background: #131318; color: #f3f3f5; }

/* primary + secondary buttons */
.sx .button {
    display: block; width: 100%; height: 52px; margin-top: 22px;
    border: 0; border-radius: 999px; cursor: pointer;
    background: var(--sx-red); color: #fff;
    font-family: inherit; font-size: 1rem; font-weight: 700; letter-spacing: 0.01em;
    box-shadow: 0 14px 34px -14px rgba(244, 0, 0, 0.65);
    transition: background 0.2s ease, transform 0.22s cubic-bezier(0.34, 1.4, 0.64, 1), box-shadow 0.25s ease, opacity 0.2s ease;
}
.sx .button:hover { background: var(--sx-red-hover); transform: translateY(-2px); box-shadow: 0 18px 42px -14px rgba(244, 0, 0, 0.8); }
.sx .button:active { transform: translateY(0) scale(0.98); }
.sx .button:disabled { opacity: 0.55; cursor: default; transform: none; }
.sx .button-outline {
    background: transparent; color: var(--sx-text);
    border: 1px solid var(--sx-border-strong); box-shadow: none;
}
.sx .button-outline:hover { background: rgba(255, 255, 255, 0.06); box-shadow: none; }
.sx .button-back {
    background: none; border: 0; padding: 0; margin: 0 0 6px; cursor: pointer;
    color: var(--sx-muted-2); font-family: inherit; font-size: 0.85rem;
    transition: color 0.2s ease;
}
.sx .button-back:hover { color: #fff; }

/* error + verify banner */
.sx .error-msg {
    margin: 0 0 14px; padding: 12px 16px; border-radius: 12px;
    background: rgba(244, 0, 0, 0.1); border: 1px solid rgba(244, 0, 0, 0.45);
    color: #ffb4b4; font-size: 0.88rem; line-height: 1.5;
}
.sx .error-msg p { margin: 0; }
.sx .verify-banner {
    position: relative; display: flex; gap: 10px; margin: 0 0 18px;
    padding: 14px 40px 14px 16px; border-radius: 12px;
    background: rgba(52, 224, 138, 0.09); border: 1px solid rgba(52, 224, 138, 0.4);
    color: #bfe9d4; font-size: 0.88rem; line-height: 1.55;
}
.sx .verify-banner strong { color: #fff; }
.sx .verify-banner-actions { margin-top: 8px; }
.sx .verify-banner-btn {
    border: 1px solid rgba(52, 224, 138, 0.5); background: transparent; color: var(--sx-green);
    border-radius: 999px; padding: 5px 14px; font-family: inherit; font-size: 0.8rem; font-weight: 600; cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}
.sx .verify-banner-btn:hover { background: var(--sx-green); color: #04231a; }
.sx .verify-banner-dismiss {
    position: absolute; top: 8px; right: 8px; border: 0; background: none; cursor: pointer;
    color: var(--sx-muted-2); font-size: 0.9rem; transition: color 0.2s ease;
}
.sx .verify-banner-dismiss:hover { color: #fff; }

/* divider + social auth */
.sx .divider {
    display: flex; align-items: center; gap: 14px; margin: 24px 0 16px;
    color: var(--sx-muted-2); font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase;
}
.sx .divider::before, .sx .divider::after { content: ""; flex: 1; height: 1px; background: var(--sx-border); }
.sx .social-btn {
    display: flex; align-items: center; justify-content: center; gap: 10px;
    height: 48px; margin-top: 10px; border-radius: 999px;
    background: rgba(255, 255, 255, 0.045); border: 1px solid var(--sx-border-strong);
    color: var(--sx-text); font-size: 0.92rem; font-weight: 600;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s cubic-bezier(0.34, 1.4, 0.64, 1);
}
.sx .social-btn:hover { background: rgba(255, 255, 255, 0.09); transform: translateY(-2px); }
.sx .social-btn svg { flex: none; }

.sx .auth-footer { margin-top: 20px; text-align: center; font-size: 0.9rem; color: var(--sx-muted); }
.sx .auth-footer a { color: #fff; border-bottom: 1px solid rgba(244, 0, 0, 0.55); }
.sx .auth-footer a:hover { color: var(--sx-red-hover); }
.sx .terms-text { margin-top: 14px; text-align: center; font-size: 0.75rem; color: var(--sx-muted-2); line-height: 1.5; }
.sx .terms-text a { color: var(--sx-muted); text-decoration: underline; text-underline-offset: 2px; }
.sx .terms-text a:hover { color: #fff; }

/* ============================================================ STEP 2 — PLANS */
.sx .interval-toggle { display: flex; align-items: center; justify-content: center; gap: 12px; margin-bottom: 20px; }
.sx .toggle-label { font-size: 0.88rem; font-weight: 600; color: var(--sx-muted-2); transition: color 0.2s ease; }
.sx .toggle-label.active { color: #fff; }
.sx .savings-tag {
    display: inline-block; margin-left: 6px; padding: 2px 8px; border-radius: 999px;
    background: rgba(52, 224, 138, 0.15); color: var(--sx-green);
    font-size: 0.68rem; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase;
}
.sx .toggle-switch { position: relative; display: inline-block; width: 46px; height: 26px; }
.sx .toggle-switch input { opacity: 0; width: 0; height: 0; }
.sx .toggle-slider {
    position: absolute; inset: 0; border-radius: 999px; cursor: pointer;
    background: var(--sx-surface-3); border: 1px solid var(--sx-border-strong);
    transition: background 0.25s ease;
}
.sx .toggle-slider::before {
    content: ""; position: absolute; left: 3px; top: 50%; width: 18px; height: 18px; margin-top: -9px;
    border-radius: 50%; background: #fff; transition: transform 0.25s cubic-bezier(0.34, 1.4, 0.64, 1);
}
.sx .toggle-switch input:checked + .toggle-slider { background: var(--sx-red); border-color: var(--sx-red); }
.sx .toggle-switch input:checked + .toggle-slider::before { transform: translateX(19px); }

.sx .plans-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.sx .plan-card {
    position: relative; padding: 20px 18px 16px; border-radius: var(--sx-radius);
    background: rgba(255, 255, 255, 0.035); border: 1px solid var(--sx-border-strong);
    cursor: pointer; text-align: left;
    transition: transform 0.24s cubic-bezier(0.2, 0.7, 0.2, 1), border-color 0.22s ease, box-shadow 0.28s ease, background 0.22s ease;
}
.sx .plan-card:hover { transform: translateY(-3px); border-color: rgba(255, 255, 255, 0.35); }
.sx .plan-card.featured {
    background: linear-gradient(180deg, rgba(244, 0, 0, 0.1), rgba(244, 0, 0, 0.03) 55%), rgba(255, 255, 255, 0.03);
    border-color: rgba(244, 0, 0, 0.65);
    box-shadow: 0 18px 44px -20px rgba(244, 0, 0, 0.45);
}
.sx .plan-card.featured:hover { border-color: var(--sx-red); }
.sx .plan-badge {
    position: absolute; top: -10px; right: 14px; padding: 3px 10px; border-radius: 999px;
    background: var(--sx-red); color: #fff; font-size: 0.64rem; font-weight: 800;
    letter-spacing: 0.12em; text-transform: uppercase;
}
.sx .plan-name { font-size: 0.8rem; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; color: var(--sx-muted); margin-bottom: 8px; }
.sx .plan-card.featured .plan-name { color: #fff; }
.sx .plan-price { display: flex; align-items: baseline; gap: 2px; color: #fff; margin-bottom: 12px; }
.sx .plan-price .currency { font-size: 0.95rem; font-weight: 700; color: var(--sx-muted); }
.sx .plan-price .amount { font-size: 2.1rem; font-weight: 900; line-height: 1; }
.sx .plan-price .period { font-size: 0.82rem; color: var(--sx-muted-2); margin-left: 3px; }
.sx .plan-features-mini { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; }
.sx .plan-features-mini li {
    position: relative; padding-left: 20px; font-size: 0.8rem; color: var(--sx-muted); line-height: 1.4;
}
.sx .plan-features-mini li::before {
    content: ""; position: absolute; left: 0; top: 4px; width: 11px; height: 6px;
    border-left: 2px solid var(--sx-green); border-bottom: 2px solid var(--sx-green); transform: rotate(-45deg);
}
.sx .compare-link { margin-top: 16px; text-align: center; font-size: 0.85rem; }
.sx .compare-link a { color: var(--sx-muted); border-bottom: 1px solid var(--sx-border-strong); transition: color 0.2s ease; }
.sx .compare-link a:hover { color: #fff; }

/* ============================================================ STEP 3 — PAYMENT */
.sx .card-element-wrap {
    padding: 15px 16px; border-radius: 12px;
    background: rgba(255, 255, 255, 0.045); border: 1px solid var(--sx-border-strong);
    transition: border-color 0.22s ease, box-shadow 0.22s ease;
}
.sx .card-element-wrap.focused { border-color: rgba(244, 0, 0, 0.75); box-shadow: 0 0 0 4px rgba(244, 0, 0, 0.13); }
.sx .card-error { min-height: 18px; margin-top: 8px; color: #ff8d8d; font-size: 0.82rem; }
.sx .spinner-wrap { margin-top: 16px; text-align: center; color: var(--sx-muted); font-size: 0.92rem; }
.sx .spinner-wrap span { display: block; margin-top: 4px; font-size: 0.78rem; color: var(--sx-muted-2); }
.sx .spinner-wrap::before {
    content: ""; display: block; width: 26px; height: 26px; margin: 0 auto 10px;
    border-radius: 50%; border: 3px solid rgba(244, 0, 0, 0.25); border-top-color: var(--sx-red);
    animation: sx-spin 0.8s linear infinite;
}
@keyframes sx-spin { to { transform: rotate(360deg); } }

/* ============================================================ RESPONSIVE */
@media (max-width: 1080px) {
    .sx {
        grid-template-columns: 1fr;
        grid-template-areas: "brand" "form" "info";
    }
    /* unwrap: brand/info become direct grid items so the form sits between them */
    .sx__left { display: contents; }
    .sx__left-bg { display: none; }   /* home-hero.js guards 0-size canvases */
    .sx__brand { grid-area: brand; min-height: 0; padding: 40px 26px 26px; justify-content: flex-start; }
    .sx__info { grid-area: info; }
    /* CSS aurora stands in for the field on small screens */
    .sx__brand::before {
        content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
        background:
            radial-gradient(60% 70% at 20% 20%, rgba(244, 0, 0, 0.14), transparent 70%),
            radial-gradient(50% 60% at 85% 70%, rgba(90, 96, 112, 0.16), transparent 70%);
        filter: blur(26px);
    }
    .sx__brand > * { position: relative; z-index: 1; }
    .sx__title { margin-top: 24px; }
    .sx .feature-box { display: none; }   /* perks live in the plan cards on mobile */
    .sx__form { position: static; min-height: 0; max-height: none; border-left: 0; border-top: 1px solid var(--sx-border); padding: 34px 22px 44px; overflow: visible; }
    .sx__info { padding: 10px 22px 50px; }
}
@media (max-width: 560px) {
    .sx__brand { padding: 30px 18px 20px; }
    .sx .info-box:nth-child(3), .sx .info-box:nth-child(4) { grid-column: 1 / -1; }
    .sx__form { padding: 28px 16px 40px; }
    .sx__info { padding: 8px 16px 44px; }
    .sx .plans-grid { grid-template-columns: 1fr; }
    .sx .feature-list { grid-template-columns: 1fr; }
}

/* ============================================================ REDUCED MOTION */
@media (prefers-reduced-motion: reduce) {
    .sx__aurora { animation: none; }
    .sx__title .sx-w { animation: sx-word 0.01s forwards; }
    .sx__subs, .sx .feature-box { animation: sx-fade 0.01s forwards; }
    .sx #form__section { animation: none; }
    .sx .spinner-wrap::before { animation: sx-spin 1.5s linear infinite; }
    .sx .button, .sx .plan-card, .sx .social-btn, .sx .info-box { transition: none; }
}
