﻿/* Login flow dialog. Uses the shared popup overlay and site fonts. */
.login-flow-popup {
    display: none;
    position: relative;
    width: min(362px, calc(100% - 32px));
    flex-shrink: 0;
    margin: 80px auto 24px;
    align-self: flex-start;
    box-sizing: border-box;
    border: 1px solid rgba(65, 60, 55, 0.3);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.88);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    color: #242424;
    text-align: start;
    direction: rtl;
    font-family: 'NotoSansHebrew', 'NunitoSans', 'Open Sans', 'Open Sans Global', Arial;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8), 0 8px 28px rgba(0, 0, 0, 0.1), 0 1px 3px rgba(0, 0, 0, 0.06);
}

.login-flow-main {
    position: relative;
    padding: 20px;
}

.login-flow-close {
    position: absolute;
    inset-inline-end: 14px;
    top: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 4px;
    margin: 0;
    border: 0;
    font: inherit;
    appearance: none;
    box-sizing: border-box;
    color: #777471;
    border-radius: 50%;
    background: rgba(60, 50, 45, 0.06);
    cursor: pointer;
}

.login-flow-close svg { width: 14px; height: 14px; }

/* Enlarge the touch target to 44px while retaining the visible 28px circle. */
.login-flow-close::before {
    content: "";
    position: absolute;
    inset: -8px;
    border-radius: inherit;
}

.login-flow-close:focus-visible {
    outline: 2px solid #93908c;
    outline-offset: 4px;
}

.login-flow-popup h2 {
    padding: 0;
    margin: 0 0 8px;
    font-size: 20px;
    font-weight: 600;
    line-height: 26px;
    letter-spacing: normal;
}

.login-flow-description {
    padding: 0;
    margin: 0 0 20px;
    color: #777471;
    font-size: 14px;
    font-weight: 400;
    line-height: 20px;
}

.login-flow-label {
    color: #55514e;
    transition: color 160ms ease;
    display: block;
    padding: 0;
    margin: 0 0 8px;
    font-size: 14px;
    font-weight: 600;
    line-height: 20px;
}

.login-flow-input {
    display: block;
    width: 100%;
    height: 44px;
    box-sizing: border-box;
    margin: 0;
    padding: 0 14px;
    border: 1px solid rgba(80, 70, 60, 0.24);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.45);
    color: inherit;
    font: inherit;
    font-size: 16px;
    line-height: normal;
    direction: ltr;
    text-align: start;
    box-shadow: none;
    transition: border-color 160ms ease;
}

.login-flow-input::placeholder { color: #95918d; }
.login-flow-input:focus { outline: none; border-color: #93908c; }

.login-flow-continue {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    height: 44px;
    box-sizing: border-box;
    margin: 16px 0 0;
    padding: 0 12px;
    border: 0;
    border-radius: 12px;
    font: inherit;
    font-size: 17px;
    font-weight: 600;
    line-height: 22px;
    cursor: pointer;
    background: #242424;
    color: #ffffff;
}

.login-flow-continue:disabled {
    opacity: 0.6;
    cursor: wait;
}

.login-flow-popup[aria-busy="true"] #login-flow-forgot-password:disabled,
.login-flow-popup[aria-busy="true"] #login-flow-resend:disabled { cursor: wait; }

@media (max-height: 480px) {
    .login-flow-popup { margin: 16px auto; }
}

.login-flow-continue svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    stroke-width: 1.8;
}

#login-flow-code-phone { font-weight: 600; color: #242424; }

.login-flow-code-inputs {
    position: relative;
}

.login-flow-code-cells {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 10px;
    margin: 0;
}

.login-flow-code-cells span {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-width: 0;
    height: 44px;
    padding: 0;
    margin: 0;
    box-sizing: border-box;
    border: 1px solid #d5d2cf;
    border-radius: 9px;
    background: transparent;
    color: inherit;
    font: inherit;
    font-size: 22px;
    font-weight: 600;
    text-align: center;
    outline: none;
    transition: border-color 160ms ease;
}

.login-flow-code-cells span.is-active { border-color: #242424; }

.login-flow-code-actions {
    display: flex;
    justify-content: flex-start;
    margin-top: 20px;
}

#login-flow-resend {
    padding: 0;
    margin: 0;
    border: 0;
    background: transparent;
    color: #55514e;
    font: inherit;
    font-size: 14px;
    font-weight: 400;
    line-height: 22px;
    cursor: pointer;
}

#login-flow-resend:disabled { color: #96918d; cursor: default; }
#login-flow-resend:not(:disabled) { text-decoration: none; }

.login-flow-close span { display: flex; }
.login-flow-close .login-flow-back-icon { display: none; }
.login-flow-popup.is-code-step .login-flow-close .login-flow-close-icon { display: none; }
.login-flow-popup.is-code-step .login-flow-close .login-flow-back-icon { display: flex; }
#login-flow-phone-step,
#login-flow-code-step,
#login-flow-name-step,
#login-flow-password-step,
#login-flow-new-password-step { padding-top: 32px; }

.login-flow-enter { animation: login-flow-enter 200ms ease-out 40ms both; }
.login-flow-leave { animation: login-flow-leave 180ms ease-in-out both; }
.login-flow-overlay {
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
    animation: login-flow-overlay-enter 200ms ease-out both;
}
.login-flow-overlay.login-flow-overlay-leave { animation: login-flow-overlay-leave 180ms ease-in-out both; }

@keyframes login-flow-enter {
    from { opacity: 0; transform: translateY(-8px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes login-flow-leave {
    from { opacity: 1; transform: translateY(0) scale(1); }
    to { opacity: 0; transform: translateY(-6px) scale(0.98); }
}

@keyframes login-flow-overlay-enter {
    from { background-color: rgba(0, 0, 0, 0); -webkit-backdrop-filter: blur(0); backdrop-filter: blur(0); }
    to { background-color: rgba(0, 0, 0, 0.4); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); }
}

@keyframes login-flow-overlay-leave {
    from { background-color: rgba(0, 0, 0, 0.4); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); }
    to { background-color: rgba(0, 0, 0, 0); -webkit-backdrop-filter: blur(0); backdrop-filter: blur(0); }
}

#login-flow-code-input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 44px;
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: transparent;
    caret-color: transparent;
    -webkit-text-fill-color: transparent;
    font: inherit;
    font-size: 16px;
    outline: none;
    box-shadow: none;
    direction: ltr;
}

#login-flow-code-input::selection { background: transparent; }

.login-flow-code-cells span.is-active:empty::after {
    content: "";
    position: absolute;
    top: 12px;
    bottom: 12px;
    left: 50%;
    border-left: 1px solid currentColor;
    pointer-events: none;
    animation: login-code-caret 1s step-end infinite;
}

@keyframes login-code-caret {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.login-flow-popup [id$="-step"]:has(.login-flow-input:focus) .login-flow-label { color: #242424; }

#login-flow-phone-error,
#login-flow-code-error,
#login-flow-name-error,
#login-flow-password-error,
#login-flow-new-password-error {
    display: grid;
    grid-template-rows: 0fr;
    margin-top: 0;
    opacity: 0;
    color: #bb4545;
    font-size: 14px;
    font-weight: 400;
    line-height: 20px;
    text-align: start;
    transition: grid-template-rows 180ms ease, margin-top 180ms ease, opacity 180ms ease;
}

#login-flow-phone-error > span,
#login-flow-code-error > span,
#login-flow-name-error > span,
#login-flow-password-error > span,
#login-flow-new-password-error > span {
    min-height: 0;
    overflow: hidden;
}

#login-flow-phone-step.has-phone-error #login-flow-phone-error,
#login-flow-code-step.has-code-error #login-flow-code-error,
#login-flow-name-step.has-name-error #login-flow-name-error,
#login-flow-password-step.has-password-error #login-flow-password-error,
#login-flow-new-password-step.has-new-password-error #login-flow-new-password-error {
    grid-template-rows: 1fr;
    margin-top: 7px;
    opacity: 1;
}

#login-flow-phone-step .login-flow-continue {
    transition: margin-top 180ms ease;
}

#login-flow-phone-step.has-phone-error #login-flow-phone {
    border-color: #c65a5a;
}

#login-flow-phone-step.has-phone-error .login-flow-continue { margin-top: 12px; }

#login-flow-code-step.has-code-error .login-flow-code-cells span { border-color: #c65a5a; }

#login-flow-success-step {
    padding: 24px 0;
    text-align: center;
}

#login-flow-success-step h2 { margin: 0; }
.login-flow-popup.is-success-step .login-flow-close { visibility: hidden; }

.login-flow-success-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    margin: 0 auto 18px;
    border-radius: 50%;
    background: rgba(0, 158, 111, 0.1);
    color: #15966d;
}

.login-flow-success-icon svg { width: 30px; height: 30px; stroke-width: 2; }

#login-flow-name { direction: inherit; }

#login-flow-name-step.has-name-error #login-flow-name { border-color: #c65a5a; }

#login-flow-password-step h2,
#login-flow-new-password-step h2 { margin-bottom: 20px; }
#login-flow-password-step.has-password-error #login-flow-password { border-color: #c65a5a; }

#login-flow-new-password-step.has-new-password-error #login-flow-new-password { border-color: #c65a5a; }

#login-flow-forgot-password {
    display: block;
    margin: 10px 0 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: #777471;
    font: inherit;
    font-size: 14px;
    font-weight: 400;
    line-height: 22px;
    cursor: pointer;
}

/* Keep the label and replace the action arrow while the request is pending. */
.login-flow-popup button.is-loading::after {
    content: "";
    display: inline-block;
    width: 18px;
    height: 18px;
    box-sizing: border-box;
    flex-shrink: 0;
    border: 2px solid currentColor;
    border-inline-end-color: transparent;
    border-radius: 50%;
    animation: login-flow-button-spin 700ms linear infinite;
}

.login-flow-continue.is-loading > svg,
.login-flow-continue.is-loading > i { display: none; }

#login-flow-forgot-password,
#login-flow-resend { position: relative; }

#login-flow-forgot-password.is-loading::after,
#login-flow-resend.is-loading::after {
    position: absolute;
    inset-inline-end: -26px;
    top: calc(50% - 9px);
}

@keyframes login-flow-button-spin {
    to { transform: rotate(360deg); }
}

.login-flow-popup[dir="ltr"] { direction: ltr; }
.login-flow-popup[dir="ltr"] .login-flow-continue > svg,
.login-flow-popup[dir="ltr"] .login-flow-back-icon > svg { transform: scaleX(-1); }
