/* ============================================================
   AUTH V3 — signup + login
   Ported from the shipday-signup-flow prototype's styles.css.
   Reference: docs/signup-flow-v2-design.md

   Self-contained on purpose: the V3 pages load ONLY this file, so the
   sd-avenir @font-face blocks are declared here rather than pulling in all
   of custom_fonts_colors.css. No Bootstrap / bootstrap-select /
   intl-tel-input / Handlebars / Google Fonts — the design's .btn-primary
   would collide with Bootstrap's, and none of them are needed.

   The prototype's post-signup setup-wizard styles are deliberately NOT here
   (/signup-info is out of scope and keeps signupUserInfo.css).
   ============================================================ */

/* ── Fonts (mirrors custom_fonts_colors.css) ───────────────── */
@font-face {
    font-family: 'sd-avenir';
    src: url(../../fonts/Avenir/300-Avenir-Light-07.woff) format('woff');
    font-weight: 300;
}
@font-face {
    font-family: 'sd-avenir';
    src: url(../../fonts/Avenir/400-AvenirLTStd-Book.woff) format('woff');
}
@font-face {
    font-family: 'sd-avenir';
    src: url(../../fonts/Avenir/500-AvenirLTStd-Roman.otf) format('woff');
    font-weight: 500;
}
@font-face {
    font-family: 'sd-avenir';
    src: url(../../fonts/Avenir/600-Avenir-Medium-09.woff) format('woff');
    font-weight: 600;
}
@font-face {
    font-family: 'sd-avenir';
    src: url(../../fonts/Avenir/700-Avenir-Heavy-05.woff) format('woff');
    font-weight: 700;
}
@font-face {
    font-family: 'sd-avenir';
    src: url(../../fonts/Avenir/800-AvenirLTStd-Black.woff) format('woff');
    font-weight: 800;
}


/* ── Design Tokens ────────────────────────────────────────── */
:root {
    /* Colors */
    --color-primary:          #008062;
    --color-primary-hover:    #006a52;
    --color-primary-light:    #ebfef6;
    /* Right-panel background. Intentionally a DIFFERENT green from
       --color-primary-light (which drives dropdown hover/selected states).
       Don't merge them. */
    --color-panel-bg:         #d7f5e9;
    --color-primary-ring:     rgba(0, 128, 98, 0.1);
    --color-accent:           #01ad85;
    --color-border-accent:    #0abf8c;

    --color-text:             #0a0a0a;
    --color-text-secondary:   #404040;
    --color-text-muted:       #525252;
    --color-text-placeholder: #737373;
    --color-text-disabled:    #a3a3a3;
    --color-text-label:       #262626;

    --color-border:           #e3e4eb;
    --color-border-otp:       #d4d4cf;
    --color-bg:               #ffffff;
    --color-bg-disabled:      #f4f4f8;
    --color-bg-hover:         #f4f4f8;

    --color-danger:           #dc2626;
    --color-danger-bg:        #fef2f2;

    /* Typography — Avenir is self-hosted in this repo, so no Nunito /
       Google Fonts fallback is needed (unlike the prototype). */
    --font-family: 'sd-avenir', 'Helvetica Neue', Helvetica, Arial, sans-serif;

    /* Radii */
    --radius-sm:   6px;
    --radius-md:   8px;
    --radius-lg:   10px;
    --radius-xl:   12px;
    --radius-full: 99px;

    /* Shadows / Rings */
    --ring-primary: 0 0 0 3px var(--color-primary-ring);
}


/* ============================================================
   RESET + BASE
   ============================================================ */
/* `.sd-auth-v3` itself is listed alongside its descendants on purpose: the
   class sits on <body>, and a descendant-only reset leaves the UA stylesheet's
   default `body { margin: 8px }` in place — which shows up as an 8px white gap
   between the green right panel and the viewport edge. That gap reads as a bug
   (see the note on .right-panel below). */
.sd-auth-v3,
.sd-auth-v3 *,
.sd-auth-v3 *::before,
.sd-auth-v3 *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body.sd-auth-v3 {
    background: var(--color-bg);
    min-height: 100vh;
    font-family: var(--font-family);
    -webkit-font-smoothing: antialiased;
}

.sd-auth-v3 button,
.sd-auth-v3 input {
    font-family: inherit;
}


/* ============================================================
   LAYOUT
   ============================================================ */
.main-content {
    display: flex;
    min-height: 100vh;
}

.left-panel {
    flex: 1 1 0%;
    min-width: 0;
    display: flex;
    flex-direction: column;
    background: var(--color-bg);
}


/* ── Header ── */
.reg-header {
    width: 100%;
    padding: 32px 40px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

/* The Shipday logo ships as two SVG halves in this repo
   (images/signup-info/logo-part-1.svg + logo-part-2.svg). */
.reg-header-logo {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.reg-header-logo img {
    height: 32px;
    width: auto;
    display: block;
}


/* ── Footer ── */
.reg-footer {
    width: 100%;
    max-width: 700px;
    padding: 0 40px 24px;
    flex-shrink: 0;
    text-align: center;
    align-self: center;
}

.reg-footer-text {
    font-size: 14px;
    color: var(--color-text-secondary);
    line-height: 1.4;
    font-weight: 500;
}

.reg-footer-text a {
    color: #03624C;
    text-decoration: none;
}

.reg-footer-text a:hover {
    text-decoration: underline;
}


/* ============================================================
   STEPS
   ============================================================ */
@keyframes stepFadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

.step {
    display: none;
    flex: 1;
    flex-direction: column;
}

.step.active {
    display: flex;
    animation: stepFadeIn 0.28s ease forwards;
}

@media (prefers-reduced-motion: reduce) {
    .step.active { animation: none; }
}


/* ============================================================
   FORM AREA
   ============================================================ */
.form-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px 40px;
    gap: 40px;
    background: var(--color-bg);
}

/* All direct children of form-area cap at 420px so inputs stay readable
   regardless of how wide the panel gets. */
.form-area > * {
    width: 100%;
    max-width: 420px;
}

/* Each auth step wraps its fields in a <form> to scope browser autofill /
   password-manager heuristics (every step lives in the same document). The
   form is then form-area's only direct child, so it has to replicate the
   exact flex/gap layout its contents used to get from .form-area. */
.form-area form {
    display: flex;
    flex-direction: column;
    gap: 40px;
    width: 100%;
    max-width: 420px;
}

.form-area form > * {
    width: 100%;
}

/* Per-step gap overrides */
#step-login-password .form-area,
#step-login-password .form-area form,
#step-business .form-area,
#step-business .form-area form,
#step-location .form-area,
#step-location .form-area form {
    gap: 48px;
}

.form-inner {
    display: flex;
    flex-direction: column;
    gap: 48px;
}


/* ============================================================
   FORM HERO
   ============================================================ */
.form-hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    width: 100%;
}

.form-title-b {
    font-size: 32px;
    font-weight: 800;
    color: var(--color-text);
    text-align: center;
    letter-spacing: -0.02em;
    line-height: 1.3;
    font-family: var(--font-family);
}

.form-subtitle-b {
    font-size: 16px;
    color: var(--color-text-secondary);
    font-weight:600;
    text-align: center;
    line-height: 1.4;
    max-width: 360px;
}

/* ── Layout helpers ── */
.form-stack-sm  { display: flex; flex-direction: column; gap: 12px; width: 100%; }
.form-stack-md  { display: flex; flex-direction: column; gap: 24px; width: 100%; }
.form-stack-lg  {display: flex;flex-direction: column;gap: 16px;width: 100%;}
.form-stack-sm--center { display: flex; flex-direction: column; gap: 12px; align-items: center; width: 100%; }

.login-credentials {
    display: flex;
    flex-direction: column;
    gap: 24px;
    width: 100%;
}

.form-desc {
    font-size: 16px;
    color: var(--color-text-secondary);
    font-weight: 600;
    text-align: center;
    line-height: 1.4;
    margin: 0;
}

.forgot-link {
    font-size: 15px;
    align-self: flex-start;
}

.subtitle {
    font-size: 16px;
    font-weight: 600;
    color: var(--color-text-secondary);
    text-align: center;
    line-height: 1.4;
    word-break: break-word;
}

.subtitle strong {
    font-weight: 700;
    color: var(--color-text);
}


/* ============================================================
   LABEL FIELD (label above input)
   ============================================================ */
.label-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

.field-error {
    display: none;
    font-size: 13px;
    font-weight: 500;
    color: var(--color-danger);
    margin: -2px 0 0;
}

.field-error.visible { display: block; }

.label-field-label {
    font-size: 16px;
    font-weight: 600;
    color: var(--color-text);
    line-height: 1.4;
}

.label-field-input {
    height: 48px;
    width: 100%;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 12px 16px;
    font-size: 16px;
    font-weight: 500;
    font-family: inherit;
    color: var(--color-text);
    background: var(--color-bg);
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.label-field-input:focus {
    border-color: var(--color-primary);
    box-shadow: var(--ring-primary);
}

.label-field-input::placeholder {
    color: var(--color-text-placeholder);
    font-weight: 500;
}

.label-field-input.valid {
    border-color: var(--color-primary);
}

.label-field-input:disabled {
    background: var(--color-bg-disabled);
    color: var(--color-text-muted);
    cursor: not-allowed;
}

/* Shared invalid state for wrapper-based fields (phone, password) */
.label-field-input.invalid {
    border-color: var(--color-danger);
    background: var(--color-danger-bg);
}


/* ============================================================
   GOOGLE PLACES-STYLE BUSINESS SEARCH
   ============================================================ */
.gplace-field {
    position: relative;
    width: 100%;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    background: var(--color-bg);
    padding: 0 16px 0 12px;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.gplace-field.focused {
    border-color: var(--color-primary);
    box-shadow: var(--ring-primary);
}

.gplace-input-row {
    display: flex;
    align-items: center;
    gap: 12px;
    height: 48px;
}

.gplace-source {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    flex: 0 0 auto;
    padding-right: 12px;
    border-right: 1px solid var(--color-border);
    height: 32px;
}

.gplace-source-label {
    font-size: 10px;
    color: var(--color-text-muted);
    line-height: 1;
    white-space: nowrap;
}

.gplace-g-icon { width: 18px; height: 18px; flex: 0 0 18px; }

.gplace-input {
    flex: 1;
    min-width: 0;
    border: none;
    outline: none;
    background: transparent;
    font-family: inherit;
    font-size: 16px;
    color: var(--color-text);
    font-weight: 500;
}

.gplace-input::placeholder { color: var(--color-text-placeholder); }

.gplace-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    z-index: 850;
    overflow: hidden;
}

.gplace-field.open .gplace-dropdown { display: block; }

.gplace-result {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid var(--color-border);
    transition: background 0.12s ease;
}

.gplace-result:hover { background: var(--color-bg-hover); }

.gplace-pin { flex: 0 0 auto; color: var(--color-text-muted); margin-top: 2px; }

.gplace-result-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.gplace-result-name {
    font-size: 15px;
    color: var(--color-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.gplace-result-name b { font-weight: 700; }

.gplace-result-address {
    font-size: 13px;
    color: var(--color-text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.gplace-powered {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
    padding: 10px 16px;
    font-size: 12px;
    color: var(--color-text-muted);
}

.gplace-google-word { font-weight: 600; letter-spacing: 0.2px; }
.gplace-google-word span:nth-child(1) { color: #4285F4; }
.gplace-google-word span:nth-child(2) { color: #EA4335; }
.gplace-google-word span:nth-child(3) { color: #FBBC05; }
.gplace-google-word span:nth-child(4) { color: #4285F4; }
.gplace-google-word span:nth-child(5) { color: #34A853; }
.gplace-google-word span:nth-child(6) { color: #EA4335; }

.gplace-linked-check {
    flex: 0 0 auto;
    color: var(--color-primary);
    font-size: 14px;
    font-weight: 600;
}


/* ============================================================
   FORM ACTIONS
   ============================================================ */
.form-actions {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-actions-b {
    display: flex;
    flex-direction: column;
    gap: 16px;
    align-items: center;
    width: 100%;
}

.form-signin-text {
    font-size: 15px;
    color: var(--color-text-secondary);
    text-align: center;
    font-weight: 600;
}

.form-signin-link {
    color: var(--color-primary);
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}

.form-signin-link:hover {
    text-decoration: underline;
}


/* ============================================================
   OTP
   ============================================================ */
.otp-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: clamp(6px, 2.5vw, 12px);
    width: 100%;
}

.otp-group {
    display: flex;
    align-items: center;
    gap: clamp(4px, 2vw, 8px);
}

.otp-box {
    width: clamp(38px, 11vw, 48px);
    height: clamp(38px, 11vw, 48px);
    border: 1px solid var(--color-border-otp);
    border-radius: var(--radius-md);
    background: var(--color-bg);
    text-align: center;
    font-family: inherit;
    font-size: clamp(16px, 4.5vw, 20px);
    font-weight: 600;
    color: var(--color-text);
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
    caret-color: var(--color-primary);
}

.otp-box:focus {
    border-color: var(--color-primary);
    box-shadow: var(--ring-primary);
}

.otp-box.complete {
    border-color: var(--color-primary);
    background: #f0fdf8;
    color: var(--color-primary);
}

.otp-box.invalid {
    border-color: var(--color-danger);
    background: var(--color-danger-bg);
    color: var(--color-danger);
}

.otp-box:disabled {
    background: var(--color-bg-disabled);
    color: var(--color-text-disabled);
    cursor: not-allowed;
}

.otp-sep {
    width: clamp(6px, 2vw, 10px);
    height: 1.5px;
    background: var(--color-border-otp);
    border-radius: 2px;
    flex-shrink: 0;
}

.otp-input-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    width: 100%;
}

.otp-error {
    display: none;
    font-size: 13px;
    font-weight: 500;
    color: var(--color-danger);
    text-align: center;
    margin: 0;
}

.otp-error.visible { display: block; }

@keyframes otpShake {
    10%, 90% { transform: translateX(-1px); }
    20%, 80% { transform: translateX(2px); }
    30%, 50%, 70% { transform: translateX(-4px); }
    40%, 60% { transform: translateX(4px); }
}

.otp-row.shake { animation: otpShake 0.4s ease; }

@media (prefers-reduced-motion: reduce) {
    .otp-row.shake { animation: none; }
}

.resend-link.disabled {
    color: var(--color-text-disabled);
    cursor: default;
    pointer-events: none;
    text-decoration: none;
}

.otp-sent-msg {
    display: none;
    color: var(--color-primary);
    font-weight: 500;
}

.otp-sent-msg.visible { display: inline; }


/* ============================================================
   BUTTONS
   Primary buttons start DISABLED-looking and only go green when the step's
   validator adds .ready. Removing [disabled] without adding .ready leaves a
   grey button that looks dead but is clickable.
   ============================================================ */
.btn-primary {
    width: 100%;
    height: 48px;
    background: var(--color-bg-disabled);
    color: var(--color-text-disabled);
    border: none;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 16px;
    font-weight: 700;
    cursor: not-allowed;
    transition: background 0.2s, color 0.2s;
}

.btn-primary.ready {
    background: var(--color-primary);
    color: white;
    cursor: pointer;
}

.btn-primary.ready:hover {
    background: var(--color-primary-hover);
}

.btn-primary.is-busy {
    cursor: progress;
    opacity: 0.75;
}

.btn-outline {
    width: 100%;
    height: 48px;
    background: var(--color-bg);
    color: var(--color-text-label);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.15s;
}

.btn-outline:hover {
    border-color: var(--color-primary);
}


/* ============================================================
   HELPER TEXT
   ============================================================ */
.helper-text {
    text-align: center;
    line-height: 1.4;
    color: var(--color-text-secondary);
}

.helper-text.sm { font-size: 14px; }
.helper-text.md { font-size: 16px; }

.helper-text a {
    color: #027948;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}

.helper-text a:hover {
    text-decoration: underline;
}

/* Inline form-level error (replaces V2's bootstrap error modal) */
.auth-form-error {
    display: none;
    font-size: 14px;
    font-weight: 500;
    color: var(--color-danger);
    background: var(--color-danger-bg);
    border-radius: var(--radius-md);
    padding: 10px 14px;
    text-align: center;
    line-height: 1.4;
}

.auth-form-error.visible { display: block; }

/* Slot for the page-level error, sitting between the steps and the footer so
   it's visible whichever step is active. */
.reg-error-slot {
    width: 100%;
    padding: 0 40px 12px;
    display: flex;
    justify-content: center;
    flex-shrink: 0;
}

.reg-error-slot .auth-form-error {
    width: 100%;
    max-width: 420px;
}


/* ============================================================
   OR DIVIDER
   ============================================================ */
.or-divider {
    display: flex;
    align-items: center;
    gap: 24px;
}

.or-divider-line {
    flex: 1;
    height: 1px;
    background: var(--color-border);
}

.or-divider span {
    font-size: 14px;
    color: var(--color-text-secondary);
    white-space: nowrap;
}


/* ============================================================
   PASSWORD FIELD
   ============================================================ */
.password-wrap {
    position: relative;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    background: var(--color-bg);
    display: flex;
    align-items: center;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.password-wrap:focus-within {
    border-color: var(--color-primary);
    box-shadow: var(--ring-primary);
}

.password-wrap.invalid {
    border-color: var(--color-danger);
    background: var(--color-danger-bg);
}

.password-wrap.invalid:focus-within {
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

.password-wrap input {
    flex: 1;
    min-width: 0;
    height: 48px;
    padding: 0 16px;
    border: none;
    border-radius: var(--radius-lg);
    font-family: inherit;
    font-size: 16px;
    color: var(--color-text);
    background: transparent;
    outline: none;
}

.password-wrap input::placeholder {
    color: var(--color-text-muted);
}

.eye-toggle {
    width: 52px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    cursor: pointer;
    color: #8c8c8c;
    flex-shrink: 0;
}

.eye-toggle:hover {
    color: var(--color-text-secondary);
}


/* ============================================================
   PHONE FIELD
   ============================================================ */
.phone-field {
    position: relative;
    display: flex;
    align-items: center;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    height: 48px;
    background: var(--color-bg);
    overflow: hidden;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.phone-field:focus-within {
    border-color: var(--color-primary);
    box-shadow: var(--ring-primary);
}

.phone-field.invalid {
    border-color: var(--color-danger);
    background: var(--color-danger-bg);
}

.phone-field.invalid:focus-within {
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

.phone-prefix {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 0 16px;
    border-right: 1px solid var(--color-border);
    height: 100%;
    font-size: 16px;
    color: var(--color-text);
    white-space: nowrap;
    flex-shrink: 0;
}

.phone-prefix .flag-icon {
    width: 20px;
    height: 20px;
}

.phone-field input {
    flex: 1;
    min-width: 0;
    height: 100%;
    padding: 0 16px;
    border: none;
    font-family: inherit;
    font-size: 16px;
    font-weight: 500;
    color: var(--color-text);
    background: transparent;
    outline: none;
}

.phone-field input::placeholder {
    color: var(--color-text-placeholder);
}

.phone-field input:disabled {
    color: var(--color-text-muted);
    cursor: not-allowed;
}


/* ============================================================
   CUSTOM SELECT DROPDOWN — unified component
   Used by the header language picker and the signup country picker.
   ============================================================ */
.cust-select {
    position: relative;
    width: 100%;
}

/* ── Trigger ── */
.cust-select-trigger {
    height: 48px;
    width: 100%;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    background: var(--color-bg);
    display: flex;
    align-items: center;
    padding: 0 14px;
    gap: 8px;
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s;
    user-select: none;
}

.cust-select-trigger:hover { border-color: #c0c2cc; }

.cust-select.cs-open .cust-select-trigger {
    border-color: var(--color-primary);
    box-shadow: var(--ring-primary);
}

.cust-select.cs-disabled { opacity: 0.7; }
.cust-select.cs-disabled .cust-select-trigger { cursor: not-allowed; background: var(--color-bg-disabled); }

.cust-select-flag {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    display: block;
}

.cust-select-label {
    flex: 1;
    min-width: 0;
    font-size: 15px;
    font-weight: 500;
    color: var(--color-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cust-select-label.is-placeholder { color: var(--color-text-placeholder); font-weight: 500; }

.cust-select-chevron {
    flex: 0 0 auto;
    color: #8c8c8c;
    transition: transform 0.2s ease;
}

.cust-select.cs-open .cust-select-chevron { transform: rotate(180deg); }

/* ── Panel ── */
.cust-select-panel {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    min-width: 100%;
    background: var(--color-bg);
    border-radius: var(--radius-xl);
    border: 1px solid var(--color-border);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    z-index: 900;
    max-height: 280px;
    padding: 4px;
    flex-direction: column;
    overflow: hidden;
}

.cust-select.cs-open .cust-select-panel { display: flex; }

/* Applied via JS when there isn't enough room below the trigger. Without
   this the panel (absolute, but still counted in scrollable overflow) grows
   the page's scroll height and the page visibly jumps. */
.cust-select.cs-open-up .cust-select-panel {
    top: auto;
    bottom: calc(100% + 4px);
}

/* Scrollable option list inside the panel, so a sticky search row can sit
   above it (the prototype had 14 countries and needed neither). */
.cust-select-options {
    overflow-y: auto;
    min-height: 0;
    scrollbar-width: none;
}

.cust-select-options::-webkit-scrollbar { display: none; }

/* ── Search row (country picker only — ~235 options) ── */
.cust-select-search {
    flex: 0 0 auto;
    padding: 4px 4px 8px;
}

.cust-select-search input {
    width: 100%;
    height: 38px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 0 12px;
    font-family: inherit;
    font-size: 14px;
    color: var(--color-text);
    background: var(--color-bg);
    outline: none;
}

.cust-select-search input:focus { border-color: var(--color-primary); }
.cust-select-search input::placeholder { color: var(--color-text-placeholder); }

.cust-select-empty {
    display: none;
    padding: 12px 10px;
    font-size: 14px;
    color: var(--color-text-muted);
    text-align: center;
}

.cust-select-empty.visible { display: block; }

/* ── Option rows ── */
.cust-select-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    cursor: pointer;
    transition: background 0.12s ease;
    border-radius: 8px;
}

.cust-select-option:hover { background: var(--color-primary-light); }
.cust-select-option.cs-selected { background: var(--color-primary-light); }
.cust-select-option.cs-hidden { display: none; }

.cust-select-option.cs-option-disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.cust-select-option.cs-option-disabled:hover { background: transparent; }

.cust-select-option-flag {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    display: block;
}

.cust-select-option-label {
    flex: 1;
    min-width: 0;
    font-size: 15px;
    font-weight: 500;
    color: var(--color-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cust-select-option-dial {
    flex: 0 0 auto;
    font-size: 13px;
    color: var(--color-text-muted);
}

.cust-select-check {
    flex: 0 0 auto;
    color: var(--color-primary);
    font-size: 14px;
    font-weight: 600;
    visibility: hidden;
}

.cust-select-option.cs-selected .cust-select-check { visibility: visible; }

/* ── Header context: shrink trigger to content, panel right-aligned ── */
.reg-header .cust-select {
    width: auto;
    flex: 0 0 auto;
}

.reg-header .cust-select-trigger {
    width: auto;
    height: 40px;
    padding: 0 10px 0 12px;
}

.reg-header .cust-select-label {
    flex: 0 0 auto;
    font-size: 14px;
}

.reg-header .cust-select-panel {
    left: auto;
    right: 0;
    min-width: 260px;
}

/* The country dataset <select> stays in the DOM as the source of truth for
   AuthCustSelect, but is never shown. */
.cust-select-source {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}


/* ============================================================
   RIGHT PANEL
   ============================================================ */
.right-panel {
    flex: 0 0 50%;
    max-width: 700px;
    position: sticky;
    top: 0;
    height: 100vh;
    align-self: flex-start;
    background: var(--color-panel-bg);
    padding: 0;
    overflow: hidden;
    clip-path: inset(0);
}

.rp-inner {
    background: var(--color-panel-bg);
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 200px 0 48px;
    gap: 24px;
    overflow: hidden;
}


/* ============================================================
   TESTIMONIAL CAROUSEL
   ============================================================ */
.tc-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    width: 100%;
    flex-shrink: 0;
}

.tc-wrapper {
    position: relative;
    width: 100%;
    /* Taller than .tc-card so the card's box-shadow (which doubles as a
       subtle top/bottom border) isn't clipped by overflow:hidden. */
    height: 324px;
    overflow: hidden;
    flex-shrink: 0;
}

.tc-card {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 452px;
    height: 300px;
    background: white;
    border-radius: var(--radius-xl);
    box-shadow:
        0px 4px 4px rgba(0, 0, 0, 0.02),
        0px 4px 80px 8px rgba(0, 0, 0, 0.02),
        0px 0px 0px 1px rgba(0, 0, 0, 0.05);
    padding: 24px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transform: translateX(-50%) translateY(-50%);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.75s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.75s ease;
}

.tc-card.tc-center {
    opacity: 1;
    transform: translateX(calc(-50% + var(--tc-drag, 0px))) translateY(-50%);
    pointer-events: auto;
    z-index: 2;
}

.tc-card.tc-prev {
    opacity: 0.65;
    transform: translateX(calc(-50% - 440px + var(--tc-drag, 0px))) translateY(-50%) scale(0.87);
    z-index: 1;
}

.tc-card.tc-next {
    opacity: 0.65;
    transform: translateX(calc(-50% + 440px + var(--tc-drag, 0px))) translateY(-50%) scale(0.87);
    z-index: 1;
}

/* Peek cards use a slightly smaller radius */
.tc-card.tc-prev,
.tc-card.tc-next {
    border-radius: 9.6px;
}

.tc-wrapper.tc-dragging .tc-card {
    transition: none !important;
}

/* Off-screen snap positions — no transition, to prevent the wrap-around
   card sliding the long way across. */
.tc-card.tc-off-left {
    opacity: 0;
    transform: translateX(calc(-50% - 700px)) translateY(-50%) scale(0.87);
    transition: none !important;
    pointer-events: none;
    z-index: 0;
}

.tc-card.tc-off-right {
    opacity: 0;
    transform: translateX(calc(-50% + 700px)) translateY(-50%) scale(0.87);
    transition: none !important;
    pointer-events: none;
    z-index: 0;
}

.tc-quote {
    font-size: 22px;
    font-weight: 700;
    color: var(--color-text);
    line-height: 1.3;
    letter-spacing: -0.44px;
    font-family: var(--font-family);
}

/* The reused testimonial copy highlights phrases with <span> */
.tc-quote span {
    color: var(--color-primary);
    font-weight: 600;
}

.tc-footer {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
}

.tc-author-name {
    font-size: 15px;
    font-weight: 700;
    color: var(--color-text);
    line-height: 1.4;
}

.tc-author-role {
    font-size: 14px;
    color: var(--color-text-muted);
    line-height: 1.4;
    font-weight: 500;
}

.tc-logo {
    height: 34px;
    width: auto;
    max-width: 90px;
    object-fit: contain;
    flex-shrink: 0;
}


/* ============================================================
   TRUST BAR
   ============================================================ */
.trust-bar {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    width: 100%;
    flex-shrink: 0;
    margin-top: auto;
}

.trust-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--color-text);
    text-align: center;
    line-height: 1.5;
}

.trust-logos {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 560px;
    margin: 0 auto;
    gap: 20px;
}

/* These images must have real alpha transparency — a baked-in background
   shows as a mismatched box against --color-panel-bg. */
.trust-logo {
    height: auto;
    max-height: 68px;
    width: auto;
    max-width: 150px;
    object-fit: contain;
    object-position: center;
    opacity: 0.85;
    flex-shrink: 0;
    display: block;
}


/* ============================================================
   PLAIN MODAL (replaces the Bootstrap modals V2 used)
   ============================================================ */
.auth-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1200;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(10, 10, 10, 0.45);
}

.auth-modal.is-open { display: flex; }

.auth-modal-dialog {
    width: 100%;
    max-width: 420px;
    background: var(--color-bg);
    border-radius: var(--radius-xl);
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.18);
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.auth-modal-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--color-text);
}

.auth-modal-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 15px;
    color: var(--color-text-secondary);
    line-height: 1.5;
}

.auth-modal-actions {
    display: flex;
    gap: 12px;
}

.auth-modal-actions .btn-primary,
.auth-modal-actions .btn-outline {
    flex: 1;
}

.auth-modal-msg { font-size: 14px; line-height: 1.5; }


/* ============================================================
   "VALIDATION NEEDED" CAPTCHA MODAL — exact reproduction
   ============================================================
   This is the same dialog signup used to show on /signup-info before
   companySetup. It moved to the email step here, and it has to look identical.

   Every declaration below is copied verbatim from the stylesheets that styled
   it there:
     - bootstrap.min.css        .modal, .modal-dialog, .modal-content,
                                .modal-header/-body/-footer, .modal-backdrop, .btn
     - signupUserInfo.css       the #captcha-submit-confirm-modal overrides,
                                .question-header, .question-sub-header,
                                .sd-cancel-btn, .sd-primary-btn-v2
     - signup-common.css        .sd-input-container-v6

   Note the classes `sd-modal-v6`, `sd-modal-with-text` and `center-modal` on
   that element were INERT on /signup-info — their rules live in accounts.css,
   modals.css and welcome-modal.css, none of which that page loads. They're kept
   on the markup for parity but style nothing, here or there.

   Everything is scoped under the modal's id so V3 gains no global `.modal` or
   `.btn` rules, which is what let us reproduce it without loading Bootstrap.
   AuthModal toggles `.is-open` (display) then `.in` on the next frame, standing
   in for Bootstrap's JS so the dialog still slides in from -25%. */

#captcha-submit-confirm-modal {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 1040;
    display: none;
    overflow: hidden;
    -webkit-overflow-scrolling: touch;
    outline: 0;
}

#captcha-submit-confirm-modal.is-open {
    display: block;
    overflow-x: hidden;
    overflow-y: auto;
}

/* Bootstrap appends a sibling .modal-backdrop.in (#000 at .5 opacity); a
   pseudo-element gives the same result without the extra DOM node. */
#captcha-submit-confirm-modal::before {
    content: '';
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background-color: #000;
    opacity: 0.5;
}

#captcha-submit-confirm-modal .modal-dialog {
    position: relative;
    width: auto;
    margin: 80px auto;            /* signupUserInfo.css override of BS's 10px */
}

/* Bootstrap animates this by toggling .fade -> .in on a later frame. A keyframe
   gives the same slide-in without depending on that timing: if the class ever
   failed to land (requestAnimationFrame is throttled in a hidden tab) a
   transition-based version would leave the dialog stranded at -25%. The resting
   position here is always correct; only the entrance is animated. */
@-webkit-keyframes bsModalSlideIn {
    from { -webkit-transform: translate(0, -25%); }
    to   { -webkit-transform: translate(0, 0); }
}

@keyframes bsModalSlideIn {
    from { transform: translate(0, -25%); }
    to   { transform: translate(0, 0); }
}

#captcha-submit-confirm-modal.is-open .modal-dialog {
    -webkit-animation: bsModalSlideIn 0.3s ease-out;
    animation: bsModalSlideIn 0.3s ease-out;
}

@media (prefers-reduced-motion: reduce) {
    #captcha-submit-confirm-modal.is-open .modal-dialog { animation: none; }
}

@media (min-width: 768px) {
    #captcha-submit-confirm-modal .modal-dialog { width: 600px; }
}

#captcha-submit-confirm-modal .modal-content {
    position: relative;
    background-color: #fff;
    -webkit-background-clip: padding-box;
    background-clip: padding-box;
    border: 1px solid rgba(0, 0, 0, 0.2);
    outline: 0;
    -webkit-box-shadow: 0 3px 9px rgba(0, 0, 0, 0.5);
    box-shadow: 0 3px 9px rgba(0, 0, 0, 0.5);
    padding: 24px;                /* signupUserInfo.css */
    border-radius: 16px;          /* signupUserInfo.css, over BS's 6px */
}

#captcha-submit-confirm-modal .modal-header {
    min-height: 16.43px;
    border-bottom: none;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

#captcha-submit-confirm-modal .modal-header svg:hover {
    cursor: pointer;
    opacity: 0.85;
}

#captcha-submit-confirm-modal .modal-body {
    position: relative;
    padding: 0;
    margin-top: 20px;
}

#captcha-submit-confirm-modal .modal-footer {
    padding: 0;
    border-top: none;
    text-align: right;
}

/* .question-header is 30px globally; the modal scopes it to 20px. */
#captcha-submit-confirm-modal .modal-header .question-header {
    line-height: normal;
    color: #0A0A0A;
    text-align: center;
    font-size: 20px;
    font-style: normal;
    font-weight: 500;
    letter-spacing: -0.6px;
}

/* 18px globally, 16px inside the modal. */
#captcha-submit-confirm-modal .modal-body .question-sub-header {
    color: #525252;
    font-size: 18px;
    font-style: normal;
    font-weight: 400;
    line-height: normal;
    font-size: 16px;
    margin-bottom: 20px;
}

#captcha-submit-confirm-modal .sd-input-container-v6 {
    position: relative;
    margin-bottom: 24px;
}

#captcha-submit-confirm-modal .btn {
    display: inline-block;
    padding: 6px 12px;
    margin-bottom: 0;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.42857143;
    text-align: center;
    white-space: nowrap;
    vertical-align: middle;
    -ms-touch-action: manipulation;
    touch-action: manipulation;
    cursor: pointer;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    background-image: none;
    border: 1px solid transparent;
    border-radius: 4px;
    font-family: inherit;
}

#captcha-submit-confirm-modal .sd-cancel-btn {
    border: none;
    background: none;
    font-weight: 500;
}

#captcha-submit-confirm-modal .sd-primary-btn-v2 {
    background: #008062;
    color: #fff;
    border: 1px solid #008062;
    border-radius: 8px;
    padding: 8px 16px;
    font-weight: 500;
}

#captcha-submit-confirm-modal .sd-primary-btn-v2:hover {
    color: #fff;
    opacity: 0.85;
}

#captcha-submit-confirm-modal .sd-primary-btn-v2:focus,
#captcha-submit-confirm-modal .sd-primary-btn-v2:active {
    box-shadow: none;
    opacity: 0.85;
    text-decoration: none;
}

/* Not in the original — it silently did nothing when the captcha was unsolved.
   Hidden while empty, so the default appearance is unchanged. */
#captcha-submit-confirm-modal .auth-modal-msg {
    margin-bottom: 12px;
    color: var(--color-danger);
    font-weight: 500;
}
.auth-modal-msg.is-error { color: var(--color-danger); }
.auth-modal-msg.is-success { color: var(--color-primary); }


/* ============================================================
   ACCOUNT-CREATION LOADING SCREEN
   ============================================================ */
.auth-loading {
    display: none;
    min-height: 100vh;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 24px;
    padding: 40px 24px;
    text-align: center;
}

.auth-loading.is-visible { display: flex; }

.auth-loading-logo {
    display: flex;
    align-items: center;
    gap: 4px;
}

.auth-loading-logo img { height: 34px; width: auto; display: block; }

.auth-loading-text {
    font-size: 16px;
    color: var(--color-text-secondary);
    max-width: 380px;
    line-height: 1.5;
}

.auth-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--color-primary-light);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: authSpin 0.9s linear infinite;
}

@keyframes authSpin {
    to { transform: rotate(360deg); }
}


/* ============================================================
   RESPONSIVE BREAKPOINTS
   NOTE: do NOT add a max-width cap to .main-content to "balance" ultra-wide
   screens — it leaves a visible white gap between the green panel and the
   viewport's right edge, which reads as a bug.
   ============================================================ */

/* < 1024 px: hide right panel, form full-width */
@media (max-width: 1023px) {
    .right-panel { display: none; }
    .left-panel  { max-width: 760px; margin: 0 auto; }
    .form-area   { padding: 20px 24px; }
    .reg-header  { padding: 24px 24px 12px; }
    .reg-footer  { padding: 0 24px 20px; }
}

/* Narrow phones: reclaim side padding so the OTP row (the widest element)
   can shrink without crowding the rest of the form */
@media (max-width: 380px) {
    .form-area { padding: 20px 16px; }
    .form-title-b { font-size: 26px; }
}

/* >= 1520 px: tighten carousel peek before cards scale up */
@media (min-width: 1520px) {
    .tc-card.tc-prev      { transform: translateX(calc(-50% - 480px + var(--tc-drag, 0px))) translateY(-50%) scale(0.87); }
    .tc-card.tc-next      { transform: translateX(calc(-50% + 480px + var(--tc-drag, 0px))) translateY(-50%) scale(0.87); }
    .tc-card.tc-off-left  { transform: translateX(calc(-50% - 700px)) translateY(-50%) scale(0.87); }
    .tc-card.tc-off-right { transform: translateX(calc(-50% + 700px)) translateY(-50%) scale(0.87); }
}

/* >= 1600 px: larger cards */
@media (min-width: 1600px) {
    .tc-wrapper           { height: 354px; }
    .tc-card              { width: 540px; height: 330px; }
    .tc-card.tc-center    { transform: translateX(calc(-50% + var(--tc-drag, 0px))) translateY(-50%); }
    .tc-card.tc-prev      { transform: translateX(calc(-50% - 560px + var(--tc-drag, 0px))) translateY(-50%) scale(0.87); }
    .tc-card.tc-next      { transform: translateX(calc(-50% + 560px + var(--tc-drag, 0px))) translateY(-50%) scale(0.87); }
    .tc-card.tc-off-left  { transform: translateX(calc(-50% - 880px)) translateY(-50%) scale(0.87); }
    .tc-card.tc-off-right { transform: translateX(calc(-50% + 880px)) translateY(-50%) scale(0.87); }
    .tc-quote             { font-size: 24px; }
    .trust-logo           { max-height: 72px; max-width: 160px; }
}

/* >= 1680 px: wider right panel */
@media (min-width: 1680px) {
    .tc-card.tc-prev      { transform: translateX(calc(-50% - 560px + var(--tc-drag, 0px))) translateY(-50%) scale(0.87); }
    .tc-card.tc-next      { transform: translateX(calc(-50% + 560px + var(--tc-drag, 0px))) translateY(-50%) scale(0.87); }
    .tc-card.tc-off-left  { transform: translateX(calc(-50% - 900px)) translateY(-50%) scale(0.87); }
    .tc-card.tc-off-right { transform: translateX(calc(-50% + 900px)) translateY(-50%) scale(0.87); }
}

/* >= 1840 px: scale up */
@media (min-width: 1840px) {
    .tc-wrapper           { height: 379px; }
    .tc-card              { width: 575px; height: 355px; }
    .tc-card.tc-prev      { transform: translateX(calc(-50% - 600px + var(--tc-drag, 0px))) translateY(-50%) scale(0.87); }
    .tc-card.tc-next      { transform: translateX(calc(-50% + 600px + var(--tc-drag, 0px))) translateY(-50%) scale(0.87); }
    .tc-card.tc-off-left  { transform: translateX(calc(-50% - 960px)) translateY(-50%) scale(0.87); }
    .tc-card.tc-off-right { transform: translateX(calc(-50% + 960px)) translateY(-50%) scale(0.87); }
    .tc-quote             { font-size: 25px; }
}

/* >= 1920 px: largest cards */
@media (min-width: 1920px) {
    .tc-wrapper           { height: 404px; }
    .tc-card              { width: 620px; height: 380px; }
    .tc-card.tc-prev      { transform: translateX(calc(-50% - 640px + var(--tc-drag, 0px))) translateY(-50%) scale(0.87); }
    .tc-card.tc-next      { transform: translateX(calc(-50% + 640px + var(--tc-drag, 0px))) translateY(-50%) scale(0.87); }
    .tc-card.tc-off-left  { transform: translateX(calc(-50% - 1060px)) translateY(-50%) scale(0.87); }
    .tc-card.tc-off-right { transform: translateX(calc(-50% + 1060px)) translateY(-50%) scale(0.87); }
    .tc-quote             { font-size: 26px; }
    .trust-logo           { max-height: 80px; max-width: 180px; }
}
