/* =========================================
   XMART Auth — shared design system for the
   public authentication pages (Login, Register,
   Password Recovery).

   Loaded ONLY by layouts/auth.blade.php (see
   @push('style') there), so every rule in this
   file is scoped to markup that only exists on
   those pages. It never touches xmart-storefront.css,
   xmart-dashboard.css or the admin panel.

   Tokens mirror the --xmart-store-* scale used by
   xmart-storefront.css / xmart-policy-page.css so the
   auth pages read as the same product, without this
   file depending on storefront.css actually being
   loaded (it isn't, on these pages).
========================================= */

:root {
    --xmart-auth-navy: hsl(var(--dark));
    --xmart-auth-accent: hsl(var(--base));
    --xmart-auth-accent-strong: hsl(var(--base-700));
    --xmart-auth-accent-tint: hsl(var(--base-50));
    --xmart-auth-text: hsl(var(--heading));
    --xmart-auth-muted: hsl(var(--body));
    --xmart-auth-border: hsl(var(--border));
    --xmart-auth-surface: hsl(var(--white));
    --xmart-auth-surface-alt: hsl(var(--light));
    --xmart-auth-radius: 16px;
    --xmart-auth-radius-sm: 10px;
    --xmart-auth-shadow: 0 8px 24px -14px rgba(15, 23, 42, 0.28);
    --xmart-auth-shadow-lg: 0 30px 60px -22px rgba(8, 15, 30, 0.35);
}

/* ---------- Section / shell ---------- */

.xmart-auth-section.account-section {
    display: flex;
    align-items: stretch;
    min-height: 100vh;
    padding: 0;
    background: var(--xmart-auth-surface-alt);
}

.xmart-auth-shell {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
    width: 100%;
    max-width: 1440px;
    margin: 0 auto;
}

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

.xmart-auth-brand {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 40px;
    padding: 56px 56px;
    overflow: hidden;
    background: var(--xmart-auth-navy);
    color: hsl(var(--white) / 0.92);
}

.xmart-auth-brand::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(760px 320px at 100% 0%, hsl(var(--base) / 0.32), transparent 70%),
        radial-gradient(600px 260px at 0% 100%, hsl(var(--base) / 0.14), transparent 65%);
    pointer-events: none;
}

.xmart-auth-brand__logo {
    position: relative;
    display: inline-block;
    max-width: 220px;
}

.xmart-auth-brand__logo img {
    display: block;
    max-width: 100%;
    height: auto;
}

.xmart-auth-brand__body {
    position: relative;
    max-width: 34rem;
}

.xmart-auth-brand__title {
    margin: 0 0 14px;
    color: hsl(var(--white));
    font-size: 28px;
    font-weight: 800;
    line-height: 1.25;
    letter-spacing: -0.01em;
}

.xmart-auth-brand__lede {
    margin: 0 0 28px;
    color: hsl(var(--white) / 0.78);
    font-size: 15.5px;
    line-height: 1.7;
}

.xmart-auth-brand__features {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.xmart-auth-brand__features li {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 14.5px;
    font-weight: 500;
    color: hsl(var(--white) / 0.9);
}

.xmart-auth-brand__features i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: hsl(var(--white) / 0.1);
    color: hsl(var(--base-200));
    font-size: 16px;
}

/* ---------- Form panel ---------- */

.xmart-auth-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--xmart-auth-surface);
    padding: 40px 24px;
}

.xmart-auth-panel__inner {
    width: 100%;
    max-width: 420px;
    padding: 16px 0;
}

.xmart-auth-panel__inner--wide {
    max-width: 520px;
}

/* Forms sit flush inside the panel — the panel itself is the surface,
   so the old boxed .account-form card chrome from main.css is stripped
   here instead of edited globally. */
.xmart-auth-panel .account-form {
    padding: 0;
    background: transparent;
    border: 0;
}

@media (max-width: 450px) {
    .xmart-auth-panel .account-form {
        padding: 0;
    }
}

.xmart-auth-form__head {
    margin-bottom: 28px;
}

.xmart-auth-form__title {
    margin: 0 0 8px;
    color: var(--xmart-auth-text);
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -0.01em;
}

.xmart-auth-form__subtitle {
    margin: 0;
    color: var(--xmart-auth-muted);
    font-size: 14.5px;
    line-height: 1.6;
}

.xmart-auth-form__switch {
    color: var(--xmart-auth-muted);
}

/* ---------- Password visibility toggle ---------- */

.xmart-auth-password-group {
    position: relative;
}

.xmart-auth-toggle-input {
    padding-right: 44px !important;
}

.xmart-auth-password__toggle {
    position: absolute;
    right: 4px;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 45px;
    padding: 0;
    background: transparent;
    border: 0;
    color: var(--xmart-auth-muted);
    cursor: pointer;
}

.xmart-auth-password__toggle:hover {
    color: var(--xmart-auth-accent-strong);
}

.xmart-auth-password__toggle:focus-visible {
    color: var(--xmart-auth-accent-strong);
    outline: 2px solid var(--xmart-auth-accent);
    outline-offset: 2px;
    border-radius: 6px;
}

/* ---------- Focus-visible polish (scoped, main.css keeps outline:0) ---------- */

.xmart-auth-panel .form--control:focus-visible {
    border-color: hsl(var(--base));
    box-shadow: 0 0 0 3px hsl(var(--base) / 0.18) !important;
}

/* ---------- Captcha spacing ---------- */

.xmart-auth-captcha {
    margin-bottom: 20px;
}

.xmart-auth-captcha .recaptcha-wrapper {
    padding: 4px 0;
}

/* Root cause of the phantom vertical scrollbar: partials/captcha.blade.php
   sets only overflow-x:auto on .recaptcha-wrapper. Per the CSS Overflow
   spec, when one axis is non-visible the other's 'visible' computes to
   'auto' too — so overflow-y silently becomes 'auto' as well. Google's
   reCAPTCHA <iframe> is left at the UA default display:inline/
   vertical-align:baseline, which leaves a ~2px inline-baseline gap below
   it inside its block container. That phantom 2px was enough to make the
   coerced overflow-y:auto render a real scrollbar. Forcing the iframe to
   display:block removes the baseline gap at its source, so there is
   nothing left to scroll — scoped to the auth pages only, not the shared
   captcha partial used elsewhere in the app. */
.xmart-auth-panel .recaptcha-wrapper iframe {
    display: block;
}

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

@media (max-width: 1366px) {
    .xmart-auth-brand {
        padding: 48px 44px;
        gap: 32px;
    }
}

@media (max-width: 991px) {
    .xmart-auth-shell {
        grid-template-columns: 1fr;
    }

    .xmart-auth-brand {
        padding: 32px 28px;
        gap: 0;
        text-align: center;
        align-items: center;
    }

    .xmart-auth-brand__body {
        max-width: none;
    }

    .xmart-auth-brand__lede,
    .xmart-auth-brand__features {
        display: none;
    }

    .xmart-auth-brand__title {
        margin-bottom: 0;
        font-size: 20px;
    }

    .xmart-auth-panel {
        padding: 36px 24px 48px;
    }
}

@media (max-width: 575px) {
    .xmart-auth-brand {
        padding: 24px 20px;
    }

    .xmart-auth-brand__logo {
        max-width: 168px;
    }

    .xmart-auth-panel {
        padding: 28px 16px 40px;
    }

    .xmart-auth-form__title {
        font-size: 22px;
    }
}
