/* Firm portal sign-in — navy chambers column, warm paper form */
* { box-sizing: border-box; }

html {
    height: 100%;
    overflow: hidden;
}

html, body {
    margin: 0;
    width: 100%;
    max-width: 100%;
}

body.login-page {
    height: 100%;
    height: 100dvh;
    max-height: 100dvh;
    overflow: hidden;
    overscroll-behavior: none;
    font-family: Outfit, "Segoe UI", sans-serif;
    color: #142033;
    background: #f3f0ea;
    -webkit-font-smoothing: antialiased;
    --lp-ink: #142033;
    --lp-muted: #5c6b7c;
    --lp-label: #314052;
    --lp-paper: #f7f5f1;
    --lp-line: #e3ddd4;
    --lp-field: #d8d1c7;
    --lp-brass: #c4a36a;
}

.lp {
    height: 100%;
    height: 100dvh;
    max-height: 100dvh;
    width: 100%;
    overflow: hidden;
    display: grid;
    grid-template-columns: minmax(240px, 38%) minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr);
}

.lp-aside {
    position: relative;
    display: flex;
    align-items: center;
    min-width: 0;
    min-height: 0;
    height: 100%;
    padding: clamp(1.1rem, 3.2vh, 3.25rem) clamp(1.15rem, 3vw, 3.25rem);
    color: #f6f1e8;
    background:
        radial-gradient(120% 70% at 0% 0%, rgba(255, 255, 255, 0.07), transparent 46%),
        linear-gradient(168deg, color-mix(in srgb, var(--lp-accent) 40%, #08131f) 0%, #08131f 48%, #0d2136 100%);
    overflow: hidden;
}

.lp-aside::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-image: linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
    background-size: 76px 100%;
    -webkit-mask-image: linear-gradient(180deg, transparent, #000 20%, #000 78%, transparent);
    mask-image: linear-gradient(180deg, transparent, #000 20%, #000 78%, transparent);
}

.lp-aside::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 1px;
    background: linear-gradient(180deg, transparent, var(--lp-brass), transparent);
}

.lp-aside-body {
    position: relative;
    z-index: 1;
    width: min(100%, 20rem);
    max-height: 100%;
    overflow: hidden;
}

.lp-mark {
    width: clamp(48px, 7vh, 64px);
    height: clamp(48px, 7vh, 64px);
    margin-bottom: clamp(0.85rem, 2.2vh, 1.6rem);
    display: grid;
    place-items: center;
    overflow: hidden;
    flex-shrink: 0;
    border: 1px solid rgba(246, 241, 232, 0.38);
    box-shadow: 0 0 0 5px rgba(246, 241, 232, 0.08);
    font-family: Fraunces, Georgia, "Times New Roman", serif;
    font-size: clamp(1.15rem, 2.2vh, 1.45rem);
    font-weight: 500;
    letter-spacing: 0;
    color: #f6f1e8;
}

.lp-mark--logo {
    padding: 7px;
    border: 0;
    box-shadow: none;
    background: #fff;
}

.lp-mark img {
    width: 100%;
    height: 100%;
    max-width: 100%;
    object-fit: contain;
    display: block;
}

.lp-kicker-stack {
    margin: 0 0 clamp(0.4rem, 1vh, 0.7rem);
}

.lp-kicker {
    margin: 0;
    font-size: clamp(0.66rem, 1.4vh, 0.72rem);
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: #e7d3ae;
}

.lp-firm {
    margin: 0;
    font-family: Fraunces, Georgia, "Times New Roman", serif;
    font-size: clamp(1.7rem, 2.6vh + 1.2vw, 3rem);
    font-weight: 500;
    line-height: 1.08;
    letter-spacing: -0.03em;
    color: #f7f3ec;
    overflow-wrap: break-word;
}

.lp-aside-note {
    margin: clamp(0.7rem, 1.8vh, 1.15rem) 0 0;
    max-width: 18rem;
    font-size: clamp(0.8rem, 1.7vh, 0.92rem);
    line-height: 1.45;
    color: rgba(246, 241, 232, 0.74);
    overflow-wrap: break-word;
}

.lp-banner-points-stack {
    margin: clamp(0.7rem, 1.8vh, 1.2rem) 0 0;
    max-width: 19.5rem;
}

.lp-banner-points {
    margin: 0;
    padding: 0;
    max-width: 19.5rem;
    list-style: none;
}

.lp-banner-points li {
    position: relative;
    margin: 0;
    padding: 0 0 0 1.05rem;
    font-size: clamp(0.78rem, 1.6vh, 0.88rem);
    line-height: 1.4;
    color: rgba(246, 241, 232, 0.78);
}

.lp-banner-points li + li {
    margin-top: clamp(0.28rem, 0.9vh, 0.55rem);
}

.lp-banner-points li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.52em;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--lp-brass);
    box-shadow: 0 0 0 3px rgba(196, 163, 106, 0.16);
}

.lp-swap-stack {
    display: grid;
    align-items: start;
    justify-items: stretch;
    overflow: hidden;
}

.lp-swap-layer {
    grid-area: 1 / 1;
    width: 100%;
    margin: 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(6px);
    pointer-events: none;
    transition:
        opacity 0.18s ease,
        transform 0.18s ease,
        visibility 0s linear 0.18s;
}

.lp-swap-layer.is-active {
    z-index: 1;
    opacity: 1;
    visibility: visible;
    transform: none;
    pointer-events: auto;
    transition:
        opacity 0.18s ease,
        transform 0.18s ease,
        visibility 0s linear 0s;
}

.lp-subtitle-stack {
    margin: clamp(0.28rem, 0.8vh, 0.45rem) 0 0;
}

.lp-subtitle-stack .lp-subtitle {
    margin: 0;
}

.lp-main {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 0;
    min-height: 0;
    height: 100%;
    padding: clamp(3rem, 6vh, 4.5rem) clamp(1.1rem, 3vw, 2.5rem) clamp(1rem, 2.4vh, 2.75rem);
    background: linear-gradient(180deg, #fbfaf7 0%, var(--lp-paper) 100%);
    overflow: hidden;
}

.lp-lang {
    position: absolute;
    top: clamp(0.85rem, 2vh, 1.35rem);
    right: clamp(1rem, 2vw, 1.6rem);
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    z-index: 2;
}

.lp-lang a {
    color: var(--lp-muted);
    text-decoration: none;
}

.lp-lang a:hover,
.lp-lang a.is-active {
    color: var(--lp-accent);
}

.lp-lang span {
    color: #c9c2b6;
}

.lp-sheet {
    width: min(100%, 26.5rem);
    max-height: 100%;
    overflow: auto;
    container-type: inline-size;
}

.lp-title {
    margin: 0;
    font-family: Fraunces, Georgia, "Times New Roman", serif;
    font-size: clamp(1.55rem, 2.4vh + 0.6vw, 2.15rem);
    font-weight: 500;
    letter-spacing: -0.03em;
    line-height: 1.15;
    color: var(--lp-ink);
}

.lp-subtitle {
    margin: 0;
    font-size: clamp(0.84rem, 1.7vh, 0.95rem);
    line-height: 1.4;
    color: var(--lp-muted);
}

.lp-note {
    margin: clamp(0.5rem, 1.3vh, 0.85rem) 0 0;
    font-size: clamp(0.76rem, 1.5vh, 0.84rem);
    line-height: 1.4;
    color: var(--lp-muted);
}

.lp-note--center {
    text-align: center;
}

.lp-alert {
    margin-top: clamp(0.6rem, 1.4vh, 1rem);
    padding: 0.6rem 0.8rem;
    border: 1px solid #f0d0cb;
    border-radius: 8px;
    background: #fdf2f0;
    color: #8c2f24;
    font-size: 0.84rem;
    line-height: 1.4;
}

.lp-alert a {
    color: inherit;
    font-weight: 600;
}

.lp-roles {
    margin-top: clamp(0.85rem, 2.1vh, 1.45rem);
}

.lp-roles-label {
    margin-bottom: clamp(0.3rem, 0.8vh, 0.45rem);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: var(--lp-label);
}

.lp-role-row {
    position: relative;
    display: flex;
    flex-wrap: nowrap;
    align-items: stretch;
    isolation: isolate;
    width: 100%;
    border: 1px solid var(--lp-line);
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
}

.lp-role-glider {
    position: absolute;
    z-index: 0;
    top: 0;
    left: 0;
    width: calc(100% / 3);
    height: 100%;
    background: rgba(var(--lp-accent-rgb), 0.1);
    box-shadow: inset 0 -2.5px 0 var(--lp-accent);
    pointer-events: none;
    transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.2s ease;
}

.lp-role-row[data-active="lawyer"] .lp-role-glider {
    transform: translateX(100%);
}

.lp-role-row[data-active="client"] .lp-role-glider {
    transform: translateX(200%);
}

.lp-role-row[data-active=""] .lp-role-glider,
.lp-role-row:not([data-active]) .lp-role-glider {
    opacity: 0;
}

.lp-role {
    position: relative;
    z-index: 1;
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: clamp(2.5rem, 6vh, 2.85rem);
    padding: 0.5rem 0.35rem;
    border: 0;
    border-right: 1px solid var(--lp-line);
    color: var(--lp-muted);
    font-size: 0.78rem;
    font-size: clamp(0.68rem, 3.05cqi, 0.84rem);
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: -0.015em;
    text-align: center;
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    background: transparent;
    transition: color 0.18s ease, background 0.18s ease;
}

.lp-role:last-child {
    border-right: 0;
}

.lp-role:hover:not(.is-active) {
    color: var(--lp-ink);
    background: #faf8f4;
}

.lp-role.is-active {
    color: var(--lp-accent-dark);
}

.lp-form {
    margin-top: clamp(0.8rem, 2vh, 1.35rem);
}

.lp-field + .lp-field {
    margin-top: clamp(0.55rem, 1.5vh, 1rem);
}

.lp-field label,
.lp-label-row label {
    display: block;
    margin-bottom: clamp(0.25rem, 0.7vh, 0.4rem);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    color: var(--lp-label);
}

.lp-label-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.lp-label-row label {
    margin-bottom: clamp(0.25rem, 0.7vh, 0.4rem);
}

.lp-field,
.lp-form,
.lp-roles {
    min-width: 0;
    max-width: 100%;
}

.lp-field input {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    height: clamp(42px, 6vh, 48px);
    padding: 0 0.9rem;
    border: 1px solid var(--lp-field);
    border-radius: 8px;
    background: #fff;
    color: var(--lp-ink);
    font: inherit;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.lp-field input::placeholder {
    color: #8d8478;
}

.lp-field input:focus {
    border-color: var(--lp-accent);
    box-shadow: 0 0 0 3px rgba(var(--lp-accent-rgb), 0.16);
}

.lp-password {
    position: relative;
}

.lp-password input {
    padding-right: 2.8rem;
}

.lp-eye {
    position: absolute;
    top: 50%;
    right: 0.3rem;
    width: 2.25rem;
    height: 2.25rem;
    display: grid;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #6d7886;
    cursor: pointer;
    transform: translateY(-50%);
}

.lp-eye:hover {
    color: var(--lp-ink);
}

.lp-eye svg {
    width: 18px;
    height: 18px;
}

.eye-icon.is-hidden {
    display: none;
}

.lp-forgot {
    margin-left: auto;
    margin-bottom: clamp(0.25rem, 0.7vh, 0.4rem);
    color: var(--lp-accent);
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}

.lp-forgot:hover {
    text-decoration: underline;
}

.lp-remember {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: clamp(0.65rem, 1.6vh, 0.95rem) 0 clamp(0.8rem, 1.9vh, 1.15rem);
    color: var(--lp-muted);
    font-size: 0.86rem;
    cursor: pointer;
}

.lp-remember input {
    width: 1rem;
    height: 1rem;
    margin: 0;
    flex-shrink: 0;
    accent-color: var(--lp-accent);
}

.lp-submit {
    width: 100%;
    height: clamp(42px, 6vh, 48px);
    border: 0;
    border-radius: 8px;
    background: var(--lp-accent);
    color: var(--lp-btn-text, #fff);
    font: inherit;
    font-size: 0.98rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    cursor: pointer;
    transition: background 0.15s ease;
}

.lp-submit:hover {
    background: var(--lp-accent-dark);
}

.lp-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.45rem;
    margin: clamp(0.8rem, 1.8vh, 1.25rem) 0 0;
    font-size: 0.84rem;
}

.lp-links a {
    color: var(--lp-ink);
    text-decoration: none;
    border-bottom: 1px solid rgba(20, 32, 51, 0.22);
}

.lp-links a:hover {
    border-bottom-color: var(--lp-ink);
}

.lp-links span {
    color: #b7afa4;
}

.lp-secure {
    margin: clamp(0.75rem, 1.8vh, 1.35rem) 0 0;
    text-align: center;
    font-size: 0.75rem;
    letter-spacing: 0.02em;
    color: #8a8176;
}

a:focus-visible,
button:focus-visible,
input:focus-visible {
    outline: 2px solid var(--lp-accent);
    outline-offset: 2px;
}

input:focus-visible {
    outline: none;
}

@media (min-width: 1280px) {
    .lp {
        grid-template-columns: minmax(280px, 460px) minmax(0, 1fr);
    }
}

/* Tablet and mobile: stack, then fill remaining height */
@media (max-width: 899px) {
    .lp {
        grid-template-columns: 1fr;
        grid-template-rows: auto minmax(0, 1fr);
    }

    .lp-aside {
        height: auto;
        align-items: stretch;
        padding: calc(0.85rem + env(safe-area-inset-top)) 1.1rem 0.9rem;
    }

    .lp-aside::after {
        top: auto;
        right: 0;
        left: 0;
        bottom: 0;
        width: auto;
        height: 1px;
        background: linear-gradient(90deg, transparent, var(--lp-brass), transparent);
    }

    .lp-aside-body {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr);
        grid-template-areas:
            "mark kicker"
            "mark firm"
            "note note"
            "points points";
        overflow: hidden;
        column-gap: 0.8rem;
        row-gap: 0.08rem;
        align-items: center;
        width: 100%;
        max-width: none;
    }

    .lp-mark,
    .lp-mark--logo {
        grid-area: mark;
        width: 48px;
        height: 48px;
        margin: 0;
        font-size: 1.15rem;
        align-self: center;
    }

    .lp-kicker-stack {
        grid-area: kicker;
        margin: 0;
    }

    .lp-firm {
        grid-area: firm;
        font-size: clamp(1.25rem, 4.6vw, 1.65rem);
    }

    .lp-aside-note {
        grid-area: note;
        max-width: none;
        margin-top: 0.45rem;
        font-size: 0.8rem;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .lp-banner-points-stack {
        grid-area: points;
        max-width: none;
        margin-top: 0.5rem;
    }

    .lp-banner-points {
        display: grid;
        gap: 0.28rem;
        max-width: none;
    }

    .lp-banner-points li {
        font-size: 0.78rem;
    }

    .lp-banner-points li + li {
        margin-top: 0;
    }

    .lp-main {
        height: auto;
        align-items: stretch;
        justify-content: flex-start;
        padding: 0.85rem 1.1rem calc(0.95rem + env(safe-area-inset-bottom));
        overflow: auto;
    }

    .lp-lang {
        position: static;
        align-self: flex-end;
        margin-bottom: 0.65rem;
        top: auto;
        right: auto;
    }

    .lp-sheet {
        width: 100%;
        max-width: 32rem;
        margin: 0 auto;
        flex: 1 1 auto;
        display: flex;
        flex-direction: column;
        justify-content: center;
        min-height: 0;
    }
}

/* Tablet landscape: keep two columns so the form stays on one screen */
@media (max-width: 899px) and (min-width: 700px) and (orientation: landscape) {
    .lp {
        grid-template-columns: minmax(220px, 40%) minmax(0, 1fr);
        grid-template-rows: minmax(0, 1fr);
    }

    .lp-aside {
        height: 100%;
        max-height: none;
        align-items: center;
        padding: clamp(0.9rem, 3vh, 1.75rem) clamp(0.9rem, 2vw, 1.5rem);
    }

    .lp-aside::after {
        top: 0;
        right: 0;
        bottom: 0;
        left: auto;
        width: 1px;
        height: auto;
        background: linear-gradient(180deg, transparent, var(--lp-brass), transparent);
    }

    .lp-aside-body {
        display: block;
        width: min(100%, 20rem);
    }

    .lp-mark,
    .lp-mark--logo {
        width: clamp(44px, 8vh, 52px);
        height: clamp(44px, 8vh, 52px);
        margin: 0 0 0.75rem;
    }

    .lp-kicker-stack {
        margin: 0 0 0.4rem;
    }

    .lp-kicker {
        margin: 0;
    }

    .lp-firm {
        font-size: clamp(1.4rem, 4vh, 1.85rem);
    }

    .lp-aside-note {
        display: block;
        -webkit-line-clamp: unset;
        margin-top: 0.55rem;
    }

    .lp-banner-points-stack {
        margin-top: 0.65rem;
    }

    .lp-banner-points {
        display: block;
    }

    .lp-banner-points li + li {
        margin-top: 0.35rem;
    }

    .lp-main {
        height: 100%;
        align-items: center;
        justify-content: center;
        padding: 2.4rem 1.15rem 1rem;
    }

    .lp-lang {
        position: absolute;
        top: 0.9rem;
        right: 1.1rem;
        margin-bottom: 0;
    }

    .lp-sheet {
        width: min(100%, 26.5rem);
        flex: 0 1 auto;
        display: block;
    }
}

@media (max-width: 480px) {
    .lp-aside {
        padding-inline: 0.95rem;
    }

    .lp-main {
        padding-inline: 0.95rem;
    }

    .lp-role {
        padding-inline: 0.2rem;
        font-size: clamp(0.66rem, 3.4cqi, 0.78rem);
    }

    .lp-field input,
    .lp-submit {
        height: 44px;
    }
}

@media (max-height: 740px) {
    .lp-title {
        font-size: clamp(1.4rem, 3.4vh, 1.85rem);
    }

    .lp-secure {
        margin-top: 0.7rem;
    }
}

@media (max-width: 899px) and (max-height: 700px) {
    .lp-aside-note {
        margin-top: 0.3rem;
        font-size: 0.76rem;
    }

    .lp-banner-points-stack {
        margin-top: 0.35rem;
    }

    .lp-banner-points {
        gap: 0.18rem;
    }

    .lp-banner-points li {
        font-size: 0.74rem;
        line-height: 1.3;
    }
}

@media (max-height: 560px) {
    .lp-mark,
    .lp-mark--logo {
        width: 40px;
        height: 40px;
        margin-bottom: 0.5rem;
    }

    .lp-field input,
    .lp-submit {
        height: 40px;
    }

    .lp-remember {
        margin: 0.45rem 0 0.6rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .lp-swap-layer,
    .lp-role,
    .lp-role-glider {
        transition: none;
    }
}
