/* Prime Panel authentication only. Every selector stays under #auth-sec. */
#auth-sec.hidden { display: none !important; }
#auth-sec:not(.hidden) {
    position: fixed;
    top: var(--auth-viewport-top, 0px);
    left: 0;
    width: 100%;
    height: var(--auth-viewport-height, 100dvh);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: max(16px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left));
    background:
        radial-gradient(ellipse at 9% 12%, rgba(96, 165, 250, .22), transparent 34%),
        radial-gradient(ellipse at 92% 86%, rgba(129, 140, 248, .17), transparent 36%),
        linear-gradient(145deg, #f8fbff 0%, #eef4fc 52%, #f8faff 100%) !important;
    -webkit-overflow-scrolling: touch;
}
#auth-sec, #auth-sec * { box-sizing: border-box; }
#auth-sec .auth-dialog {
    position: relative;
    width: min(100%, 440px);
    margin: auto;
    max-height: 100%;
    overflow: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    border: 1px solid rgba(207, 219, 236, .9);
    border-radius: 25px;
    background: #fff;
    box-shadow: 0 22px 70px rgba(31, 54, 91, .14), 0 3px 12px rgba(31, 54, 91, .05);
    color: #17243a;
    font-family: inherit;
    animation: auth-card-enter .22s ease-out both;
}
#auth-sec .auth-close {
    position: absolute;
    z-index: 2;
    top: 15px;
    right: 15px;
    display: grid;
    width: 40px;
    height: 40px;
    place-items: center;
    border: 1px solid #e6edf6;
    border-radius: 50%;
    background: rgba(255,255,255,.88);
    color: #52647d;
    cursor: pointer;
    transition: background-color .16s ease, color .16s ease, transform .16s ease;
}
#auth-sec .auth-close:hover { background: #eff6ff; color: #245bd5; }
#auth-sec .auth-close:active { transform: scale(.96); }
#auth-sec .auth-heading {
    padding: 30px 26px 22px;
    border-bottom: 1px solid #edf1f7;
    background: linear-gradient(180deg, #fbfdff 0%, #fff 100%);
    text-align: center;
}
#auth-sec .auth-brandmark {
    display: grid;
    width: 68px;
    height: 68px;
    margin: 0 auto 13px;
    place-items: center;
    border: 1px solid #e6edf7;
    border-radius: 21px;
    background: #fff;
    box-shadow: 0 5px 16px rgba(44, 82, 145, .09);
}
#auth-sec .auth-brandmark img { display: block; width: 58px; height: 58px; object-fit: contain; }
#auth-sec #auth-logo-img { padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
#auth-sec .auth-eyebrow {
    margin: 0 0 5px;
    color: #64748b;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .16em;
}
#auth-sec .auth-eyebrow span { color: #3470e5; }
#auth-sec #auth-welcome-title {
    margin: 0;
    color: #17243a;
    font-size: clamp(23px, 6vw, 28px);
    font-weight: 750;
    letter-spacing: -.035em;
    line-height: 1.2;
}
#auth-sec .auth-tagline { margin: 7px 0 0; color: #738198; font-size: 13px; line-height: 1.5; }
#auth-sec .auth-content {
    padding: 21px 25px 20px;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}
#auth-sec .auth-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    margin: 0 0 19px;
    padding: 4px;
    border: 1px solid #e7edf5;
    border-radius: 14px;
    background: #f4f7fb;
}
#auth-sec .auth-tabs button {
    min-height: 43px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: #61718a;
    font: inherit;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: background-color .18s ease, color .18s ease, box-shadow .18s ease, transform .12s ease;
}
#auth-sec .auth-tabs button[aria-selected="true"] {
    background: #fff;
    color: #2058ce;
    box-shadow: 0 2px 8px rgba(32, 63, 112, .1), inset 0 0 0 1px #e5ebf5;
}
#auth-sec .auth-tabs button:active { transform: scale(.985); }
#auth-sec .auth-google-block { width: 100%; }
#auth-sec .auth-google-button {
    display: flex;
    width: 100%;
    min-height: 48px;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border: 1px solid #dce4ef;
    border-radius: 12px;
    background: #fff;
    color: #26364f;
    font: inherit;
    font-size: 14px;
    font-weight: 650;
    cursor: pointer;
    transition: border-color .16s ease, background-color .16s ease, transform .12s ease, box-shadow .16s ease;
}
#auth-sec .auth-google-button:hover { border-color: #b8c9e2; background: #fbfdff; box-shadow: 0 3px 10px rgba(38, 66, 110, .06); }
#auth-sec .auth-google-button:active { transform: translateY(1px) scale(.995); }
#auth-sec .google-g-icon { display: block; width: 19px; height: 19px; flex: 0 0 19px; }
#auth-sec #google-signin-gis:not(.hidden) { display: flex; justify-content: center; margin-bottom: 2px; }
#auth-sec #google-signin-gis iframe { max-width: 100%; }
#auth-sec .auth-divider { display: flex; align-items: center; gap: 11px; margin: 17px 0; color: #8a97a9; font-size: 11px; font-weight: 600; }
#auth-sec .auth-divider span:first-child, #auth-sec .auth-divider span:last-child { height: 1px; flex: 1; background: #e8edf4; }
#auth-sec .auth-form { display: grid; gap: 13px; }
#auth-sec .auth-field { min-width: 0; }
#auth-sec .auth-field > label { display: block; margin: 0 0 6px; color: #34445c; font-size: 12px; font-weight: 700; }
#auth-sec .auth-field > label span { color: #8390a3; font-size: 11px; font-weight: 500; }
#auth-sec .auth-input-wrap {
    display: flex;
    min-height: 48px;
    align-items: center;
    gap: 10px;
    padding: 0 13px;
    border: 1px solid #dfe6ef;
    border-radius: 12px;
    background: #f9fbfd;
    transition: border-color .16s ease, background-color .16s ease, box-shadow .16s ease;
}
#auth-sec .auth-input-wrap:focus-within { border-color: #79a3f4; background: #fff; box-shadow: 0 0 0 3px rgba(59, 115, 224, .12); }
#auth-sec .auth-input-wrap > i { width: 17px; flex: 0 0 17px; color: #8291a8; font-size: 14px; text-align: center; }
#auth-sec .auth-input-wrap input {
    width: 100%;
    min-width: 0;
    min-height: 46px;
    padding: 0;
    border: 0;
    outline: 0;
    background: transparent !important;
    color: #1e2d45;
    font: inherit;
    font-size: 16px;
    line-height: 1.3;
    box-shadow: none !important;
    scroll-margin-block: 18px;
}
#auth-sec .auth-input-wrap input::placeholder { color: #9aa6b6; opacity: 1; }
#auth-sec .auth-password-toggle {
    display: grid;
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    place-items: center;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: #73839a;
    cursor: pointer;
}
#auth-sec .auth-password-toggle:hover { background: #edf3fb; color: #245bd5; }
#auth-sec .auth-password-toggle:active { transform: scale(.96); }
#auth-sec .auth-forgot-row { display: flex; justify-content: flex-end; margin-top: -3px; }
#auth-sec .auth-forgot-row button, #auth-sec .auth-switch-copy button {
    padding: 2px 0;
    border: 0;
    background: transparent;
    color: #245bd5;
    font: inherit;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}
#auth-sec .auth-forgot-row button:hover, #auth-sec .auth-switch-copy button:hover { color: #1745a8; text-decoration: underline; }
#auth-sec .auth-submit {
    display: flex;
    width: 100%;
    min-height: 49px;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 2px;
    padding: 12px 18px;
    border: 1px solid #2458ce;
    border-radius: 12px;
    background: linear-gradient(105deg, #3476ec 0%, #285bd7 100%);
    color: #fff;
    font: inherit;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: .035em;
    box-shadow: 0 6px 14px rgba(42, 93, 207, .2);
    cursor: pointer;
    transition: box-shadow .16s ease, filter .16s ease, transform .12s ease;
}
#auth-sec .auth-submit:hover { filter: brightness(1.035); box-shadow: 0 8px 19px rgba(42, 93, 207, .25); }
#auth-sec .auth-submit:active { transform: translateY(1px) scale(.997); box-shadow: 0 3px 8px rgba(42, 93, 207, .18); }
#auth-sec .auth-submit:disabled { cursor: wait; opacity: .72; transform: none; }
#auth-sec .auth-switch-copy { margin: 16px 0 0; color: #748197; font-size: 12px; text-align: center; }
#auth-sec .auth-security-note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    margin: 19px 0 0;
    padding-top: 14px;
    border-top: 1px solid #eef2f7;
    color: #7e8ba0;
    font-size: 10px;
    font-weight: 600;
    text-align: center;
}
#auth-sec .auth-security-note i { color: #2f9a74; }
#auth-sec button:focus-visible { outline: 3px solid rgba(61, 120, 235, .35); outline-offset: 2px; }
@keyframes auth-card-enter { from { opacity: 0; transform: translateY(7px) scale(.995); } to { opacity: 1; transform: translateY(0) scale(1); } }
@media (max-width: 380px) {
    #auth-sec:not(.hidden) { padding-left: 11px; padding-right: 11px; }
    #auth-sec .auth-dialog { border-radius: 21px; }
    #auth-sec .auth-heading { padding: 23px 18px 17px; }
    #auth-sec .auth-content { padding: 17px 17px 16px; }
    #auth-sec .auth-close { top: 11px; right: 11px; width: 36px; height: 36px; }
}
@media (max-height: 720px) {
    #auth-sec:not(.hidden) { align-items: flex-start; }
    #auth-sec .auth-dialog { margin-top: 0; margin-bottom: 0; }
    #auth-sec .auth-heading { padding-top: 19px; padding-bottom: 15px; }
    #auth-sec .auth-brandmark { width: 57px; height: 57px; margin-bottom: 9px; border-radius: 17px; }
    #auth-sec .auth-brandmark img { width: 49px; height: 49px; }
    #auth-sec .auth-content { padding-top: 15px; padding-bottom: 14px; }
    #auth-sec .auth-form { gap: 10px; }
}
/* Android/iOS keyboards shrink the visual viewport; keep the active field in view. */
#auth-sec.keyboard-open:not(.hidden) {
    align-items: flex-start;
    padding-top: 6px;
    padding-bottom: 6px;
}
#auth-sec.keyboard-open .auth-dialog { margin: 0 auto; border-radius: 19px; }
#auth-sec.keyboard-open .auth-heading { padding: 10px 18px 9px; }
#auth-sec.keyboard-open .auth-brandmark { width: 42px; height: 42px; margin-bottom: 4px; border-radius: 13px; }
#auth-sec.keyboard-open .auth-brandmark img { width: 36px; height: 36px; }
#auth-sec.keyboard-open .auth-eyebrow,
#auth-sec.keyboard-open .auth-tagline,
#auth-sec.keyboard-open .auth-security-note { display: none; }
#auth-sec.keyboard-open #auth-welcome-title { font-size: 20px; }
#auth-sec.keyboard-open .auth-content { padding: 10px 17px 12px; }
#auth-sec.keyboard-open .auth-tabs { margin-bottom: 10px; }
#auth-sec.keyboard-open .auth-form { gap: 9px; }
#auth-sec.keyboard-open .auth-input-wrap { min-height: 44px; }
#auth-sec.keyboard-open .auth-input-wrap input { min-height: 42px; }
#auth-sec.keyboard-open .auth-submit { min-height: 45px; padding-block: 9px; }
@media (prefers-reduced-motion: reduce) {
    #auth-sec *, #auth-sec *::before, #auth-sec *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
/* Keep this deliberately light auth design legible when the storefront is in dark mode. */
html[data-theme="dark"] #auth-sec:not(.hidden) {
    background:
        radial-gradient(ellipse at 50% 0%, rgba(219, 234, 254, .78), transparent 48%),
        linear-gradient(145deg, #f8fbff 0%, #f4f7fc 52%, #f8faff 100%) !important;
}
html[data-theme="dark"] #auth-sec .auth-dialog { background: #fff !important; color: #17243a !important; }
html[data-theme="dark"] #auth-sec .auth-heading { background: linear-gradient(180deg, #fbfdff 0%, #fff 100%) !important; }
html[data-theme="dark"] #auth-sec .auth-input-wrap { border-color: #dfe6ef !important; background: #f9fbfd !important; }
html[data-theme="dark"] #auth-sec .auth-input-wrap:focus-within { border-color: #79a3f4 !important; background: #fff !important; }
html[data-theme="dark"] #auth-sec .auth-input-wrap input { border: 0 !important; background: transparent !important; color: #1e2d45 !important; }
