/* --- SIGN IN PAGE LAYOUT OVERRIDES --- */
html:has(.boh-sign-in),
body:has(.boh-sign-in) {
    height: 100%;
    overflow-y: auto;
}

    body:has(.boh-sign-in) .boh-shell {
        min-height: 100vh;
        min-height: 100dvh;
        display: flex;
        flex-direction: column;
    }

    body:has(.boh-sign-in) .boh-shell__header,
    body:has(.boh-sign-in) .boh-shell__bottom {
        display: none;
    }

    body:has(.boh-sign-in) .boh-shell__main {
        flex: 1;
        padding-left: 0;
        padding-right: 0;
    }

/* --- ROOT CONTAINER --- */
.boh-sign-in {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
    /* background-color: var(--boh-color-primary); */ /* Teal Deep */
    color: var(--boh-color-surface);
    font-family: var(--boh-font-sans);
    overflow: hidden;
    background-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.2) 0%, transparent 50%, rgba(21, 54, 47, 0.9) 100%);
    background: linear-gradient(to bottom, rgba(38, 86, 77, 0.5) 0%, var(--boh-color-primary) 50%, var(--boh-color-primary) 100%);
}

.boh-sign-in.is-booting .boh-sign-in__lang-btn,
.boh-sign-in.is-booting .boh-sign-in__logo-wrapper,
.boh-sign-in.is-booting .boh-sign-in__header,
.boh-sign-in.is-booting .boh-sign-in__subtext,
.boh-sign-in.is-booting .boh-sign-in__phone-display,
.boh-sign-in.is-booting #numpad-form,
.boh-sign-in.is-booting .boh-sign-in__footer-links,
.boh-sign-in.is-booting .boh-sign-in__social-row {
    opacity: 0;
    transform: translateY(16px) scale(0.985);
}

.boh-sign-in.is-ready .boh-sign-in__lang-btn,
.boh-sign-in.is-ready .boh-sign-in__logo-wrapper,
.boh-sign-in.is-ready .boh-sign-in__header,
.boh-sign-in.is-ready .boh-sign-in__subtext,
.boh-sign-in.is-ready .boh-sign-in__phone-display,
.boh-sign-in.is-ready #numpad-form,
.boh-sign-in.is-ready .boh-sign-in__footer-links,
.boh-sign-in.is-ready .boh-sign-in__social-row {
    opacity: 1;
    transform: translateY(0) scale(1);
    transition: opacity 0.58s cubic-bezier(0.19, 0.86, 0.24, 1), transform 0.62s cubic-bezier(0.19, 0.86, 0.24, 1);
}

.boh-sign-in.is-ready .boh-sign-in__lang-btn {
    transition-delay: 40ms;
}

.boh-sign-in.is-ready .boh-sign-in__logo-wrapper {
    transition-delay: 90ms;
}

.boh-sign-in.is-ready .boh-sign-in__header {
    transition-delay: 140ms;
}

.boh-sign-in.is-ready .boh-sign-in__subtext {
    transition-delay: 190ms;
}

.boh-sign-in.is-ready .boh-sign-in__phone-display {
    transition-delay: 250ms;
}

.boh-sign-in.is-ready #numpad-form {
    transition-delay: 310ms;
}

.boh-sign-in.is-ready .boh-sign-in__footer-links {
    transition-delay: 390ms;
}

.boh-sign-in.is-ready .boh-sign-in__social-row {
    transition-delay: 450ms;
}

.boh-sign-in.is-loading {
    cursor: progress;
}

.boh-sign-in.is-loading .boh-sign-in__main {
    pointer-events: none;
}

.boh-sign-in__loading-overlay {
    position: absolute;
    inset: 0;
    z-index: 40;
    display: grid;
    place-items: center;
    padding: 1rem;
    background:
        radial-gradient(circle at 18% 12%, rgba(199, 232, 220, 0.22), transparent 38%),
        radial-gradient(circle at 82% 88%, rgba(104, 156, 139, 0.2), transparent 44%),
        rgba(10, 35, 31, 0.56);
    backdrop-filter: blur(12px) saturate(112%);
    -webkit-backdrop-filter: blur(12px) saturate(112%);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(14px);
    transition: opacity 0.38s cubic-bezier(0.2, 0.9, 0.2, 1), visibility 0.38s ease, transform 0.38s cubic-bezier(0.2, 0.9, 0.2, 1);
}

.boh-sign-in__loading-overlay::before,
.boh-sign-in__loading-overlay::after {
    content: "";
    position: absolute;
    border-radius: 999px;
    filter: blur(2px);
    pointer-events: none;
}

.boh-sign-in__loading-overlay::before {
    width: 42vmin;
    height: 42vmin;
    top: 10%;
    right: -14%;
    background: radial-gradient(circle, rgba(201, 232, 220, 0.2) 0%, rgba(201, 232, 220, 0) 70%);
    animation: boh-sign-in-overlay-drift 7s ease-in-out infinite;
}

.boh-sign-in__loading-overlay::after {
    width: 36vmin;
    height: 36vmin;
    bottom: 4%;
    left: -10%;
    background: radial-gradient(circle, rgba(138, 188, 169, 0.18) 0%, rgba(138, 188, 169, 0) 72%);
    animation: boh-sign-in-overlay-drift 8.4s ease-in-out infinite reverse;
}

.boh-sign-in.is-loading .boh-sign-in__loading-overlay {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
}

.boh-sign-in__loading-card {
    width: min(320px, calc(100% - 1rem));
    border-radius: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    padding: 0.75rem 0.5rem 0.5rem;
    display: grid;
    justify-items: center;
    text-align: center;
    gap: 0.56rem;
    transform: translateY(18px) scale(0.98);
    opacity: 0;
}

.boh-sign-in.is-loading .boh-sign-in__loading-card {
    animation: boh-sign-in-card-in 0.52s cubic-bezier(0.17, 0.86, 0.24, 1) forwards;
}

.boh-sign-in.is-loading-slow .boh-sign-in__loading-card {
    animation: boh-sign-in-card-in 0.52s cubic-bezier(0.17, 0.86, 0.24, 1) forwards;
}

.boh-sign-in__loading-emblem {
    width: 58px;
    height: 58px;
    display: grid;
    place-items: center;
    margin-bottom: 0.08rem;
}

.boh-sign-in__loading-spinner {
    position: relative;
    width: 52px;
    height: 52px;
    display: block;
    border-radius: 50%;
    border: 2px solid rgba(235, 245, 240, 0.2);
    border-top-color: rgba(247, 251, 249, 0.96);
    border-right-color: rgba(210, 232, 223, 0.78);
    animation: boh-sign-in-spin 1.1s linear infinite;
}

.boh-sign-in__loading-spinner::after {
    content: "";
    position: absolute;
    inset: 10px;
    border-radius: 50%;
    background: rgba(238, 247, 243, 0.2);
}

.boh-sign-in__loading-title {
    margin: 0;
    color: var(--boh-color-bg);
    font-family: var(--boh-font-serif);
    font-size: 25px;
    font-weight: var(--boh-font-weight-700);
    line-height: 1.08;
    letter-spacing: -0.015em;
}

.boh-sign-in__loading-text {
    margin: 0;
    color: rgba(245, 242, 234, 0.88);
    font-size: 14px;
    font-weight: var(--boh-font-weight-600);
    line-height: 1.35;
    min-height: 1.2em;
    transition: opacity 0.26s ease, transform 0.26s ease;
}

.boh-sign-in__loading-text.is-updating {
    opacity: 0;
    transform: translateY(4px);
}

.boh-sign-in__loading-progress {
    width: min(250px, 100%);
    height: 2px;
    margin-top: 0.1rem;
    border-radius: 999px;
    background: rgba(238, 247, 242, 0.2);
    overflow: hidden;
}

.boh-sign-in__loading-progress-bar {
    display: block;
    width: 36%;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, rgba(226, 243, 236, 0), rgba(241, 251, 246, 0.96), rgba(189, 222, 208, 0.36));
    animation: boh-sign-in-progress-sweep 1.35s cubic-bezier(0.35, 0, 0.25, 1) infinite;
}

/* --- BACKGROUND OVERLAY --- */
.boh-sign-in__bg-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(50, 110, 100, 0.4) 0%, transparent 100%);
    pointer-events: none;
    z-index: 0;
}

/* --- LANGUAGE TOGGLE --- */
.boh-sign-in__lang-btn {
    position: absolute;
    top: 3rem;
    left: 1rem;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 0.375rem;
    border-radius: 9999px;
    padding: 0.5rem 0.75rem;
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--boh-color-surface);
    font-size: 13px;
    font-weight: var(--boh-font-weight-700);
    cursor: pointer;
    outline: none;
    transition: transform 0.15s ease, background-color 0.2s;
}

    .boh-sign-in__lang-btn:active {
        transform: scale(0.95);
        background-color: rgba(255, 255, 255, 0.2);
    }

    .boh-sign-in__lang-btn svg {
        width: 1rem;
        height: 1rem;
    }

/* --- MAIN CONTAINER --- */
.boh-sign-in__main {
    position: relative;
    z-index: 10;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-left: var(--boh-space-screen);
    padding-right: var(--boh-space-screen);
    padding-top: 3rem; /* pt-12 */
    box-sizing: border-box;
}

/* --- LOGO --- */
.boh-sign-in__logo-wrapper {
    margin-bottom: 1.2rem;
}

.boh-sign-in__logo {
    width: 150px;
    height: auto;
}

/* --- HEADER ACTIONS --- */
.boh-sign-in__header {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.boh-sign-in__back-btn {
    padding: 0.5rem;
    margin-left: -0.5rem;
    color: var(--boh-color-surface);
    position: absolute;
    left: 0;
    display: flex;
    align-items: center;
    background: transparent;
    border: none;
    cursor: pointer;
}

    .boh-sign-in__back-btn svg {
        width: 1.5rem;
        height: 1.5rem;
    }

.boh-sign-in__title {
    font-family: var(--boh-font-serif);
    color: var(--boh-color-bg);
    font-size: 28px;
    font-weight: var(--boh-font-weight-800);
    margin: 0;
}

.boh-sign-in__subtext {
    font-size: 13px;
    color: var(--boh-color-bg);
    text-align: center;
    max-width: 320px;
    margin: 0 0 0.7rem 0;
    line-height: 1.2;
}

/* --- PHONE INPUT DISPLAY --- */
.boh-sign-in__phone-display {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    color: var(--boh-color-gold-light);
    font-size: 28px;
    font-weight: var(--boh-font-weight-800);
    letter-spacing: 0.06em;
    border-bottom: 0px solid rgba(255, 255, 255, 0.38);
    min-width: 90%;
    height: 60px;
    box-sizing: border-box;
    font-family: auto;
    backdrop-filter: blur(4px);
    /* background: rgb(21 54 47 / 12%); */
    border-radius: 12px;
}

.boh-sign-in__phone-display.is-loading {
    position: relative;
}

.boh-sign-in__phone-display.is-loading::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.48);
    animation: boh-sign-in-phone-pulse 1.1s ease-in-out infinite;
}

.boh-sign-in__phone-placeholder {
    color: rgba(255, 255, 255, 0.3);
}

/* --- NUMPAD GRID --- */
.boh-sign-in__numpad {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.625rem;
    width: 100%;
    max-width: 264px;
}

.boh-sign-in__numpad-key {
    background-color: var(--boh-color-surface);
    color: var(--boh-color-bg);
    font-size: 36px;
    height: 72px;
    border-radius: 12px;
    border: 1px solid rgb(254 246 221 / 0%);
    cursor: pointer;
    transition: transform 0.12s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast) 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #f5f2ea52 0%, #f5f2ea73 100%);
    font-family: var(--boh-font-serif);
    font-weight: 900;
    backdrop-filter: blur(2px);
    padding-bottom: 8px;
}

.boh-sign-in__numpad-key::before {
    content: "";
    position: absolute;
    top: -36%;
    left: -62%;
    width: 46%;
    height: 200%;
    transform: rotate(18deg);
    background: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.46), rgba(255, 255, 255, 0));
    opacity: 0;
}

.boh-sign-in__numpad-key:active::before {
    animation: boh-sign-in-key-sheen 0.45s ease;
}

.boh-sign-in__numpad-key:disabled,
.boh-sign-in__numpad-delete:disabled,
.boh-sign-in__numpad-next:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

    .boh-sign-in__numpad-key:active {
        transform: scale(0.96);
    }

.boh-sign-in__numpad-action {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 72px;
}

.boh-sign-in__numpad-next {
    min-width: 100%;
    height: 62px;
    border-radius: 12px;
    border: 0;
    color: var(--boh-color-bg);
    font-weight: var(--boh-font-weight-700);
    font-size: 12px;
    text-transform: uppercase;
    background: 0;
    cursor: pointer;
    transition: transform 0.12s ease;
    white-space: nowrap;
}

    .boh-sign-in__numpad-next:active {
        transform: scale(0.96);
    }

.boh-sign-in__numpad-delete {
    color: var(--boh-color-bg);
    background: transparent;
    border: none;
    border-radius: 0;
    cursor: pointer;
    width: 100%;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.12s ease;
}

    .boh-sign-in__numpad-delete:active {
        transform: scale(0.96);
    }

    .boh-sign-in__numpad-delete svg {
        width: 1.5rem;
        height: 1.5rem;
    }

/* --- FOOTER SECTIONS --- */
.boh-sign-in__footer-links {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: rgba(255, 255, 255, 0.8);
    font-size: var(--boh-font-size-label);
    margin-top: auto;
    padding-top: 1.5rem;
    margin-bottom: 1.25rem;
}

.boh-sign-in__footer-link-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: transparent;
    border: none;
    color: inherit;
    font-size: inherit;
    cursor: pointer;
}

    .boh-sign-in__footer-link-btn svg {
        width: 1rem;
        height: 1rem;
    }

/* --- SOCIAL CIRCLES --- */
.boh-sign-in__social-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}

.boh-sign-in__social-btn {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--boh-color-surface);
    background: transparent;
    cursor: pointer;
}

    .boh-sign-in__social-btn svg {
        width: 1rem;
        height: 1rem;
    }

    @keyframes boh-sign-in-spin {
        to {
            transform: rotate(360deg);
        }
    }

    @keyframes boh-sign-in-overlay-drift {
        0%,
        100% {
            transform: translate3d(0, 0, 0) scale(1);
            opacity: 0.7;
        }

        50% {
            transform: translate3d(0, -10px, 0) scale(1.05);
            opacity: 1;
        }
    }

    @keyframes boh-sign-in-card-in {
        0% {
            transform: translateY(18px) scale(0.98);
            opacity: 0;
        }

        100% {
            transform: translateY(0) scale(1);
            opacity: 1;
        }
    }

    @keyframes boh-sign-in-progress-sweep {
        0% {
            transform: translateX(-120%);
        }

        100% {
            transform: translateX(240%);
        }
    }

    @keyframes boh-sign-in-phone-pulse {
        0%,
        100% {
            opacity: 0.28;
        }

        50% {
            opacity: 0.86;
        }
    }

    @keyframes boh-sign-in-key-sheen {
        0% {
            left: -62%;
            opacity: 0;
        }

        20% {
            opacity: 0.75;
        }

        100% {
            left: 136%;
            opacity: 0;
        }
    }

@media (prefers-reduced-motion: reduce) {
    .boh-sign-in,
    .boh-sign-in *,
    .boh-sign-in *::before,
    .boh-sign-in *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* --- DEMO ACCOUNTS SECTIONS --- */
