/**
 * Password recovery v4 — forgot + reset (matches client/attorney login shell).
 * Scoped under body.password-auth-v4 / .pw4.
 */

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

body.password-auth-v4 .bk-pub-header {
    display: none !important;
}

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

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

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

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

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

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

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

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

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

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

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

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

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

.pw4-nav-link--signup {
    color: #fff !important;
    background: var(--pw4-primary);
    border-radius: 999px;
    padding: 8px 18px;
    font-weight: 700;
    transition: background 0.15s;
}

.pw4-nav-link--signup:hover {
    background: var(--pw4-primary-ink);
    color: #fff !important;
}

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

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

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

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

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

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

/* ---------- step strip ---------- */
.pw4-step-strip {
    display: flex;
    justify-content: center;
    gap: 0;
    max-width: 640px;
    width: 100%;
    margin: 34px auto 0;
    padding: 0 20px;
}

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

.pw4-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(--pw4-line) 0 4px, transparent 4px 8px);
}

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

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

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

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

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

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

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

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

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

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

.pw4-card-icon svg {
    width: 19px;
    height: 19px;
    stroke: var(--pw4-primary);
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

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

.pw4-card-sub {
    font-size: 12px;
    color: var(--pw4-text-faint);
    margin-top: 1px;
}

.pw4-alert {
    margin-bottom: 16px;
    padding: 12px 14px;
    border-radius: 10px;
    background: #E4F7EE;
    border: 1px solid rgba(31, 157, 107, 0.25);
    color: #146B48;
    font-size: 13px;
    line-height: 1.45;
}

.pw4-field {
    margin-bottom: 15px;
}

.pw4-field label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: var(--pw4-text);
    margin-bottom: 6px;
}

.pw4-field-hint {
    display: block;
    font-size: 11px;
    font-weight: 500;
    color: var(--pw4-text-faint);
    margin-top: 2px;
}

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

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

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

.pw4-input-wrap input::placeholder {
    color: var(--pw4-text-faint);
}

.pw4-input-wrap input.has-eye {
    padding-right: 42px;
}

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

.pw4-eye-btn:hover {
    color: var(--pw4-text-muted);
}

.pw4-field-err {
    font-size: 11px;
    color: var(--pw4-need);
    margin-top: 6px;
    display: block;
}

.pw4-field.is-error .pw4-input-wrap input,
.pw4-field .pw4-input-wrap input.is-invalid {
    border-color: var(--pw4-need);
    background: var(--pw4-need-soft);
}

.pw4-submit-btn {
    width: 100%;
    background: var(--pw4-primary);
    color: #fff;
    border: none;
    border-radius: 11px;
    padding: 13px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    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;
    margin-top: 4px;
}

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

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

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

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

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

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

body.password-auth-v4 .pw4 .alert,
body.password-auth-v4 > .alert,
body.password-auth-v4 .system_messages {
    position: relative;
    z-index: 2;
    max-width: 440px;
    margin: calc(var(--pw4-nav-h) + 12px) auto 0;
}

@media (max-width: 600px) {
    .pw4-step-strip {
        display: none;
    }

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

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

    .pw4-nav-link:not(.pw4-nav-link--signup) {
        display: none;
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

.pw4--form-first .pw4-field + .pw4-field-err,
.pw4--form-first .pw4-field + label.error {
    margin: -8px 0 8px;
}

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

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

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