.client-auth-modal {
    position: fixed;
    z-index: 1090;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(15, 25, 22, .62);
    opacity: 0;
    visibility: hidden;
    transition: opacity .22s ease, visibility .22s ease;
}

.client-auth-modal.is-open {
    opacity: 1;
    visibility: visible;
}

.client-auth-modal__dialog {
    position: relative;
    display: grid;
    --client-auth-panel-size: min(52vw, 680px, calc(100dvh - 48px));
    grid-template-columns: minmax(0, 1fr) var(--client-auth-panel-size);
    width: min(1200px, 100%);
    height: var(--client-auth-panel-size);
    overflow: hidden;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 24px 80px rgba(0, 0, 0, .28);
    transform: translateY(14px) scale(.985);
    transition: transform .22s ease;
}

.client-auth-modal.is-open .client-auth-modal__dialog {
    transform: translateY(0) scale(1);
}

.client-auth-modal__form-panel {
    min-width: 0;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
}

.client-auth-view__content {
    width: min(100%, 440px);
    margin: 0 auto;
    padding: 46px 48px 36px;
}

.client-auth-modal__brand {
    display: inline-flex;
    align-items: center;
    margin-bottom: 24px;
}

.client-auth-modal__brand img {
    display: block;
    width: auto;
    max-width: 142px;
    max-height: 48px;
    object-fit: contain;
}

.client-auth-view h2 {
    margin: 0 38px 9px 0;
    color: #17211e;
    font-size: clamp(1.45rem, 3vw, 1.8rem);
    font-weight: 700;
    line-height: 1.2;
}

.client-auth-modal__intro {
    margin: 0 0 23px;
    color: #6b7773;
    font-size: .94rem;
    line-height: 1.55;
}

.client-auth-modal__close {
    position: absolute;
    z-index: 2;
    top: 14px;
    right: 14px;
    display: grid;
    width: 38px;
    height: 38px;
    place-items: center;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .92);
    color: #34443e;
    font-size: 1.75rem;
    line-height: 1;
    box-shadow: 0 2px 12px rgba(0, 0, 0, .12);
    cursor: pointer;
}

.client-auth-modal__close:hover {
    background: #edf3f0;
}

.client-auth-modal__visual {
    position: relative;
    width: 100%;
    min-height: 0;
    aspect-ratio: 1;
    overflow: hidden;
    background: #395b50;
}

.client-auth-modal__visual::after {
    position: absolute;
    inset: 35% 0 0;
    background: linear-gradient(transparent, rgba(14, 34, 27, .78));
    content: "";
}

.client-auth-modal__visual video {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.client-auth-modal__visual-copy {
    position: absolute;
    z-index: 1;
    right: 30px;
    bottom: 32px;
    left: 30px;
    color: #fff;
}

.client-auth-modal__visual-copy span {
    font-size: 1.75rem;
    font-weight: 700;
}

.client-auth-modal__visual-copy p {
    margin: 5px 0 0;
    font-size: 1rem;
}

.client-auth-modal .client-auth-field {
    margin-bottom: 15px;
}

.client-auth-modal .client-auth-field > label {
    display: block;
    margin-bottom: 6px;
    color: #293630;
    font-size: .88rem;
    font-weight: 600;
}

.client-auth-modal .client-auth-field > input,
.client-auth-modal .client-auth-password input {
    width: 100%;
    min-height: 47px;
    padding: 10px 13px;
    border: 1px solid #d9e0dc;
    border-radius: 8px;
    background: #fff;
    color: #202a26;
    font-size: 1rem;
    box-shadow: none;
}

.client-auth-modal .client-auth-field > input:focus,
.client-auth-modal .client-auth-password input:focus {
    border-color: #395b50;
    outline: 0;
    box-shadow: 0 0 0 3px rgba(57, 91, 80, .13);
}

.client-auth-password {
    position: relative;
}

.client-auth-modal .client-auth-password input {
    padding-right: 48px;
}

.client-auth-password button {
    position: absolute;
    top: 0;
    right: 0;
    display: grid;
    width: 46px;
    height: 47px;
    place-items: center;
    border: 0;
    background: transparent;
    color: #66746e;
}

.client-auth-options {
    display: flex;
    justify-content: flex-end;
    margin: -3px 0 15px;
    font-size: .88rem;
}

.client-auth-modal a,
.client-auth-switch button {
    color: #395b50;
    font-weight: 600;
    text-decoration: none;
}

.client-auth-modal a:hover,
.client-auth-switch button:hover {
    color: #263f36;
    text-decoration: underline;
}

.client-auth-submit {
    display: flex;
    width: 100%;
    min-height: 48px;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border: 0;
    border-radius: 8px;
    background: #395b50;
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
    transition: background-color .15s ease;
}

.client-auth-submit:hover {
    background: #2d493f;
}

.client-auth-submit:disabled {
    cursor: wait;
    opacity: .75;
}

.client-auth-spinner {
    display: none;
    width: 17px;
    height: 17px;
    border: 2px solid rgba(255, 255, 255, .45);
    border-top-color: #fff;
    border-radius: 50%;
    animation: client-auth-spin .7s linear infinite;
}

.client-auth-submit.is-loading .client-auth-spinner {
    display: inline-block;
}

@keyframes client-auth-spin {
    to { transform: rotate(360deg); }
}

.client-auth-switch {
    margin: 20px 0 0;
    color: #66746e;
    font-size: .88rem;
    text-align: center;
}

.client-auth-switch button {
    padding: 0;
    border: 0;
    background: none;
    cursor: pointer;
}

.client-auth-field__error {
    min-height: 0;
    margin-top: 4px;
    color: #b42318;
    font-size: .82rem;
}

.client-auth-field.has-error input {
    border-color: #c9372c;
}

.client-auth-message,
.client-auth-notice {
    margin: 0 0 15px;
    padding: 10px 12px;
    border-radius: 7px;
    font-size: .9rem;
}

.client-auth-message {
    background: #fcebea;
    color: #9c251d;
}

.client-auth-message--success,
.client-auth-notice--success {
    background: #eaf4ee;
    color: #285d43;
}

.client-auth-modal .google-auth-button {
    min-height: 45px;
    border-radius: 8px;
    font-size: .92rem;
}

.client-auth-modal .google-auth-divider {
    margin: 14px 0;
    font-size: .82rem;
}

body.client-auth-modal-open {
    overflow: hidden;
}

@media (max-width: 767.98px) {
    .client-auth-modal {
        padding: 12px;
        align-items: start;
        overflow-y: auto;
    }

    .client-auth-modal__dialog {
        display: block;
        width: min(540px, 100%);
        height: min(760px, calc(100dvh - 24px));
        margin: auto;
        border-radius: 14px;
    }

    .client-auth-modal__form-panel {
        height: 100%;
    }

    .client-auth-modal__visual {
        display: none;
    }

    .client-auth-view__content {
        padding: 36px 25px 28px;
    }

    .client-auth-modal__brand {
        margin-bottom: 18px;
    }

    .client-auth-modal__close {
        position: sticky;
        float: right;
        top: 10px;
        right: 10px;
        margin: 10px 10px -48px 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .client-auth-modal,
    .client-auth-modal__dialog {
        transition: none;
    }
}
