/* Turing signup — Turing Stone tokens + LT Remark hero typography. */
:root {
    --login-canvas: #fafaf9;
    --login-surface: #ffffff;
    --login-border: #e7e5e4;
    --login-border-strong: #d6d3d1;
    --login-text-muted: #78716c;
    --login-text-subtle: #a8a29e;
    --login-text: #1c1917;
    --login-link: #57534e;
    --login-hover-bg: #f5f5f4;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body {
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    height: 100vh;
    overflow: hidden;
    background: var(--login-canvas);
    color: var(--login-text);
}

/* base.css keeps body at opacity:0 until an inline script on base.html
 * adds a ``fonts-loaded`` class. This page is a standalone shell (it
 * does NOT extend base.html), so that script never runs and the body
 * would remain invisible forever. Force the signup body visible and
 * neutralise the transition. */
body { opacity: 1 !important; transition: none !important; }

/* ─── Left card shell ─────────────────────────────────────────────── */
.signup-card-shell {
    background: var(--login-surface);
    border: none;
    position: relative;
}

.signup-topbar {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 20px 28px 0 28px;
}

.signup-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: Inter, sans-serif;
    font-size: 12px;
    color: var(--login-text-muted);
    text-decoration: none;
    transition: color 0.15s;
}
.signup-back:hover { color: var(--login-text); }

.signup-form-wrap {
    width: 100%;
    max-width: 400px;
    padding-top: 8px;
    padding-bottom: 56px;
}

/* ─── Typography ──────────────────────────────────────────────────── */
/* Hero title — shared across all steps, LT Remark. Sized to sit above
 * the step form without dominating it. */
.signup-hero-title {
    font-family: "LT Remark", "LT-Remark", Inter, serif;
    font-weight: 400;
    font-size: 30px;
    line-height: 1.15;
    letter-spacing: -0.018em;
    color: var(--login-text);
    margin-bottom: 22px;
}

/* Per-step title — Inter, lighter weight. */
.signup-step-title {
    font-family: Inter, sans-serif;
    font-size: 17px;
    font-weight: 500;
    color: var(--login-text);
    margin-bottom: 6px;
    letter-spacing: -0.005em;
}

.signup-sub {
    font-family: Inter, sans-serif;
    font-size: 13px;
    font-weight: 300;
    color: var(--login-text-muted);
    margin-bottom: 22px;
    line-height: 1.5;
}

.signup-label {
    display: block;
    font-family: Inter, sans-serif;
    font-weight: 500;
    font-size: 12px;
    color: #000000;
    margin-bottom: 6px;
}

/* ─── Inputs & buttons (unchanged from prior design) ──────────────── */
.signup-input {
    width: 100%;
    height: 34px;
    padding: 0 12px;
    font-family: Inter, sans-serif;
    font-size: 13px;
    color: var(--login-text);
    background: var(--login-surface);
    border: 1px solid var(--login-border);
    border-radius: 8px;
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}
.signup-input::placeholder { color: var(--login-text-subtle); }
.signup-input:focus {
    outline: none;
    box-shadow: inset 0 0 0 1px var(--login-text), 0 0 0 3px rgba(28, 25, 23, 0.12);
    border-color: var(--login-text);
}
.signup-input[readonly] { color: var(--login-text-muted); background: var(--login-hover-bg); }

.signup-input.input-error,
.signup-input.input-error:focus {
    border-color: #ef4444;
    box-shadow: inset 0 0 0 1px #ef4444, 0 0 0 3px rgba(239, 68, 68, 0.25);
}

.signup-hint {
    font-family: Inter, sans-serif;
    font-size: 11px;
    color: var(--login-text-muted);
    margin-top: 6px;
}

.signup-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.signup-primary {
    width: 100%;
    height: 36px;
    margin-top: 16px;
    padding: 0;
    background: #000000;
    color: #ffffff;
    font-family: Inter, sans-serif;
    font-size: 13px;
    font-weight: 500;
    border: none;
    border-radius: 8px;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    transition: opacity 0.15s;
}
.signup-primary:disabled { opacity: 0.5; cursor: not-allowed; }
.signup-primary .hover-overlay {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.12);
    opacity: 0;
    transition: opacity 0.15s;
    pointer-events: none;
}
.signup-primary:hover:not(:disabled) .hover-overlay { opacity: 1; }

.signup-secondary {
    height: 36px;
    padding: 0 14px;
    background: var(--login-surface);
    color: var(--login-text);
    font-family: Inter, sans-serif;
    font-size: 13px;
    font-weight: 500;
    border: 1px solid var(--login-border);
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}
.signup-secondary:hover {
    background: var(--login-hover-bg);
    border-color: var(--login-border-strong);
}

.signup-row { display: flex; align-items: center; }
/* Buttons inside a horizontal row share the baseline — the default
 * top margin on .signup-primary (used when it sits below a form field)
 * would otherwise nudge it 16px below the Skip button. */
.signup-row .signup-primary,
.signup-row .signup-secondary { margin-top: 0; }

/* Lighter, denser explainer used below the T&C line on the billing
 * step — purely informative, not a banner. */
.signup-pricing-hint {
    margin-top: 8px;
    font-family: Inter, sans-serif;
    font-size: 11px;
    font-weight: 300;
    line-height: 1.55;
    text-align: center;
    color: var(--login-text-subtle);
}
.signup-pricing-hint strong {
    font-weight: 500;
    color: var(--login-text-muted);
}

.signup-link {
    font-family: Inter, sans-serif;
    font-size: 12px;
    color: var(--login-link);
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px 0;
    transition: color 0.15s;
}
.signup-link:hover { color: var(--login-text); }

.signup-error {
    padding: 10px 12px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    font-family: Inter, sans-serif;
    font-size: 12px;
    color: #991b1b;
}

.signup-info {
    margin-top: 14px;
    padding: 10px 12px;
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 8px;
    font-family: Inter, sans-serif;
    font-size: 12px;
    color: #0369a1;
}

/* Team pills */
.team-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.team-pill {
    height: 32px;
    padding: 0 14px;
    background: var(--login-surface);
    color: var(--login-text);
    font-family: Inter, sans-serif;
    font-size: 13px;
    font-weight: 500;
    border: 1px solid var(--login-border);
    border-radius: 999px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.team-pill:hover { background: var(--login-hover-bg); border-color: var(--login-border-strong); }
.team-pill.active {
    background: var(--login-text);
    color: #ffffff;
    border-color: var(--login-text);
}

/* Invite rows — email flexes to fill, selects are sized to their own
 * content (roughly matches the placeholder width) so the row stops
 * feeling like three equal third-party selects. */
.invite-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto 24px;
    gap: 8px;
    margin-bottom: 8px;
    align-items: center;
}
/* Native <select> chrome is replaced with the same stone palette +
 * custom caret chevron used across the platform, so Team/Role dropdowns
 * visually match the rest of the form (no OS-blue focus ring, no
 * mismatched font). */
.invite-row .invite-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    height: 34px;
    /* Right padding leaves room for the caret SVG. */
    padding: 0 28px 0 10px;
    font-family: Inter, sans-serif;
    font-size: 13px;
    color: var(--login-text);
    background-color: var(--login-surface);
    /* Caret — 10×6 chevron, stone-700 ish. */
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6' fill='none' stroke='%2357534e' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'><path d='M1 1l4 4 4-4'/></svg>");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 10px 6px;
    border: 1px solid var(--login-border);
    border-radius: 8px;
    cursor: pointer;
    transition: box-shadow 0.2s ease, border-color 0.2s ease, background-color 0.15s ease;
}
.invite-row .invite-select:hover {
    background-color: var(--login-hover-bg);
    border-color: var(--login-border-strong);
}
.invite-row .invite-select:focus {
    outline: none;
    box-shadow: inset 0 0 0 1px var(--login-text), 0 0 0 3px rgba(28, 25, 23, 0.12);
    border-color: var(--login-text);
}
.invite-row .invite-select::-ms-expand { display: none; }
/* The open menu itself is still native (UA-dependent), but we can at
 * least theme each <option> to stay on Inter + our text tones. */
.invite-row .invite-select option {
    font-family: Inter, sans-serif;
    font-size: 13px;
    color: var(--login-text);
    background: var(--login-surface);
    padding: 6px 10px;
}
/* Widths tuned to the placeholder text ("Team", "Member") so the
 * dropdowns hug their content instead of stretching. */
.invite-row .invite-team {
    min-width: 96px;
}
.invite-row .invite-role {
    min-width: 104px;
}
.invite-row .invite-remove {
    width: 24px; height: 24px;
    display: inline-flex; align-items: center; justify-content: center;
    color: var(--login-text-muted);
    background: transparent;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}
.invite-row .invite-remove:hover { background: var(--login-hover-bg); color: var(--login-text); }

/* Stripe element */
#stripe-payment-element {
    padding: 10px 12px;
    background: var(--login-surface);
    border: 1px solid var(--login-border);
    border-radius: 8px;
    margin-bottom: 4px;
}

/* ─── Bottom stepper ─────────────────────────────────────────────── */
/* Inactive dots are compact circles; the active step morphs into a wide
   rounded pill with a smooth width/background transition. A future step
   advances by removing .active from the previous dot and adding it to
   the next — the width animation handles the rest. */
.signup-stepper {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 28px;
    display: flex;
    justify-content: center;
    gap: 8px;
    user-select: none;
}
/* Dots are <button>s so completed ones can be keyboard-focused and
 * clicked to rewind. ``.clickable`` is toggled in JS based on whether
 * the step is behind the current one. */
.stepper-dot {
    appearance: none;
    -webkit-appearance: none;
    border: 0;
    padding: 0;
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: var(--login-border-strong);
    cursor: default;
    transition:
        width 360ms cubic-bezier(0.22, 1, 0.36, 1),
        background-color 220ms ease,
        transform 180ms ease,
        box-shadow 180ms ease;
}
.stepper-dot:disabled { opacity: 1; }  /* future dots kept visible */
.stepper-dot.done {
    background: var(--login-text);
}
.stepper-dot.active {
    width: 28px;
    background: var(--login-text);
}
.stepper-dot.clickable {
    cursor: pointer;
}
.stepper-dot.clickable:hover {
    transform: scale(1.25);
}
.stepper-dot.clickable:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(28, 25, 23, 0.18);
}

/* ─── Right panel (orange lines backdrop + per-step icon) ─────────── */
.signup-illustration {
    background: #0b0b0c;
    position: relative;
    isolation: isolate;
}
.signup-illu-bg {
    position: absolute;
    inset: 0;
    background-image: url("/static/images/Abstract Orange Lines.9cf7ed2c24c5.jpg");
    background-size: cover;
    background-position: center;
    opacity: 0.70;
    z-index: 0;
}
.signup-illu-stage {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

.illu-step {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px;
    text-align: center;
    color: #fafaf9;
    opacity: 0;
    transform: translateY(8px);
    transition:
        opacity 300ms cubic-bezier(0.22, 1, 0.36, 1),
        transform 300ms cubic-bezier(0.22, 1, 0.36, 1);
    pointer-events: none;
}
.illu-step.active {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

/* Step icon — sits above the caption on the right container. */
.illu-icon {
    width: 96px;
    height: 96px;
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    margin-bottom: 22px;
}
.illu-icon svg {
    width: 44px;
    height: 44px;
}

.illu-label {
    font-family: "LT Remark", "LT-Remark", Inter, serif;
    font-weight: 400;
    font-size: 26px;
    letter-spacing: -0.01em;
    margin-bottom: 10px;
    color: #fff;
    text-shadow: 0 1px 10px rgba(0, 0, 0, 0.25);
}
.illu-sub {
    font-family: Inter, sans-serif;
    font-size: 13px;
    font-weight: 300;
    line-height: 1.55;
    color: rgba(255, 255, 255, 0.92);
    max-width: 360px;
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.25);
}

/* ─── Password field ─ show/hide toggle + strength meter ─────────────
 * Visual language matches the rest of the platform: soft stone tones,
 * subtle transitions, no hard reds on weak state. All micro-copy is
 * produced client-side and mirrored in the server's validator — see
 * ``_enterprise_password_issues`` in signup_views.py. */
.pw-field-wrap {
    position: relative;
}
.pw-field-wrap .signup-input {
    padding-right: 38px;  /* room for the eye button */
}
.pw-toggle {
    position: absolute;
    top: 50%;
    right: 8px;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    padding: 0;
    background: transparent;
    border: 0;
    color: var(--login-text-muted);
    cursor: pointer;
    border-radius: 6px;
    transition: color 0.15s ease, background 0.15s ease;
}
.pw-toggle:hover { color: var(--login-text); background: var(--login-hover-bg); }
.pw-toggle svg { width: 15px; height: 15px; }

/* Strength bar: a single segmented track that fills smoothly 0 → 100%. */
.pw-strength {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.pw-strength-bar {
    width: 100%;
    height: 4px;
    background: var(--login-border);
    border-radius: 999px;
    overflow: hidden;
    position: relative;
}
.pw-strength-fill {
    display: block;
    height: 100%;
    width: 0%;
    background: var(--login-border-strong);
    border-radius: 999px;
    transition:
        width 320ms cubic-bezier(0.22, 1, 0.36, 1),
        background-color 260ms ease;
}
.pw-strength-fill[data-level="0"] { width: 0%;   background: var(--login-border-strong); }
.pw-strength-fill[data-level="1"] { width: 25%;  background: #e0b891; }  /* weak — soft amber */
.pw-strength-fill[data-level="2"] { width: 55%;  background: #d7a27a; }  /* fair — stone-amber */
.pw-strength-fill[data-level="3"] { width: 85%;  background: #4b6a58; }  /* strong — muted green */
.pw-strength-fill[data-level="4"] { width: 100%; background: #2f5d48; }  /* excellent — deep green */

.pw-strength-label {
    font-family: Inter, sans-serif;
    font-size: 11px;
    font-weight: 500;
    color: var(--login-text-muted);
    letter-spacing: 0.02em;
    transition: color 220ms ease;
}
.pw-strength-label[data-level="1"] { color: #9a6f4c; }
.pw-strength-label[data-level="2"] { color: #77573e; }
.pw-strength-label[data-level="3"] { color: #3d5a49; }
.pw-strength-label[data-level="4"] { color: #2f5d48; }

/* Per-rule checklist: compact, reads like a live checklist. Muted until
 * the rule is met — no hard red for "unmet" to keep the feel calm. */
.pw-rules {
    list-style: none;
    margin: 10px 0 0 0;
    padding: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px 12px;
    font-family: Inter, sans-serif;
    font-size: 11.5px;
    color: var(--login-text-muted);
}
.pw-rules li {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: color 220ms ease, opacity 220ms ease;
}
.pw-rules .pw-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background: var(--login-border-strong);
    transform: scale(0.9);
    transition: background 220ms ease, transform 220ms cubic-bezier(0.22, 1, 0.36, 1);
}
.pw-rules li.met {
    color: var(--login-text);
}
.pw-rules li.met .pw-dot {
    background: #2f5d48;
    transform: scale(1.15);
}

/* Password-match hint sits under the confirm field. Tone stays on the
 * platform's stone palette for parity rather than a jarring red. */
.pw-match-hint {
    font-family: Inter, sans-serif;
    font-size: 11.5px;
    font-weight: 400;
    min-height: 14px;
    margin-top: 6px;
    color: var(--login-text-muted);
    transition: color 220ms ease;
}
.pw-match-hint.match { color: #2f5d48; }
.pw-match-hint.mismatch { color: #9a6f4c; }

/* Disabled primary button on the password step keeps the platform's
 * soft palette (no dimmed-black anti-pattern). */
.signup-primary:disabled {
    background: var(--login-text-muted);
    cursor: not-allowed;
    opacity: 0.55;
}
.signup-primary:disabled .hover-overlay { display: none; }
