/* Split-screen sign-in: form pane on the theme surface, Apecom brand panel beside it. */
.apecom-auth {
    --apecom-navy: #001139;
    --apecom-blue-800: #20336F;
    --apecom-blue-700: #2B4494;
    --apecom-blue-600: #3A5DCC;
    --apecom-sky: #74A9DA;
    --apecom-cta: #0061FF;
    --auth-primary: #2B4494;
    --auth-primary-hover: #20336F;
    --auth-primary-text: #FFFFFF;
    --auth-link: #2B4494;
    --auth-card-shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 8px 24px rgba(16, 24, 40, .06);
    --auth-danger: #DC2626;

    margin: 0;
    min-height: 100vh;
    padding: 0;
    background: var(--admin-bg, #F4F4F5);
    color: var(--admin-text-primary, #18181B);
    font-family: Roboto, var(--bs-font-sans-serif, system-ui), sans-serif;
    font-size: 15px;
    line-height: 1.5;
}

html[data-bs-theme="dark"] .apecom-auth {
    --auth-primary: #3A5DCC;
    --auth-primary-hover: #4C6EDB;
    --auth-link: #93ACF5;
    --auth-card-shadow: none;
    --auth-danger: #F87171;
}

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

/* ---------- Form pane ---------- */

.auth-pane {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding: 24px;
}

.auth-pane-appearance {
    position: absolute;
    inset-block-start: 20px;
    inset-inline-end: 24px;
}

.auth-pane-body {
    display: flex;
    flex: 1;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 400px;
    margin-inline: auto;
    padding-block: 72px 32px;
}

.auth-logo {
    display: inline-flex;
    margin-bottom: 28px;
    color: var(--admin-text-primary);
}

.auth-logo-mark {
    width: 196px;
    height: auto;
}

.auth-card {
    width: 100%;
    padding: 28px 28px 24px;
    border: 1px solid var(--admin-border, #E4E4E7);
    border-radius: 12px;
    background: var(--admin-surface, #FFFFFF);
    box-shadow: var(--auth-card-shadow);
}

.auth-card-title {
    margin: 0;
    color: var(--admin-text-primary);
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.3;
    text-align: center;
}

.auth-card-subtitle {
    margin: 6px 0 24px;
    color: var(--admin-text-secondary);
    font-size: .875rem;
    text-align: center;
}

.auth-field {
    margin-bottom: 16px;
}

.auth-label {
    display: block;
    margin-bottom: 6px;
    color: var(--admin-text-secondary);
    font-size: .8125rem;
    font-weight: 500;
}

.apecom-auth .auth-input {
    display: block;
    width: 100%;
    height: 44px;
    padding: 0 14px;
    border: 1px solid var(--admin-input-border, #71717A);
    border-radius: 8px;
    background: var(--admin-surface, #FFFFFF);
    color: var(--admin-text-primary);
    font: inherit;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.apecom-auth .auth-input:hover {
    border-color: var(--admin-text-secondary);
}

.apecom-auth .auth-input:focus,
.apecom-auth .auth-input:focus-visible {
    border-color: var(--auth-primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(58, 93, 204, .25);
}

.apecom-auth .auth-input.is-invalid {
    border-color: var(--auth-danger);
}

.apecom-auth .auth-input.is-invalid:focus {
    box-shadow: 0 0 0 3px rgba(220, 38, 38, .2);
}

.auth-error {
    margin: 6px 0 0;
    color: var(--auth-danger);
    font-size: .8125rem;
}

.auth-password {
    position: relative;
}

.apecom-auth .auth-password .auth-input {
    padding-inline-end: 48px;
}

.auth-password-toggle {
    position: absolute;
    inset-block: 4px;
    inset-inline-end: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--admin-text-muted);
    cursor: pointer;
}

.auth-password-toggle:hover {
    background: var(--admin-hover);
    color: var(--admin-text-primary);
}

.auth-password-toggle .auth-icon-hide,
.auth-password-toggle[aria-pressed="true"] .auth-icon-show {
    display: none;
}

.auth-password-toggle[aria-pressed="true"] .auth-icon-hide {
    display: block;
}

.auth-submit {
    display: block;
    width: 100%;
    height: 46px;
    margin-top: 8px;
    border: 0;
    border-radius: 8px;
    background: var(--auth-primary);
    color: var(--auth-primary-text);
    font: inherit;
    font-weight: 600;
    letter-spacing: .01em;
    cursor: pointer;
    transition: background-color .15s ease, transform .1s ease;
}

.auth-submit:hover {
    background: var(--auth-primary-hover);
}

.auth-submit:active {
    transform: translateY(1px);
}

.auth-remember {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-top: 16px;
    color: var(--admin-text-primary);
    font-size: .875rem;
    cursor: pointer;
}

.auth-remember input {
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: var(--auth-primary);
}

.auth-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 8px 16px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--admin-border);
    font-size: .875rem;
}

.auth-links a,
.auth-pane-footer a {
    color: var(--auth-link);
    text-decoration: none;
}

.auth-links a:hover,
.auth-pane-footer a:hover {
    text-decoration: underline;
}

.auth-signup {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-top: 28px;
    color: var(--admin-text-primary);
    font-size: .9375rem;
}

.auth-signup-btn {
    display: inline-flex;
    align-items: center;
    height: 42px;
    padding: 0 20px;
    border: 1px solid var(--admin-input-border);
    border-radius: 8px;
    color: var(--auth-link);
    font-weight: 500;
    text-decoration: none;
    transition: background-color .15s ease, border-color .15s ease;
}

.auth-signup-btn:hover {
    border-color: var(--auth-link);
    background: var(--admin-surface);
    color: var(--auth-link);
}

.auth-pane-footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    color: var(--admin-text-secondary);
    font-size: .8125rem;
    text-align: center;
}

/* ---------- Brand panel ---------- */

.auth-brand {
    position: relative;
    display: flex;
    position: sticky;
    inset-block-start: 0;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
    padding: clamp(40px, 8vh, 80px) clamp(32px, 7vw, 112px) 0;
    background: linear-gradient(180deg, var(--apecom-blue-700) 0%, var(--apecom-blue-600) 50%, var(--apecom-blue-700) 100%);
    color: #FFFFFF;
    isolation: isolate;
}

html[data-bs-theme="dark"] .auth-brand {
    background: linear-gradient(180deg, #1A2A63 0%, var(--apecom-blue-700) 50%, #1A2A63 100%);
}

.auth-brand::before {
    content: "";
    position: absolute;
    inset: -20% -10% auto auto;
    z-index: -1;
    width: 70%;
    aspect-ratio: 1;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(116, 169, 218, .35), transparent 65%);
}

.auth-brand-grid {
    position: absolute;
    inset: 0;
    z-index: -1;
    width: 100%;
    height: 100%;
}

.auth-brand-grid path {
    fill: none;
    stroke: rgba(255, 255, 255, .13);
    stroke-width: 1;
    vector-effect: non-scaling-stroke;
}

.auth-brand-content {
    max-width: 600px;
}

.auth-brand-title {
    margin: 0 0 20px;
    color: #FFFFFF;
    font-size: clamp(2.25rem, 3.3vw, 3.375rem);
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -.02em;
    text-wrap: balance;
}

.auth-brand-lead {
    margin: 0 0 24px;
    font-size: 1.125rem;
    font-weight: 600;
}

.auth-brand-intro {
    margin: 0 0 14px;
    color: rgba(255, 255, 255, .88);
    font-size: 1.0625rem;
}

.auth-brand-features {
    display: grid;
    gap: 14px;
    margin: 0 0 32px;
    padding: 0;
    list-style: none;
    font-size: 1.0625rem;
}

.auth-brand-features li {
    display: flex;
    align-items: center;
    gap: 14px;
}

.auth-brand-check {
    display: inline-flex;
    flex: none;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .95);
    color: var(--apecom-blue-700);
}

.auth-brand-cta {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    height: 50px;
    padding: 0 28px;
    border-radius: 999px;
    background: #FFFFFF;
    color: var(--apecom-cta);
    font-size: 1.0625rem;
    font-weight: 700;
    text-decoration: none;
    box-shadow: 0 10px 30px rgba(0, 17, 57, .25);
    transition: transform .15s ease, box-shadow .15s ease;
}

.auth-brand-cta:hover {
    color: var(--apecom-cta);
    transform: translateY(-1px);
    box-shadow: 0 14px 34px rgba(0, 17, 57, .32);
}

.auth-brand-cta:focus-visible {
    outline: 2px solid #FFFFFF !important;
    outline-offset: 3px;
}

/* ---------- Product preview illustration ---------- */

/* Fills whatever height the copy leaves, so the preview never pushes the panel past the fold. */
.auth-showcase {
    display: flex;
    flex: 1 1 0;
    align-items: flex-end;
    justify-content: center;
    min-height: 0;
    margin-top: 32px;
    container: showcase / size;
}

/* 1em equals 1/56 of the stage width, so every part scales together. */
.auth-showcase-stage {
    --stage-width: min(100cqw, 680px, 100cqh * 56 / 36);
    position: relative;
    flex: none;
    width: var(--stage-width);
    aspect-ratio: 56 / 36;
    font-size: calc(var(--stage-width) / 56);
    color: #1F2A44;
}

@container showcase (max-height: 220px) {
    .auth-showcase-stage {
        display: none;
    }
}

.auth-showcase-stage * {
    box-sizing: border-box;
}

.auth-showcase-stage i {
    display: block;
}

.mock-browser {
    position: absolute;
    inset: 4em 4em -1.6em 7em;
    overflow: hidden;
    border: .7em solid rgba(255, 255, 255, .28);
    border-bottom: 0;
    border-radius: 1.8em 1.8em 0 0;
    background-clip: padding-box;
    box-shadow: 0 1.5em 4em rgba(0, 17, 57, .35);
}

.mock-browser-bar {
    display: flex;
    align-items: center;
    gap: .5em;
    height: 2.6em;
    padding: 0 1.1em;
    background: #EEF1F8;
}

.mock-browser-bar > i {
    width: .7em;
    height: .7em;
    border-radius: 50%;
    background: #F87171;
}

.mock-browser-bar > i:nth-child(2) { background: #FBBF24; }
.mock-browser-bar > i:nth-child(3) { background: #34D399; }

.mock-url {
    display: inline-flex;
    align-items: center;
    gap: .4em;
    margin-inline: auto;
    padding: .3em 1.4em;
    border-radius: 999px;
    background: #FFFFFF;
    color: #52607A;
    font-size: .85em;
}

.mock-url svg {
    width: 1em;
    height: 1em;
    color: #16A34A;
}

.mock-store {
    height: 100%;
    padding: 1em 1.4em;
    background: #FFFFFF;
}

.mock-store-nav {
    display: flex;
    align-items: center;
    gap: .6em;
    margin-bottom: 1em;
}

.mock-store-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.9em;
    height: 1.9em;
    border-radius: .6em;
    background: #E11D74;
    color: #FFFFFF;
    font-size: .9em;
    font-weight: 700;
}

.mock-store-name {
    font-size: 1em;
    font-weight: 700;
}

.mock-store-links {
    display: flex;
    gap: .9em;
    margin-inline: auto;
}

.mock-store-links i {
    width: 3em;
    height: .45em;
    border-radius: 1em;
    background: #D1D7E0;
}

.mock-store-cart {
    position: relative;
    width: 1.5em;
    height: 1.5em;
    color: #1F2A44;
}

.mock-store-cart svg {
    width: 100%;
    height: 100%;
}

.mock-store-cart b {
    position: absolute;
    inset-block-start: -.5em;
    inset-inline-end: -.6em;
    min-width: 1.15em;
    height: 1.15em;
    border-radius: 999px;
    background: var(--apecom-cta);
    color: #FFFFFF;
    font-size: .7em;
    line-height: 1.15em;
    text-align: center;
}

.mock-store-hero {
    display: flex;
    flex-direction: row-reverse;
    align-items: center;
    justify-content: space-between;
    height: 9em;
    margin-bottom: 1em;
    padding: 0 1.8em;
    border-radius: 1em;
    background: linear-gradient(110deg, #FFF1E6 0%, #FFD9C2 100%);
}

.mock-store-hero strong {
    display: block;
    margin-bottom: .5em;
    color: #7C2D12;
    font-size: 1.6em;
    font-weight: 700;
    line-height: 1.1;
}

.mock-store-hero i {
    width: 11em;
    height: .5em;
    margin-bottom: .45em;
    border-radius: 1em;
    background: rgba(124, 45, 18, .2);
}

.mock-store-hero i + i {
    width: 8em;
}

.mock-store-shop {
    display: inline-block;
    margin-top: .6em;
    padding: .45em 1.2em;
    border-radius: 999px;
    background: var(--apecom-blue-700);
    color: #FFFFFF;
    font-size: .85em;
    font-weight: 600;
}

.mock-store-hero-art {
    position: relative;
    width: 6.6em;
    height: 6.6em;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, #FDBA74, #F97316);
    box-shadow: inset -.6em -.6em 0 rgba(124, 45, 18, .15);
}

.mock-store-hero-art::after {
    content: "";
    position: absolute;
    inset: 1.6em;
    border-radius: 50%;
    background: rgba(255, 255, 255, .55);
}

.mock-store-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: .9em;
}

.mock-product {
    padding: .5em;
    border: 1px solid #EEF1F8;
    border-radius: .8em;
}

.mock-product-img {
    display: block;
    height: 4.2em;
    margin-bottom: .55em;
    border-radius: .55em;
    background: #DAE3FF;
}

.mock-product:nth-child(2) .mock-product-img { background: #FCE7F3; }
.mock-product:nth-child(3) .mock-product-img { background: #DCFCE7; }
.mock-product:nth-child(4) .mock-product-img { background: #FEF3C7; }

.mock-product i {
    width: 80%;
    height: .45em;
    margin-bottom: .45em;
    border-radius: 1em;
    background: #D1D7E0;
}

.mock-product b {
    font-size: .85em;
    font-weight: 700;
}

.mock-phone {
    position: absolute;
    inset-block: 10.5em -1em;
    inset-inline-start: 1.2em;
    width: 13em;
    padding: .55em;
    border-radius: 2em;
    background: var(--apecom-navy);
    box-shadow: 0 1.6em 3.6em rgba(0, 17, 57, .45);
}

.mock-phone-screen {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 1.4em 1.1em 1.1em;
    border-radius: 1.5em;
    background: #FFFFFF;
}

.mock-phone-label {
    color: #64748B;
    font-size: .8em;
}

.mock-phone-total {
    margin-top: .15em;
    font-size: 1.9em;
    font-weight: 700;
    line-height: 1.1;
}

.mock-phone-trend {
    align-self: flex-start;
    margin-top: .4em;
    padding: .15em .55em;
    border-radius: 999px;
    background: #DCFCE7;
    color: #15803D;
    font-size: .75em;
    font-weight: 700;
}

.mock-phone-chart {
    display: flex;
    flex: 1;
    align-items: flex-end;
    gap: .45em;
    margin: 1em 0;
}

.mock-phone-chart i {
    flex: 1;
    border-radius: .35em .35em .15em .15em;
    background: #C7D3F7;
}

.mock-phone-chart i:last-child {
    background: var(--apecom-blue-600);
}

.mock-phone-btn {
    padding: .55em 0;
    border-radius: .7em;
    background: var(--apecom-blue-700);
    color: #FFFFFF;
    font-size: .85em;
    font-weight: 600;
    text-align: center;
}

.mock-orders {
    position: absolute;
    inset-block-start: 0;
    inset-inline-end: 0;
    width: 19em;
    padding: 1.2em 1.3em .6em;
    border-radius: 1.2em;
    background: #FFFFFF;
    box-shadow: 0 1.4em 3.4em rgba(0, 17, 57, .35);
}

.mock-orders-title {
    display: flex;
    align-items: center;
    gap: .6em;
    margin-bottom: .7em;
    color: var(--apecom-blue-700);
    font-size: 1.15em;
    font-weight: 700;
}

.mock-orders-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.5em;
    height: 1.5em;
    border-radius: .4em;
    background: #22C55E;
    color: #FFFFFF;
}

.mock-orders-icon svg {
    width: .9em;
    height: .9em;
}

.mock-order {
    display: flex;
    align-items: center;
    gap: .7em;
    padding: .7em 0;
    border-top: 1px solid #EEF1F8;
    font-size: .95em;
}

.mock-order-dot {
    width: 1.1em;
    height: 1.1em;
    border: .15em solid #CBD5E1;
    border-radius: .3em;
}

.mock-order-text {
    flex: 1;
    color: #475569;
}

.mock-order-text b {
    margin-inline-end: .3em;
    color: #1F2A44;
}

.mock-order-amount {
    color: var(--apecom-cta);
    font-weight: 700;
}

.mock-orders-badge {
    position: absolute;
    inset-block-start: -1.8em;
    inset-inline-end: -1.6em;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 4em;
    height: 4em;
    border-radius: 50%;
    background: #FFFFFF;
    color: var(--apecom-cta);
    box-shadow: 0 .8em 2em rgba(0, 17, 57, .3);
}

.mock-orders-badge svg {
    width: 2.1em;
    height: 2.1em;
}

.mock-launch {
    position: absolute;
    inset-block-end: 1.2em;
    inset-inline-end: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 12.5em;
    height: 12.5em;
    border: .55em solid #FFFFFF;
    border-radius: 50%;
    background: var(--apecom-cta);
    color: #FFFFFF;
    line-height: 1.1;
    text-align: center;
    box-shadow: 0 1.4em 3em rgba(0, 17, 57, .4);
}

.mock-launch span {
    font-size: 1.15em;
    font-weight: 500;
}

.mock-launch strong {
    margin: .05em 0 .1em;
    font-size: 3.9em;
    font-weight: 800;
    letter-spacing: -.03em;
}

/* ---------- Responsive ---------- */

@media (max-width: 991.98px) {
    .auth-shell {
        grid-template-columns: minmax(0, 1fr);
    }

    .auth-brand {
        display: none;
    }
}

@media (max-width: 575.98px) {
    .auth-pane {
        padding: 16px;
    }

    .auth-pane-appearance {
        inset-block-start: 16px;
        inset-inline-end: 16px;
    }

    .auth-card {
        padding: 24px 20px 20px;
    }

    .auth-signup {
        flex-direction: column;
        gap: 10px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .auth-submit,
    .auth-brand-cta,
    .auth-input {
        transition: none;
    }
}
