/* =====================================================================
   Sign-in pages: customer login / register / password / email code
   (.au-shell, inside the storefront layout) and the admin login
   (.au-admin, guest layout). Brand colour follows the store setting.
   ===================================================================== */
:root {
    --au-brand: var(--site-primary, #1e40af);
    --au-accent: var(--site-secondary, #facc15);
    --au-ink: #0f172a;
    --au-text: #334155;
    --au-muted: #64748b;
    --au-line: #e2e8f0;
    --au-field: #f8fafc;
    --au-danger: #dc2626;
    --au-success: #16a34a;
}

/* ---------------- Customer shell ---------------- */
.au-shell {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    max-width: 1080px;
    margin: 1.5rem auto 2.5rem;
    border-radius: 24px;
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--au-line);
    box-shadow: 0 30px 70px -30px rgba(15, 23, 42, 0.35);
}

.au-brand {
    position: relative;
    padding: 2.75rem 2.5rem;
    color: #fff;
    background:
        radial-gradient(circle at 15% 10%, rgba(255, 255, 255, 0.18), transparent 45%),
        radial-gradient(circle at 90% 85%, color-mix(in srgb, var(--au-accent) 35%, transparent), transparent 40%),
        linear-gradient(150deg, color-mix(in srgb, var(--au-brand) 85%, #fff) 0%, var(--au-brand) 45%, color-mix(in srgb, var(--au-brand) 55%, #000) 100%);
    overflow: hidden;
}

.au-brand::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255, 255, 255, 0.12) 1px, transparent 1px);
    background-size: 18px 18px;
    mask-image: linear-gradient(to bottom, transparent, #000 60%);
    pointer-events: none;
}

.au-brand-inner {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    height: 100%;
}

.au-brand-eyebrow {
    margin: 0 0 1rem;
    display: inline-flex;
    align-self: flex-start;
    padding: 0.3rem 0.75rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.16);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.au-brand-title {
    margin: 0 0 1.5rem;
    font-family: var(--font-display, inherit);
    font-size: 2rem;
    line-height: 1.15;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #fff;
}

.au-brand-points {
    margin: 0 0 1.75rem;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}

.au-brand-points li {
    display: flex;
    gap: 0.8rem;
    align-items: flex-start;
    font-size: 0.92rem;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.85);
}

.au-brand-points strong {
    color: #fff;
}

.au-brand-point-icon {
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.18);
}

.au-brand-point-icon svg {
    width: 17px;
    height: 17px;
}

.au-showcase {
    margin-top: 0.5rem;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.6rem;
}

.au-showcase-item {
    margin: 0;
    position: relative;
    border-radius: 14px;
    overflow: hidden;
    aspect-ratio: 1;
    box-shadow: 0 14px 30px -12px rgba(0, 0, 0, 0.45);
    border: 2px solid rgba(255, 255, 255, 0.25);
}

.au-showcase-item:nth-child(2) {
    transform: translateY(-10px);
}

.au-showcase-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.au-showcase-item figcaption {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 1.2rem 0.5rem 0.4rem;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.6));
    font-size: 0.68rem;
    font-weight: 700;
    color: #fff;
    text-align: center;
}

.au-panel {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 2.5rem 2.75rem;
}

.au-card {
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
}

.au-secure {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    margin: 1.75rem 0 0;
    font-size: 0.78rem;
    color: var(--au-muted);
}

.au-secure svg {
    width: 14px;
    height: 14px;
}

/* ---------------- Shared form pieces ---------------- */
.au-head {
    margin-bottom: 1.4rem;
}

.au-head-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    margin-bottom: 1rem;
    border-radius: 16px;
    background: color-mix(in srgb, var(--au-brand) 10%, #fff);
    color: var(--au-brand);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--au-brand) 18%, transparent);
}

.au-head-icon svg {
    width: 24px;
    height: 24px;
}

.au-title {
    margin: 0;
    font-family: var(--font-display, inherit);
    font-size: 1.7rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--au-ink);
}

.au-subtitle {
    margin: 0.45rem 0 0;
    font-size: 0.93rem;
    line-height: 1.55;
    color: var(--au-muted);
}

.au-subtitle strong {
    color: var(--au-ink);
}

.au-alert {
    display: flex;
    gap: 0.6rem;
    align-items: flex-start;
    margin-bottom: 1.1rem;
    padding: 0.75rem 0.9rem;
    border-radius: 12px;
    font-size: 0.86rem;
    line-height: 1.5;
}

.au-alert svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    margin-top: 1px;
}

.au-alert p {
    margin: 0;
}

.au-alert-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

.au-alert-success {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
}

.au-google {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    width: 100%;
    padding: 0.8rem 1rem;
    border: 1.5px solid var(--au-line);
    border-radius: 12px;
    background: #fff;
    color: var(--au-ink);
    font-weight: 600;
    font-size: 0.93rem;
    text-decoration: none;
    transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}

.au-google:hover {
    border-color: #cbd5e1;
    box-shadow: 0 6px 18px -8px rgba(15, 23, 42, 0.25);
    transform: translateY(-1px);
}

.au-google svg {
    width: 20px;
    height: 20px;
}

.au-divider {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 1.2rem 0;
    font-size: 0.78rem;
    color: var(--au-muted);
}

.au-divider::before,
.au-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--au-line);
}

.au-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.au-field {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.au-label-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.5rem;
}

.au-label {
    font-size: 0.86rem;
    font-weight: 600;
    color: var(--au-ink);
}

.au-link-sm {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--au-brand);
    text-decoration: none;
}

.au-link-sm:hover {
    text-decoration: underline;
}

.au-input {
    position: relative;
}

.au-input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    width: 18px;
    height: 18px;
    transform: translateY(-50%);
    color: #94a3b8;
    pointer-events: none;
    transition: color 0.15s;
}

.au-control {
    width: 100%;
    box-sizing: border-box;
    height: 50px;
    padding: 0 3rem 0 2.85rem;
    border: 1.5px solid var(--au-line);
    border-radius: 12px;
    background: var(--au-field);
    font: inherit;
    font-size: 0.95rem;
    color: var(--au-ink);
    transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

.au-control::placeholder {
    color: #94a3b8;
}

.au-control:hover {
    border-color: #cbd5e1;
}

.au-control:focus {
    outline: none;
    background: #fff;
    border-color: var(--au-brand);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--au-brand) 14%, transparent);
}

.au-input:focus-within .au-input-icon {
    color: var(--au-brand);
}

.au-input.has-error .au-control {
    border-color: var(--au-danger);
    background: #fff;
}

.au-input.has-error .au-input-icon {
    color: var(--au-danger);
}

.au-reveal {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: #94a3b8;
    cursor: pointer;
}

.au-reveal:hover {
    background: #f1f5f9;
    color: var(--au-ink);
}

.au-reveal svg {
    width: 18px;
    height: 18px;
}

.au-reveal .au-eye-closed,
.au-reveal[aria-pressed="true"] .au-eye-open {
    display: none;
}

.au-reveal[aria-pressed="true"] .au-eye-closed {
    display: block;
}

.au-caps,
.au-match {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    margin: 0;
    font-size: 0.78rem;
    font-weight: 600;
}

.au-caps[hidden],
.au-match[hidden] {
    display: none;
}

.au-caps {
    color: #b45309;
}

.au-caps svg {
    width: 14px;
    height: 14px;
}

.au-match.is-ok { color: var(--au-success); }
.au-match.is-bad { color: var(--au-danger); }

.au-strength {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.au-strength-bars {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
}

.au-strength-bars i {
    height: 4px;
    border-radius: 999px;
    background: var(--au-line);
    transition: background 0.2s;
}

.au-strength[data-level="1"] i:nth-child(-n+1) { background: #ef4444; }
.au-strength[data-level="2"] i:nth-child(-n+2) { background: #f59e0b; }
.au-strength[data-level="3"] i:nth-child(-n+3) { background: #84cc16; }
.au-strength[data-level="4"] i:nth-child(-n+4) { background: #16a34a; }

.au-strength-text {
    font-size: 0.76rem;
    color: var(--au-muted);
}

.au-help {
    margin: 0;
    font-size: 0.78rem;
    color: var(--au-muted);
}

.au-check {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.88rem;
    color: var(--au-text);
    cursor: pointer;
    user-select: none;
}

.au-check input {
    appearance: none;
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    margin: 0;
    flex-shrink: 0;
    border: 1.5px solid #cbd5e1;
    border-radius: 6px;
    background: #fff;
    display: grid;
    place-content: center;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.au-check input::after {
    content: "";
    width: 10px;
    height: 6px;
    border-left: 2.5px solid #fff;
    border-bottom: 2.5px solid #fff;
    transform: rotate(-45deg) translate(1px, -1px) scale(0);
    transition: transform 0.15s;
}

.au-check input:checked {
    background: var(--au-brand);
    border-color: var(--au-brand);
}

.au-check input:checked::after {
    transform: rotate(-45deg) translate(1px, -1px) scale(1);
}

.au-check input:focus-visible {
    outline: 3px solid color-mix(in srgb, var(--au-brand) 30%, transparent);
    outline-offset: 2px;
}

.au-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    height: 52px;
    margin-top: 0.25rem;
    border: 0;
    border-radius: 12px;
    background: linear-gradient(135deg, color-mix(in srgb, var(--au-brand) 85%, #fff), var(--au-brand));
    color: #fff;
    font: inherit;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    cursor: pointer;
    box-shadow: 0 12px 24px -10px color-mix(in srgb, var(--au-brand) 70%, transparent);
    transition: transform 0.15s, box-shadow 0.15s, filter 0.15s;
}

.au-submit svg {
    width: 18px;
    height: 18px;
}

.au-submit:hover {
    transform: translateY(-1px);
    filter: brightness(1.05);
    box-shadow: 0 16px 30px -12px color-mix(in srgb, var(--au-brand) 75%, transparent);
}

.au-submit:active {
    transform: none;
}

.au-submit:disabled {
    cursor: progress;
    filter: saturate(0.6);
    transform: none;
}

.au-submit.is-loading::before {
    content: "";
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.45);
    border-top-color: #fff;
    animation: au-spin 0.7s linear infinite;
}

@keyframes au-spin {
    to { transform: rotate(360deg); }
}

.au-fineprint {
    margin: 0;
    font-size: 0.78rem;
    line-height: 1.55;
    color: var(--au-muted);
    text-align: center;
}

.au-fineprint a,
.au-switch a {
    color: var(--au-brand);
    font-weight: 600;
    text-decoration: none;
}

.au-fineprint a:hover,
.au-switch a:hover {
    text-decoration: underline;
}

.au-switch {
    margin: 1.4rem 0 0;
    padding-top: 1.2rem;
    border-top: 1px solid var(--au-line);
    text-align: center;
    font-size: 0.9rem;
    color: var(--au-text);
}

.au-back {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.au-back svg {
    width: 16px;
    height: 16px;
}

/* ---------------- Email code boxes ---------------- */
.au-otp-full {
    width: 100%;
    box-sizing: border-box;
    height: 56px;
    border: 1.5px solid var(--au-line);
    border-radius: 12px;
    background: var(--au-field);
    text-align: center;
    font: inherit;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 0.6em;
    color: var(--au-ink);
}

.au-otp.is-enhanced .au-otp-full {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.au-otp-boxes {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 0.55rem;
}

.au-otp-boxes[hidden] {
    display: none;
}

.au-otp-box {
    width: 100%;
    box-sizing: border-box;
    aspect-ratio: 1 / 1.15;
    min-width: 0;
    border: 1.5px solid var(--au-line);
    border-radius: 12px;
    background: var(--au-field);
    text-align: center;
    font: inherit;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--au-ink);
    caret-color: var(--au-brand);
    transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

.au-otp-box:focus {
    outline: none;
    background: #fff;
    border-color: var(--au-brand);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--au-brand) 14%, transparent);
}

.au-otp-box.is-filled {
    background: #fff;
    border-color: color-mix(in srgb, var(--au-brand) 45%, var(--au-line));
}

.au-otp.has-error .au-otp-box,
.au-otp.has-error .au-otp-full {
    border-color: var(--au-danger);
}

.au-resend {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    margin-top: 1.1rem;
    font-size: 0.88rem;
    color: var(--au-muted);
}

.au-link-btn {
    padding: 0;
    border: 0;
    background: none;
    font: inherit;
    font-weight: 700;
    color: var(--au-brand);
    cursor: pointer;
}

.au-link-btn:disabled {
    color: var(--au-muted);
    cursor: default;
}

.au-resend-timer {
    font-variant-numeric: tabular-nums;
}

/* ---------------- Admin login ---------------- */
.au-guest-body {
    margin: 0;
    min-height: 100vh;
    background: #0b1020;
    font-family: 'DM Sans', system-ui, sans-serif;
    --au-brand: #4361ee;
}

.au-admin {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    min-height: 100vh;
}

.au-admin-brand {
    position: relative;
    display: flex;
    align-items: center;
    padding: 3rem 3.5rem;
    overflow: hidden;
    color: #e2e8f0;
    background:
        radial-gradient(ellipse at 20% 0%, rgba(67, 97, 238, 0.45), transparent 55%),
        radial-gradient(ellipse at 100% 100%, rgba(114, 9, 183, 0.45), transparent 50%),
        #0b1020;
}

.au-admin-brand::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
    background-size: 44px 44px;
    mask-image: radial-gradient(ellipse at center, #000 30%, transparent 75%);
}

.au-admin-glow {
    position: absolute;
    width: 420px;
    height: 420px;
    right: -120px;
    top: 20%;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(250, 204, 21, 0.18), transparent 65%);
    filter: blur(10px);
}

.au-admin-brand-inner {
    position: relative;
    z-index: 1;
    max-width: 520px;
}

.au-admin-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.35rem 0.8rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.06);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #c7d2fe;
}

.au-admin-chip svg {
    width: 14px;
    height: 14px;
}

.au-admin-title {
    margin: 1.2rem 0 0.9rem;
    font-size: 2.6rem;
    line-height: 1.1;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: #fff;
}

.au-admin-text {
    margin: 0 0 1.6rem;
    font-size: 1rem;
    line-height: 1.6;
    color: #94a3b8;
}

.au-admin-features {
    margin: 0 0 2.2rem;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.au-admin-features li {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    font-size: 0.95rem;
    color: #cbd5e1;
}

.au-admin-features i {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    border-radius: 50%;
    background: rgba(110, 231, 183, 0.15) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236ee7b7' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E") center / 12px no-repeat;
}

.au-admin-collage {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
}

.au-admin-collage img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 20px 40px -18px rgba(0, 0, 0, 0.7);
}

.au-admin-collage img:nth-child(even) {
    transform: translateY(14px);
}

.au-admin-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.25rem;
    padding: 2.5rem 2rem;
    background: #f1f5f9;
}

.au-admin-card {
    width: 100%;
    max-width: 420px;
    box-sizing: border-box;
    padding: 2.25rem 2.25rem 1.75rem;
    border-radius: 22px;
    background: #fff;
    border: 1px solid var(--au-line);
    box-shadow: 0 30px 60px -30px rgba(15, 23, 42, 0.35);
}

.au-admin-logo {
    display: inline-flex;
    margin-bottom: 1.5rem;
    text-decoration: none;
}

.au-admin-logo img {
    height: 44px;
    width: auto;
}

.au-admin-logo span {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--au-ink);
}

.au-admin-note {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin: 1.4rem 0 0;
    padding-top: 1.1rem;
    border-top: 1px solid var(--au-line);
    font-size: 0.78rem;
    color: var(--au-muted);
}

.au-admin-note svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.au-admin-back {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--au-muted);
    text-decoration: none;
}

.au-admin-back:hover {
    color: var(--au-ink);
}

.au-admin-back svg {
    width: 16px;
    height: 16px;
}

/* ---------------- Responsive ---------------- */
@media (max-width: 900px) {
    .au-shell {
        grid-template-columns: minmax(0, 1fr);
        max-width: 480px;
        margin-top: 1rem;
    }

    .au-brand {
        display: none;
    }

    .au-admin {
        grid-template-columns: minmax(0, 1fr);
    }

    .au-admin-brand {
        display: none;
    }

    .au-admin-panel {
        min-height: 100vh;
        background:
            radial-gradient(ellipse at 20% 0%, rgba(67, 97, 238, 0.35), transparent 55%),
            radial-gradient(ellipse at 100% 100%, rgba(114, 9, 183, 0.35), transparent 50%),
            #0b1020;
    }

    .au-admin-back {
        color: #94a3b8;
    }
}

@media (max-width: 520px) {
    .au-shell {
        border-radius: 18px;
        box-shadow: 0 18px 40px -24px rgba(15, 23, 42, 0.35);
    }

    .au-panel {
        padding: 1.75rem 1.25rem;
    }

    .au-title {
        font-size: 1.45rem;
    }

    .au-admin-panel {
        padding: 1.5rem 1rem;
    }

    .au-admin-card {
        padding: 1.75rem 1.4rem 1.4rem;
    }

    .au-otp-boxes {
        gap: 0.4rem;
    }
}
