/**
 * Attorney signup v4 — matches Untitled-1 law-firm signup mock.
 * Scoped under body.attorney-signup-v4 / .as4.
 */

@import url('https://fonts.googleapis.com/css2?family=Source+Serif+4:opsz,wght@8..60,500;8..60,600;8..60,700&family=Inter:wght@400;500;600;700&display=swap');

body.attorney-signup-v4 {
    --as4-bg: #F6F7FB;
    --as4-panel: #FFFFFF;
    --as4-line: #E5E7F0;
    --as4-primary: #2F6FEB;
    --as4-primary-soft: #EAF1FE;
    --as4-primary-ink: #1D4ED8;
    --as4-purple: #8B5CF6;
    --as4-amber: #2F6FEB;
    --as4-amber-soft: #EAF1FE;
    --as4-amber-ink: #1D4ED8;
    --as4-good: #1F9D6B;
    --as4-need: #E0473C;
    --as4-need-soft: #FDEAE8;
    --as4-text: #151C2C;
    --as4-text-muted: #68708A;
    --as4-text-faint: #9BA1B5;
    --as4-nav-h: 66px;
    background: var(--as4-bg);
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--as4-text);
    -webkit-font-smoothing: antialiased;
}

body.attorney-signup-v4 .bk-pub-header {
    display: none !important;
}

body.attorney-signup-v4::before {
    content: "";
    position: fixed;
    top: -10%;
    left: 15%;
    width: 580px;
    height: 580px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(47, 111, 235, 0.10), transparent 65%);
    pointer-events: none;
    z-index: 0;
}

body.attorney-signup-v4::after {
    content: "";
    position: fixed;
    top: -4%;
    right: 10%;
    width: 500px;
    height: 500px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(47, 111, 235, 0.08), transparent 65%);
    pointer-events: none;
    z-index: 0;
}

.as4 {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.as4 a {
    color: inherit;
    text-decoration: none;
}

/* ---------- fixed header ---------- */
.as4-topnav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 200;
    height: var(--as4-nav-h);
    background: rgba(246, 247, 251, 0.88);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--as4-line);
}

.as4-nav-inner {
    max-width: 1160px;
    margin: 0 auto;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 36px;
}

.as4-logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.as4-logo-mark {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    flex: none;
    background: linear-gradient(135deg, var(--as4-purple), var(--as4-primary));
    display: flex;
    align-items: center;
    justify-content: center;
}

.as4-logo-mark svg {
    width: 16px;
    height: 16px;
    stroke: #fff;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.as4-logo-text {
    font-family: 'Source Serif 4', Georgia, serif;
    font-size: 15px;
    font-weight: 600;
    color: var(--as4-text);
}

.as4-nav-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.as4-nav-link {
    font-size: 13px;
    font-weight: 600;
    color: var(--as4-text-muted);
    transition: color 0.15s;
}

a.as4-nav-link:hover {
    color: var(--as4-text);
}

.as4-nav-link--active {
    color: #fff !important;
    background: var(--as4-amber);
    border-radius: 999px;
    padding: 8px 18px;
    font-weight: 700;
}

/* ---------- main ---------- */
.as4-main {
    flex: 1;
    padding-top: calc(var(--as4-nav-h) + 40px);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.as4-hero {
    text-align: center;
    padding: 0 20px;
}

.as4-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--as4-amber);
    background: var(--as4-amber-soft);
    border: 1px solid rgba(47, 111, 235, 0.2);
    border-radius: 999px;
    padding: 6px 14px;
    margin-bottom: 18px;
}

.as4-eyebrow svg {
    width: 12px;
    height: 12px;
    stroke: var(--as4-amber);
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.as4-hero h1 {
    font-family: 'Source Serif 4', Georgia, serif;
    font-size: 32px;
    font-weight: 600;
    color: var(--as4-text);
    margin: 0 0 10px;
    letter-spacing: -0.01em;
    line-height: 1.25;
}

.as4-hero p {
    font-size: 14px;
    color: var(--as4-text-muted);
    max-width: 440px;
    margin: 0 auto;
    line-height: 1.65;
}

/* ---------- step strip (same pattern as client portal) ---------- */
.as4-step-strip {
    display: flex;
    justify-content: center;
    gap: 0;
    max-width: 640px;
    width: 100%;
    margin: 34px auto 0;
    padding: 0 20px;
}

.as4-strip-step {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
    padding: 0 10px;
}

.as4-strip-step:not(:last-child)::after {
    content: "";
    position: absolute;
    top: 19px;
    left: calc(50% + 24px);
    right: calc(-50% + 24px);
    height: 1px;
    background: repeating-linear-gradient(90deg, var(--as4-line) 0 4px, transparent 4px 8px);
}

.as4-strip-icon {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #fff;
    border: 1.5px solid var(--as4-line);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
    z-index: 1;
}

.as4-strip-icon svg {
    width: 17px;
    height: 17px;
    stroke: var(--as4-text-muted);
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.as4-strip-step.is-active .as4-strip-icon {
    background: var(--as4-amber);
    border-color: var(--as4-amber);
}

.as4-strip-step.is-active .as4-strip-icon svg {
    stroke: #fff;
}

.as4-strip-label {
    font-size: 11.5px;
    font-weight: 700;
    color: var(--as4-text);
}

.as4-strip-sub {
    font-size: 10.5px;
    color: var(--as4-text-faint);
    margin-top: 2px;
    line-height: 1.4;
    max-width: 110px;
}

/* ---------- card ---------- */
.as4-card-zone {
    display: flex;
    justify-content: center;
    padding: 44px 20px 0;
    width: 100%;
}

.as4-card {
    background: var(--as4-panel);
    border: 1px solid var(--as4-line);
    border-radius: 20px;
    max-width: 700px;
    width: 100%;
    padding: 36px 40px;
    box-shadow: 0 28px 64px -18px rgba(47, 60, 120, 0.13);
}

.as4-card-top {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 28px;
}

.as4-card-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: var(--as4-amber-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    flex: none;
}

.as4-card-icon svg {
    width: 20px;
    height: 20px;
    stroke: var(--as4-amber);
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.as4-card-title {
    font-family: 'Source Serif 4', Georgia, serif;
    font-size: 20px;
    font-weight: 600;
    color: var(--as4-text);
}

.as4-card-sub {
    font-size: 12.5px;
    color: var(--as4-text-faint);
    margin-top: 2px;
}

.as4-section-label {
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--as4-primary);
    margin: 26px 0 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.as4-section-label::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--as4-primary-soft);
}

.as4-section-label:first-of-type {
    margin-top: 0;
}

/* ---------- fields / grid ---------- */
.as4-grid {
    display: grid;
    gap: 14px;
    margin-bottom: 14px;
}

.as4-grid--1 {
    grid-template-columns: 1fr;
}

.as4-grid--2 {
    grid-template-columns: 1fr 1fr;
}

.as4-grid--3 {
    grid-template-columns: 1fr 1fr 1fr;
}

.as4-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 0;
    min-width: 0;
}

.as4-field-label,
.as4-field label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: var(--as4-text);
    margin: 0;
}

.as4-optional {
    font-weight: 400;
    color: var(--as4-text-faint);
}

.as4-field .form-control,
.as4-field input.form-control,
.as4-field select.form-control {
    width: 100%;
    border: 1.5px solid var(--as4-line);
    border-radius: 10px;
    padding: 11px 13px;
    font-size: 13.5px;
    font-family: inherit;
    color: var(--as4-text);
    background: var(--as4-bg);
    height: auto;
    min-height: 44px;
    box-shadow: none;
    transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}

.as4-field select.form-control {
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239BA1B5' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 13px center;
    padding-right: 36px;
}

.as4-field .form-control:focus,
.as4-field input.form-control:focus,
.as4-field select.form-control:focus {
    outline: none;
    border-color: var(--as4-primary);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(47, 111, 235, 0.11);
}

.as4-field .form-control::placeholder {
    color: var(--as4-text-faint);
}

.as4-input-wrap {
    position: relative;
}

.as4-input-wrap .form-control {
    padding-right: 40px;
}

.as4-eye-btn,
.as4-input-wrap #togglePassword {
    position: absolute;
    right: 11px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: var(--as4-text-faint);
    font-size: 15px;
    line-height: 1;
}

.as4-eye-btn:hover,
.as4-input-wrap #togglePassword:hover {
    color: var(--as4-text-muted);
}

.as4-field-err,
.as4-field label.error,
#register_form label.error {
    font-size: 11px;
    color: var(--as4-need);
    margin: 0;
    display: block;
    font-weight: 500;
}

.as4-field.is-error .form-control,
.as4-field .form-control.is-invalid {
    border-color: var(--as4-need);
    background: var(--as4-need-soft);
}

.as4-recaptcha {
    margin: 8px 0 4px;
}

.as4-tos {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-top: 24px;
    padding: 14px 16px;
    background: var(--as4-bg);
    border: 1.5px solid var(--as4-line);
    border-radius: 10px;
    font-size: 13px;
    color: var(--as4-text-muted);
    line-height: 1.5;
    cursor: pointer;
    font-weight: 400;
}

.as4-tos input[type="checkbox"] {
    accent-color: var(--as4-primary);
    width: 15px;
    height: 15px;
    flex: none;
    margin-top: 2px;
    cursor: pointer;
}

.as4-tos span {
    flex: 1;
}

.as4-submit-btn {
    width: 100%;
    background: var(--as4-primary);
    color: #fff;
    border: none;
    border-radius: 11px;
    padding: 14px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    margin-top: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: inherit;
    box-shadow: 0 4px 14px rgba(47, 111, 235, 0.28);
    transition: background 0.15s, box-shadow 0.15s;
}

.as4-submit-btn:hover {
    background: var(--as4-primary-ink);
    color: #fff;
    box-shadow: 0 6px 18px rgba(29, 78, 216, 0.3);
}

.as4-submit-btn svg {
    width: 15px;
    height: 15px;
    stroke: #fff;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.as4-meta {
    text-align: center;
    font-size: 13px;
    color: var(--as4-text-muted);
    margin: 18px 0 0;
}

.as4-meta a {
    color: var(--as4-primary-ink);
    font-weight: 700;
}

.as4-meta a:hover {
    text-decoration: underline;
}

.as4-trust-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-top: 22px;
    flex-wrap: wrap;
}

.as4-trust-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11.5px;
    color: var(--as4-text-faint);
}

.as4-trust-item svg {
    width: 13px;
    height: 13px;
    stroke: var(--as4-good);
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.as4-foot {
    text-align: center;
    font-size: 11.5px;
    color: var(--as4-text-faint);
    padding: 32px 20px 28px;
}

body.attorney-signup-v4 .as4 .alert,
body.attorney-signup-v4 > .alert,
body.attorney-signup-v4 .system_messages {
    position: relative;
    z-index: 2;
    max-width: 700px;
    margin: calc(var(--as4-nav-h) + 12px) auto 0;
}

@media (max-width: 680px) {
    .as4-grid--2,
    .as4-grid--3 {
        grid-template-columns: 1fr;
    }

    .as4-step-strip {
        display: none;
    }

    .as4-card {
        padding: 28px 22px;
    }

    .as4-nav-inner {
        padding: 0 20px;
    }

    .as4-logo-text {
        display: none;
    }

    .as4-nav-link:not(.as4-nav-link--active) {
        display: none;
    }

    .as4-hero h1 {
        font-size: 26px;
    }
}

/* Compact hero so the signup form stays on the first screen.
   New wrapper class only — existing .as4-* rules stay unchanged. */
.as4--form-first .as4-main {
    padding-top: calc(var(--as4-nav-h) + 14px);
}

.as4--form-first .as4-eyebrow {
    padding: 4px 10px;
    margin-bottom: 8px;
}

.as4--form-first .as4-hero h1 {
    font-size: 22px;
    margin-bottom: 4px;
    line-height: 1.3;
}

.as4--form-first .as4-hero p {
    font-size: 13px;
    line-height: 1.45;
    max-width: 520px;
}

.as4--form-first .as4-step-strip {
    margin-top: 14px;
}

.as4--form-first .as4-strip-icon {
    width: 30px;
    height: 30px;
    margin-bottom: 6px;
}

.as4--form-first .as4-strip-icon svg {
    width: 14px;
    height: 14px;
}

.as4--form-first .as4-strip-step:not(:last-child)::after {
    top: 15px;
}

.as4--form-first .as4-card-zone {
    padding-top: 16px;
}

.as4--form-first .as4-card {
    padding: 24px 28px 28px;
}

.as4--form-first .as4-card-top {
    margin-bottom: 16px;
}

.as4--form-first .as4-section-label {
    margin: 16px 0 10px;
}

.as4--form-first .as4-field .form-control.error {
    border-color: var(--as4-need);
    background: var(--as4-need-soft);
}

.as4--form-first .as4-field .as4-field-err,
.as4--form-first .as4-field label.error,
.as4--form-first .as4-field p.error,
.as4--form-first #register_form .as4-field-err {
    display: block;
    width: 100%;
    margin: 2px 0 0;
    font-style: normal;
    font-weight: 500;
    line-height: 1.35;
}

.as4--form-first .as4-grid + .as4-field-err,
.as4--form-first .as4-grid + label.error,
.as4--form-first .as4-field + .as4-field-err,
.as4--form-first .as4-field + label.error {
    grid-column: 1 / -1;
    margin: -8px 0 8px;
}

@media (max-width: 680px) {
    .as4--form-first .as4-hero h1 {
        font-size: 20px;
    }

    .as4--form-first .as4-card {
        padding: 20px 16px 24px;
    }
}

/* ---------- wizard (new classes only) ---------- */
.as4--wizard .as4-card {
    max-width: 440px;
}

.as4--wizard .as4-wizard-pane > .as4-field {
    margin-bottom: 15px;
}

.as4-wizard-pane[hidden],
.as4-wizard-pane:not(.is-active) {
    display: none !important;
}

.as4-wizard-pane.is-active {
    display: block;
}

.as4-wizard-pane .as4-section-label:first-child {
    margin-top: 0;
}

/* Hide signup terms checkbox — acceptance happens in modal */
.as4-scales-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.as4-wizard-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 16px;
}

.as4-wizard-btn--back {
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: #fff;
    color: var(--as4-text-muted);
    border: 1.5px solid var(--as4-line);
    border-radius: 11px;
    padding: 13px 18px;
    font-size: 13.5px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.as4-wizard-btn--back svg {
    width: 15px;
    height: 15px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.as4-wizard-btn--back:hover {
    background: var(--as4-bg);
    border-color: #d0d4e4;
    color: var(--as4-text);
}

.as4-wizard-btn--back[hidden] {
    display: none !important;
}

.as4-wizard-btn--next,
.as4-wizard-btn--submit {
    flex: 1;
    margin-top: 0;
    margin-left: auto;
}

.as4-wizard-btn--next svg {
    width: 15px;
    height: 15px;
}

/* Horizontal step progress (above form) */
.as4-wizard-progress {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 0;
    max-width: 640px;
    width: 100%;
    margin: 18px auto 0;
    padding: 0 20px;
    box-sizing: border-box;
}

.as4-wizard-progress .as4-rail-step {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
    padding: 0 10px 0;
    gap: 8px;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    appearance: none;
    -webkit-appearance: none;
}

.as4-wizard-progress .as4-rail-step:hover .as4-rail-label {
    color: var(--as4-text);
}

.as4-wizard-progress .as4-rail-step:focus-visible {
    outline: none;
}

.as4-wizard-progress .as4-rail-step:focus-visible .as4-rail-marker {
    box-shadow: 0 0 0 4px rgba(47, 111, 235, 0.22);
}

.as4-wizard-progress .as4-rail-step:not(:last-child)::after {
    content: "";
    position: absolute;
    top: 15px;
    left: calc(50% + 20px);
    right: calc(-50% + 20px);
    height: 2px;
    background: var(--as4-line);
}

.as4-wizard-progress .as4-rail-step.is-complete:not(:last-child)::after,
.as4-wizard-progress .as4-rail-step.is-active:not(:last-child)::after {
    background: rgba(47, 111, 235, 0.35);
}

.as4-rail-marker {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    flex: none;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border: 1.5px solid var(--as4-line);
    color: var(--as4-text-faint);
    font-size: 12px;
    font-weight: 700;
    z-index: 1;
}

.as4-rail-check {
    display: none;
    width: 14px;
    height: 14px;
    stroke: #fff;
    fill: none;
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.as4-rail-step.is-active .as4-rail-marker {
    background: var(--as4-primary);
    border-color: var(--as4-primary);
    color: #fff;
    box-shadow: 0 0 0 4px rgba(47, 111, 235, 0.14);
}

.as4-rail-step.is-complete .as4-rail-marker {
    background: var(--as4-primary);
    border-color: var(--as4-primary);
    color: #fff;
}

.as4-rail-step.is-complete .as4-rail-num {
    display: none;
}

.as4-rail-step.is-complete .as4-rail-check {
    display: block;
}

.as4-rail-copy {
    min-width: 0;
}

.as4-rail-label {
    font-size: 12.5px;
    font-weight: 700;
    color: var(--as4-text-muted);
    line-height: 1.3;
}

.as4-rail-sub {
    font-size: 11px;
    color: var(--as4-text-faint);
    margin-top: 2px;
    line-height: 1.4;
}

.as4-rail-step.is-active .as4-rail-label {
    color: var(--as4-text);
}

.as4-rail-step.is-active .as4-rail-sub {
    color: var(--as4-text-muted);
}

.as4-rail-step.is-complete .as4-rail-label {
    color: var(--as4-primary-ink);
}

@media (max-width: 600px) {
    .as4-wizard-progress .as4-rail-sub {
        display: none;
    }

    .as4-rail-label {
        font-size: 11px;
    }
}

@media (max-width: 680px) {
    .as4-wizard-nav {
        flex-wrap: wrap;
    }

    .as4-wizard-btn--back {
        width: 100%;
        order: 2;
    }

    .as4-wizard-btn--next,
    .as4-wizard-btn--submit {
        width: 100%;
        order: 1;
    }
}

/* MatterVanta logo image in topnav */
.as4-logo-img {
    display: block;
    height: 40px;
    width: auto;
    max-width: min(220px, 55vw);
    object-fit: contain;
}
