/* ═══════════════════════════════════════════════════════════════════════════
   Customer auth screens (login / register / OTP / mobile).
   Built on shop.css tokens — a single centered card on the storefront dark theme.
═══════════════════════════════════════════════════════════════════════════ */

.auth-body {
    --auth-page-bg:
        radial-gradient(760px 480px at 80% 12%, rgba(100, 116, 139, .10), transparent 72%),
        radial-gradient(680px 420px at 24% 86%, rgba(14, 165, 233, .08), transparent 72%),
        var(--bg);
    --auth-card-bg: var(--bg-card);
    --auth-card-border: var(--border);
    --auth-card-shadow: 0 24px 70px rgba(18, 24, 40, .12);
    --auth-showcase-bg-base: color-mix(in srgb, var(--bg-card) 92%, #eef2f7 8%);
    --auth-showcase-grid: rgba(15, 23, 42, .055);
    --auth-showcase-border: var(--border);
    --auth-showcase-glow: rgba(99, 102, 241, .10);
    --auth-showcase-text: var(--text-1);
    --auth-showcase-muted: var(--text-3);
    --auth-showcase-chip-bg: rgba(255, 255, 255, .82);
    --auth-showcase-chip-border: var(--border);
    --auth-showcase-chip-text: var(--text-1);
    --auth-showcase-overlay-a: rgba(255, 255, 255, .20);
    --auth-showcase-overlay-b: rgba(255, 255, 255, .70);
    min-height: 100vh;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 28px 18px;
    overflow-x: hidden;
    background: var(--auth-page-bg);
}

[data-theme="dark"] .auth-body {
    --auth-page-bg:
        radial-gradient(760px 480px at 80% 12%, rgba(124, 58, 237, .18), transparent 72%),
        radial-gradient(680px 420px at 24% 86%, rgba(14, 165, 233, .10), transparent 72%),
        var(--bg);
    --auth-card-bg: color-mix(in srgb, var(--bg-card) 92%, #17181c);
    --auth-card-border: rgba(255, 255, 255, .08);
    --auth-card-shadow: 0 24px 70px rgba(0, 0, 0, .34);
    --auth-showcase-bg-base: #121317;
    --auth-showcase-grid: rgba(255, 255, 255, .035);
    --auth-showcase-border: rgba(255, 255, 255, .07);
    --auth-showcase-glow: rgba(124, 58, 237, .24);
    --auth-showcase-text: #f7f7fb;
    --auth-showcase-muted: rgba(247, 247, 251, .66);
    --auth-showcase-chip-bg: rgba(42, 43, 48, .76);
    --auth-showcase-chip-border: rgba(255, 255, 255, .07);
    --auth-showcase-chip-text: #fff;
    --auth-showcase-overlay-a: rgba(18, 19, 23, .34);
    --auth-showcase-overlay-b: rgba(18, 19, 23, .82);
}

.auth-shell {
    width: min(100%, 1280px);
    min-height: min(720px, calc(100vh - 56px));
    display: grid;
    grid-template-columns: minmax(340px, 480px) minmax(0, 1fr);
    grid-template-areas: "form visual";
    gap: clamp(18px, 3vw, 36px);
    align-items: stretch;
    direction: ltr;
}

.auth-wrap {
    grid-area: form;
    width: 100%;
    max-width: 480px;
    align-self: center;
    justify-self: start;
    direction: rtl;
}

/* Brand ----------------------------------------------------------------- */
.auth-heading {
    position: relative;
    min-height: 48px;
    margin: -8px 0 26px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-back {
    position: absolute;
    inset-inline-start: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: var(--text-1);
    font-size: 1.45rem;
    text-decoration: none;
    transition: background .15s, color .15s;
}
.auth-back:hover {
    color: var(--primary);
    background: var(--bg-hover);
}

.auth-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    color: var(--text-1);
    font-size: 1.7rem;
    font-weight: 800;
    text-decoration: none;
}
.auth-brand i {
    color: var(--primary);
    font-size: 1.85rem;
}
.auth-brand--has-logo {
    min-height: 90px;
}
.auth-brand-logo {
    display: block;
    width: auto;
    max-width: min(320px, 80vw);
    max-height: 96px;
    object-fit: contain;
}
.auth-brand-logo--light { display: none; }
.auth-brand--has-light-logo .auth-brand-logo--dark { display: none; }
.auth-brand--has-light-logo .auth-brand-logo--light { display: block; }
[data-theme="dark"] .auth-brand--has-light-logo .auth-brand-logo--dark { display: block; }
[data-theme="dark"] .auth-brand--has-light-logo .auth-brand-logo--light { display: none; }

/* Card ------------------------------------------------------------------ */
.auth-card {
    background: var(--auth-card-bg);
    border: 1px solid var(--auth-card-border);
    border-radius: calc(var(--radius) + 4px);
    box-shadow: var(--auth-card-shadow);
    padding: 36px 30px;
}

/* Showcase -------------------------------------------------------------- */
.auth-showcase {
    grid-area: visual;
    position: relative;
    min-height: 620px;
    overflow: hidden;
    border: 1px solid var(--auth-showcase-border);
    border-radius: calc(var(--radius) + 8px);
    background:
        linear-gradient(var(--auth-showcase-grid) 1px, transparent 1px),
        linear-gradient(90deg, var(--auth-showcase-grid) 1px, transparent 1px),
        radial-gradient(520px 360px at 50% 42%, var(--auth-showcase-glow), transparent 70%),
        radial-gradient(360px 260px at 16% 78%, rgba(20, 184, 166, .10), transparent 72%),
        var(--auth-showcase-bg-base);
    background-size: 40px 40px, 40px 40px, auto, auto, auto;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06), 0 28px 80px rgba(0, 0, 0, .28);
    direction: rtl;
}

.auth-showcase::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, var(--auth-showcase-overlay-a), transparent 28%, var(--auth-showcase-overlay-a)),
        linear-gradient(90deg, var(--auth-showcase-overlay-b), transparent 22%, transparent 78%, color-mix(in srgb, var(--auth-showcase-overlay-b) 72%, transparent));
    pointer-events: none;
}

.auth-showcase-center {
    position: absolute;
    inset: 50% auto auto 50%;
    width: min(430px, calc(100% - 80px));
    transform: translate(-50%, -50%);
    text-align: center;
    color: var(--auth-showcase-text);
}

.auth-showcase-icon {
    width: 60px;
    height: 60px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 18px;
    border-radius: 16px;
    color: #c4b5fd;
    background: linear-gradient(145deg, rgba(124, 58, 237, .56), rgba(76, 29, 149, .40));
    border: 1px solid rgba(196, 181, 253, .24);
    box-shadow: 0 18px 36px rgba(76, 29, 149, .28);
}

.auth-showcase-icon i { font-size: 1.65rem; }

.auth-showcase-center h2 {
    margin: 0;
    font-size: clamp(1.45rem, 2.2vw, 2rem);
    line-height: 1.55;
    font-weight: 900;
    letter-spacing: 0;
}

.auth-showcase-center p {
    max-width: 370px;
    margin: 12px auto 24px;
    color: var(--auth-showcase-muted);
    font-size: .92rem;
    line-height: 1.9;
}

.auth-showcase-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.auth-showcase-actions span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 38px;
    padding: 0 12px;
    border-radius: 8px;
    border: 1px solid var(--auth-showcase-chip-border);
    background: color-mix(in srgb, var(--auth-showcase-chip-bg) 70%, transparent);
    color: var(--auth-showcase-muted);
    font-size: .8rem;
    white-space: nowrap;
    backdrop-filter: blur(12px);
}

.auth-showcase-actions i { color: rgba(196, 181, 253, .82); }

.auth-showcase-chip {
    position: absolute;
    z-index: 1;
    display: grid;
    grid-template-columns: auto 1fr;
    column-gap: 10px;
    min-width: 128px;
    padding: 12px 14px;
    border: 1px solid var(--auth-showcase-chip-border);
    border-radius: 10px;
    background: var(--auth-showcase-chip-bg);
    box-shadow: 0 18px 34px rgba(0, 0, 0, .24);
    backdrop-filter: blur(14px);
}

.auth-showcase-chip i {
    grid-row: span 2;
    align-self: center;
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    color: #fff;
    background: rgba(124, 58, 237, .42);
}

.auth-showcase-chip span {
    color: var(--auth-showcase-chip-text);
    font-size: .78rem;
    font-weight: 800;
}

.auth-showcase-chip small {
    margin-top: 2px;
    color: var(--auth-showcase-muted);
    font-size: .67rem;
}

.auth-showcase-chip-design { top: 70px; right: 62px; }
.auth-showcase-chip-project { bottom: 118px; left: 52px; }
.auth-showcase-chip-vip { right: 70px; bottom: 52px; }

.auth-title {
    margin: 0 0 6px;
    font-size: 1.38rem;
    font-weight: 800;
    color: var(--text-1);
}
.auth-sub {
    margin: 0 0 22px;
    font-size: .94rem;
    color: var(--text-3);
    line-height: 1.7;
}

/* Editable-identifier chip (shown on password/register steps) ------------ */
.auth-chip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 10px 14px;
    margin-bottom: 18px;
    font-size: .88rem;
}
.auth-chip-id {
    color: var(--text-2);
    direction: ltr;
    unicode-bidi: plaintext;
}
.auth-chip a {
    color: var(--primary);
    text-decoration: none;
    font-size: .82rem;
    white-space: nowrap;
}
.auth-chip a:hover { text-decoration: underline; }

/* Form ------------------------------------------------------------------ */
.auth-form { display: flex; flex-direction: column; gap: 14px; }

.auth-field { position: relative; }
.auth-field-icon {
    position: absolute;
    inset-inline-start: 13px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-3);
    font-size: 1.05rem;
    pointer-events: none;
}

.auth-label {
    display: block;
    margin-bottom: 7px;
    font-size: .85rem;
    font-weight: 600;
    color: var(--text-2);
}

.auth-input {
    width: 100%;
    box-sizing: border-box;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-1);
    min-height: 54px;
    font-size: 1rem;
    font-family: inherit;
    text-align: center;
    padding: 12px 14px;
    transition: border-color .15s, box-shadow .15s;
}
.auth-field .auth-input { padding-inline-start: 40px; }
.auth-password-field .auth-input,
.auth-field:has(.auth-password-toggle) .auth-input {
    padding-inline-end: 44px;
}
.auth-password-toggle {
    position: absolute;
    inset-inline-end: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: var(--text-3);
    font-size: 1.15rem;
    cursor: pointer;
    transition: color .15s, background .15s, box-shadow .15s;
}
.auth-password-toggle:hover,
.auth-password-toggle[aria-pressed="true"] {
    color: var(--primary);
    background: var(--bg-hover);
}
.auth-password-toggle:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px var(--primary-lt);
}
.auth-input::placeholder {
    color: var(--text-3);
    text-align: center;
}
.auth-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-lt);
}

/* Buttons --------------------------------------------------------------- */
.auth-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    width: 100%;
    min-height: 54px;
    padding: 13px 16px;
    border: none;
    border-radius: var(--radius);
    background: #ed1b24;
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: background .15s, transform .05s;
}
.auth-btn:hover { background: #d71920; }
.auth-btn:active { transform: translateY(1px); }

.auth-btn-google {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    box-sizing: border-box;
    min-height: 50px;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-input);
    color: var(--text-1);
    font-size: .96rem;
    font-weight: 600;
    text-decoration: none;
    transition: background .15s, border-color .15s;
}
.auth-btn-google:hover { background: var(--bg-hover); border-color: var(--text-3); }
.auth-btn-google svg { width: 18px; height: 18px; flex-shrink: 0; }

/* Divider --------------------------------------------------------------- */
.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 20px 0;
    color: var(--text-3);
    font-size: .82rem;
}
.auth-divider::before,
.auth-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--border);
}

/* OTP cells ------------------------------------------------------------- */
.otp-inputs {
    display: flex;
    justify-content: center;
    gap: 10px;
    /* LTR: the first typed digit lands in the left-most cell and entry flows
       rightward, matching the order the code is read/typed. */
    direction: ltr;
}
.otp-cell {
    width: 52px;
    height: 58px;
    text-align: center;
    font-size: 1.4rem;
    font-weight: 700;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-1);
    transition: border-color .15s, box-shadow .15s;
}
.otp-cell:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-lt);
}

/* Feedback / helpers ---------------------------------------------------- */
.auth-error {
    margin: -4px 0 0;
    color: var(--red);
    font-size: .82rem;
}
.auth-status {
    margin: 0 0 14px;
    padding: 10px 13px;
    background: var(--green-t);
    color: var(--green);
    border-radius: var(--radius);
    font-size: .85rem;
    text-align: center;
}
.auth-meta {
    margin-top: 18px;
    text-align: center;
    font-size: .85rem;
    color: var(--text-3);
}
.auth-meta a,
.auth-link {
    color: var(--primary);
    text-decoration: none;
}
.auth-meta a:hover,
.auth-link:hover { text-decoration: underline; }

.auth-resend {
    background: none;
    border: none;
    color: var(--primary);
    font-family: inherit;
    font-size: .85rem;
    cursor: pointer;
    padding: 0;
}
.auth-resend:disabled { color: var(--text-3); cursor: default; }

.auth-inline-form {
    margin-top: 16px;
    text-align: center;
}

.auth-text-btn {
    border: none;
    background: transparent;
    color: var(--primary);
    font: inherit;
    font-size: .9rem;
    font-weight: 700;
    cursor: pointer;
    padding: 0;
}
.auth-text-btn:hover { text-decoration: underline; }
.auth-error-center { text-align: center; margin-top: 12px; }

.auth-popup-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
    background: rgba(15, 23, 42, .46);
    backdrop-filter: blur(8px);
}

.auth-popup {
    width: min(100%, 360px);
    padding: 28px 24px 22px;
    border-radius: var(--radius);
    border: 1px solid var(--auth-card-border);
    background: var(--auth-card-bg);
    box-shadow: 0 26px 70px rgba(0, 0, 0, .28);
    text-align: center;
}

.auth-popup-icon {
    width: 54px;
    height: 54px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
    border-radius: 50%;
    color: var(--green);
    background: var(--green-t);
    font-size: 1.5rem;
}

.auth-popup h2 {
    margin: 0 0 8px;
    color: var(--text-1);
    font-size: 1.16rem;
    font-weight: 800;
}

.auth-popup p {
    margin: 0 0 20px;
    color: var(--text-3);
    font-size: .9rem;
    line-height: 1.8;
}

.auth-terms {
    margin: 18px 4px 0;
    text-align: center;
    font-size: .78rem;
    color: var(--text-3);
    line-height: 1.9;
}
.auth-terms a { color: var(--text-2); text-decoration: none; }
.auth-terms a:hover { text-decoration: underline; }

@media (max-width: 940px) {
    .auth-body { padding: 22px 16px; }
    .auth-shell {
        min-height: auto;
        width: min(100%, 430px);
        grid-template-columns: minmax(0, 1fr);
        grid-template-areas: "form";
        justify-content: center;
    }
    .auth-wrap { justify-self: center; }
    .auth-showcase { display: none; }
}

@media (max-width: 480px) {
    .auth-body {
        align-items: flex-start;
        padding: 22px 12px;
    }
    .auth-card { padding: 24px 16px; }
    .otp-cell { width: 44px; height: 52px; font-size: 1.2rem; }
}
