/**
 * Owleys Account Access
 * Checkout V2-aligned account gateway styles.
 *
 * @author Igor Yakushev <https://igor-ya.ru/>
 * @since 2026-09
 */

.owleys-access {
    width: min(100% - 32px, 520px);
    max-width: 520px;
    max-height: min(820px, calc(100dvh - 32px));
    margin: auto;
    padding: 0;
    overflow: auto;
    color: #171717;
    background: transparent;
    border: 0;
    border-radius: 24px;
    box-shadow: 0 24px 80px rgba(23, 23, 23, .24);
}

.owleys-access::backdrop {
    background: rgba(23, 23, 23, .52);
    backdrop-filter: blur(3px);
}

html.owleys-access-open,
html.owleys-access-open body {
    overflow: hidden;
    overscroll-behavior: none;
}

.owleys-access[open] {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 100000;
}

.owleys-access__surface {
    position: relative;
    padding: 36px;
    background: #fbf8f5;
    border: 1px solid rgba(23, 23, 23, .1);
    border-radius: 24px;
}

.owleys-access__close {
    position: absolute;
    top: 20px;
    right: 20px;
    display: grid;
    width: 44px;
    height: 44px;
    padding: 0;
    place-items: center;
    color: #66615d;
    background: #f1ece7;
    border: 0;
    border-radius: 50%;
    cursor: pointer;
}

.owleys-access__close svg {
    width: 20px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-width: 1.8;
}

.owleys-access__header {
    padding-right: 56px;
}

.owleys-access__eyebrow {
    margin: 0 0 10px;
    color: #ff6b22;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .08em;
    line-height: 1.2;
    text-transform: uppercase;
}

.owleys-access__title {
    margin: 0;
    color: #171717;
    font-size: clamp(30px, 5vw, 40px);
    font-weight: 700;
    letter-spacing: -.04em;
    line-height: 1.05;
}

.owleys-access__copy {
    max-width: 390px;
    margin: 14px 0 0;
    color: #6d6965;
    font-size: 16px;
    line-height: 1.5;
}

.owleys-access__tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    margin: 28px 0 24px;
    padding: 4px;
    background: #f0ebe6;
    border-radius: 14px;
}

.owleys-access__tabs[hidden] {
    display: none;
}

.owleys-access__tabs button {
    min-height: 46px;
    padding: 10px 14px;
    color: #696460;
    background: transparent;
    border: 0;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
}

.owleys-access__tabs button[aria-selected="true"] {
    color: #171717;
    background: #fff;
    box-shadow: 0 2px 10px rgba(23, 23, 23, .07);
}

.owleys-access__form {
    display: grid;
    gap: 10px;
}

.owleys-access__form[hidden],
.owleys-access__message[hidden] {
    display: none;
}

.owleys-access__form label,
.owleys-access__label-row {
    margin-top: 6px;
    color: #171717;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.3;
}

.owleys-access__label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.owleys-access__label-row a,
.owleys-access__label-row button,
.owleys-access__legal a,
.owleys-access__text-button {
    color: #171717;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

.owleys-access__label-row a,
.owleys-access__label-row button {
    padding: 0;
    background: transparent;
    border: 0;
    font: inherit;
    font-weight: 500;
    cursor: pointer;
}

.owleys-access__form > input,
.owleys-access__password input {
    box-sizing: border-box;
    width: 100%;
    min-height: 54px;
    padding: 13px 16px;
    color: #171717;
    background: #fff;
    border: 1px solid #d9d4cf;
    border-radius: 12px;
    font: inherit;
    font-size: 16px;
    outline: none;
}

.owleys-access__form > input:focus,
.owleys-access__password input:focus {
    border-color: #171717;
    box-shadow: 0 0 0 2px #fbf8f5, 0 0 0 4px #171717;
}

.owleys-access__password {
    position: relative;
}

.owleys-access__password input {
    padding-right: 72px;
}

.owleys-access__password button {
    position: absolute;
    top: 5px;
    right: 5px;
    min-width: 58px;
    height: 44px;
    padding: 0 10px;
    color: #5e5955;
    background: transparent;
    border: 0;
    border-radius: 9px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

.owleys-access__help,
.owleys-access__legal,
.owleys-access__status {
    margin: 0;
    color: #77726e;
    font-size: 13px;
    line-height: 1.45;
}

.owleys-access__error {
    margin: 4px 0 0;
    padding: 11px 13px;
    color: #8c241f;
    background: #fff0ed;
    border-radius: 10px;
    font-size: 14px;
    line-height: 1.4;
}

#owleys-account-access .owleys-access__submit {
    display: inline-flex;
    box-sizing: border-box;
    width: 100%;
    height: auto;
    min-height: 54px;
    min-width: 0;
    margin-top: 10px;
    padding: 14px 22px;
    align-items: center;
    justify-content: center;
    appearance: none;
    color: #fff;
    background: #ff7938;
    border: 1px solid #ff7938;
    border-radius: 12px;
    box-shadow: none;
    font-family: inherit;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
    text-transform: none;
    cursor: pointer;
}

#owleys-account-access .owleys-access__submit:hover,
#owleys-account-access .owleys-access__submit:focus-visible {
    color: #fff;
    background: #ef651f;
    border-color: #ef651f;
}

#owleys-account-access .owleys-access__submit:disabled {
    cursor: wait;
    opacity: .65;
}

#owleys-account-access button:focus-visible,
#owleys-account-access a:focus-visible {
    outline: 2px solid #171717;
    outline-offset: 2px;
}

.owleys-access__legal {
    margin-top: 4px;
    text-align: center;
}

.owleys-access__captcha {
    min-height: 78px;
    margin-top: 6px;
}

.owleys-access__message {
    padding-top: 30px;
}

.owleys-access__message-icon {
    display: grid;
    width: 58px;
    height: 58px;
    margin-bottom: 22px;
    place-items: center;
    color: #ff6b22;
    background: #fff0e8;
    border-radius: 50%;
}

.owleys-access__message-icon--success {
    color: #008f4c;
    background: #e5f5ed;
}

.owleys-access__message-icon svg {
    width: 27px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.owleys-access__message h3 {
    margin: 0 0 10px;
    font-size: 26px;
    letter-spacing: -.03em;
    line-height: 1.1;
}

.owleys-access__message p {
    margin: 0 0 18px;
    color: #6d6965;
    font-size: 15px;
    line-height: 1.5;
}

.owleys-access__text-button {
    min-height: 44px;
    padding: 8px 0;
    background: transparent;
    border: 0;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.owleys-access__announcer {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
}

.owleys-account-access-page {
    min-height: 55vh;
    padding: 72px 24px;
    background: #fbf8f5;
}

.owleys-account-access-page__content {
    max-width: 1120px;
    margin: 0 auto;
}

.owleys-account-access-page h1 {
    margin: 0 0 12px;
    font-size: clamp(36px, 6vw, 64px);
    letter-spacing: -.05em;
}

#cart-sidebar .owleys-cart-account {
    display: flex;
    min-height: 44px;
    gap: 6px;
    padding: 0 20px;
    align-items: center;
    justify-content: center;
    color: #171717;
    background: #fff;
    border-block: 1px solid #e5e0db;
    font-size: 13px;
    line-height: 1.2;
}

#cart-sidebar .owleys-cart-account__copy {
    min-width: 0;
    color: #6d6965;
    white-space: nowrap;
}

#cart-sidebar .owleys-cart-account__actions {
    display: flex;
    flex: 0 0 auto;
    gap: 4px;
    align-items: center;
}

#cart-sidebar .owleys-cart-account__create,
#cart-sidebar .owleys-cart-account__login {
    min-height: 44px;
    margin: 0;
    padding: 0 2px;
    appearance: none;
    color: #171717;
    background: transparent;
    border: 0;
    border-radius: 4px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.2;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
    text-transform: none;
    white-space: nowrap;
    box-shadow: none;
    cursor: pointer;
}

#cart-sidebar .owleys-cart-account__login:hover,
#cart-sidebar .owleys-cart-account__login:focus-visible,
#cart-sidebar .owleys-cart-account__create:hover,
#cart-sidebar .owleys-cart-account__create:focus-visible {
    color: #ef651f;
    background: transparent;
}

#cart-sidebar .owleys-cart-account__create:focus-visible,
#cart-sidebar .owleys-cart-account__login:focus-visible {
    outline: 2px solid #171717;
    outline-offset: 1px;
}

#cart-sidebar .owleys-cart-account__separator {
    color: #aaa39d;
}

@media (max-width: 640px) {
    .owleys-access {
        width: 100%;
        max-width: none;
        max-height: calc(100dvh - 12px);
        margin: auto 0 0;
        border-radius: 22px 22px 0 0;
    }

    .owleys-access__surface {
        min-height: 0;
        padding: 28px 20px max(24px, env(safe-area-inset-bottom));
        border-radius: 22px 22px 0 0;
    }

    .owleys-access__close {
        top: 14px;
        right: 14px;
    }

    .owleys-access__header {
        padding-right: 48px;
    }

    #cart-sidebar .owleys-cart-account {
        padding-inline: 10px;
        font-size: 12px;
    }

    #cart-sidebar .owleys-cart-account__create,
    #cart-sidebar .owleys-cart-account__login {
        font-size: 12px;
    }
}

@media (max-width: 640px) and (max-height: 620px) {
    .owleys-access__surface {
        padding-top: 20px;
        padding-bottom: max(18px, env(safe-area-inset-bottom));
    }

    .owleys-access__eyebrow {
        margin-bottom: 6px;
    }

    .owleys-access__title {
        font-size: 28px;
    }

    .owleys-access__copy {
        margin-top: 8px;
        font-size: 15px;
        line-height: 1.4;
    }

    .owleys-access__tabs {
        margin: 18px 0 14px;
    }

    .owleys-access__form > input,
    .owleys-access__password input {
        min-height: 50px;
    }

    .owleys-access__password button {
        height: 40px;
    }

    #owleys-account-access .owleys-access__submit {
        min-height: 50px;
        margin-top: 6px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .owleys-access,
    .owleys-access::backdrop {
        scroll-behavior: auto;
    }
}
