/**
 * SF Checkout - header account popup/dropdown.
 * Site root is 10px (Bricks 62.5%); rem units match the rest of the site.
 */

.sf-acct {
    position: relative;
    display: inline-flex;
    align-items: center;
    font-family: inherit;
    line-height: 1.2;
}

.sf-acct__trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3.5rem;
    height: 3.5rem;
    padding: 0;
    color: var(--sf-text-on-dark, #fcfcfa);
    background: none;
    border: 0;
    cursor: pointer;
}

.sf-acct__icon {
    width: 3.2rem;
    height: 3.2rem;
}

.sf-acct-menu {
    position: absolute;
    top: calc(100% + 0.8rem);
    right: 0;
    z-index: 999;
    min-width: 16rem;
    padding: 0.6rem;
    background: #fff;
    color: #1a1a1a;
    border-radius: 0.8rem;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.18);
}

.sf-acct-menu[hidden] { display: none; }

.sf-acct-menu__item {
    display: block;
    padding: 0.9rem 1rem;
    color: #1a1a1a;
    font-size: 1.4rem;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
    border-radius: 0.5rem;
    white-space: nowrap;
}

.sf-acct-menu__item:hover,
.sf-acct-menu__item:focus {
    color: var(--sf-brand-red, #b83429);
    background: #f5f5f2;
    outline: none;
}

.sf-acct-modal[hidden] { display: none; }

.sf-acct-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: grid;
    place-items: center;
    padding: 2rem;
}

.sf-acct-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.48);
}

.sf-acct-modal__panel {
    position: relative;
    z-index: 1;
    width: min(42rem, 100%);
    max-height: calc(100vh - 4rem);
    overflow: auto;
    padding: 2rem;
    background: #fff;
    color: #1a1a1a;
    border-radius: 0.8rem;
    box-shadow: 0 10px 36px rgba(0, 0, 0, 0.24);
}

.sf-acct-modal__close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    padding: 0;
    color: #1a1a1a;
    background: transparent;
    border: 0;
    font-size: 2.6rem;
    line-height: 1;
    cursor: pointer;
}

.sf-acct-modal__title {
    margin: 0 0 1.4rem;
    color: #1a1a1a;
    font-size: 2.2rem;
    line-height: 1.2;
}

.sf-acct-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.4rem;
    margin: 0 4rem 1.6rem 0;
    padding: 0.4rem;
    background: #f0f0ed;
    border-radius: 0.8rem;
}

.sf-acct-tabs[hidden] { display: none; }

.sf-acct-tabs__tab {
    min-height: 4rem;
    padding: 0 1rem;
    color: #333;
    background: transparent;
    border: 0;
    border-radius: 0.6rem;
    font-size: 1.4rem;
    font-weight: 700;
    cursor: pointer;
}

.sf-acct-tabs__tab.is-active {
    color: #fff;
    background: var(--sf-brand-red, #b83429);
}

.sf-acct__trigger:focus-visible,
.sf-acct-menu__item:focus-visible,
.sf-acct-modal__close:focus-visible,
.sf-acct-tabs__tab:focus-visible,
.sf-acct-form__submit:focus-visible,
.sf-acct-form__link-button:focus-visible {
    outline: 2px solid var(--sf-brand-red, #b83429);
    outline-offset: 2px;
}

.sf-acct-pane { display: none; }
.sf-acct-pane.is-active { display: block; }

.sf-acct-form {
    display: grid;
    gap: 1.2rem;
}

.sf-acct-form__field {
    display: grid;
    gap: 0.5rem;
    font-size: 1.3rem;
    font-weight: 700;
}

.sf-acct-form__field input {
    width: 100%;
    min-height: 4.4rem;
    padding: 0 1.1rem;
    color: #1a1a1a;
    background: #fff;
    border: 1px solid #cfcfcf;
    border-radius: 0.6rem;
    font-size: 1.6rem;
}

.sf-acct-form__field input:focus {
    outline: none;
    border-color: var(--sf-brand-red, #b83429);
    box-shadow: 0 0 0 2px rgba(184, 52, 41, 0.18);
}

.sf-acct-form__remember {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    font-size: 1.3rem;
}

.sf-acct-form__submit {
    min-height: 4.4rem;
    padding: 0 1.4rem;
    color: #fff;
    background: var(--sf-brand-red, #b83429);
    border: 0;
    border-radius: 0.6rem;
    font-size: 1.5rem;
    font-weight: 800;
    cursor: pointer;
}

.sf-acct-form__submit:disabled {
    opacity: 0.55;
    cursor: default;
}

.sf-acct-form__link {
    color: var(--sf-brand-red, #b83429);
    font-size: 1.3rem;
    font-weight: 700;
    text-decoration: none;
}

.sf-acct-form__link:hover,
.sf-acct-form__link:focus {
    text-decoration: underline;
}

.sf-acct-form__link-button {
    width: fit-content;
    padding: 0;
    background: transparent;
    border: 0;
    cursor: pointer;
}

.sf-acct-form__msg {
    min-height: 1.8rem;
    color: var(--sf-brand-red, #b83429);
    font-size: 1.3rem;
    line-height: 1.35;
}

.sf-acct-form__msg:empty { min-height: 0; }

@media (max-width: 768px) {
    .sf-acct-menu {
        min-width: 14rem;
    }

    .sf-acct-modal {
        padding: 1.2rem;
    }

    .sf-acct-modal__panel {
        max-height: calc(100vh - 2.4rem);
        padding: 1.6rem;
    }
}
