@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

/* ============================================================
   Auth pages (login / register) - scoped to .auth-page
   Matches the cart / checkout / footer system.
   ============================================================ */
.auth-page {
    --a-ink: #0F172A;
    --a-ink-2: #1E293B;
    --a-accent: #1504B2;
    --a-accent-hover: #086AC9;
    --a-red: #DC2626;
    --a-green: #16A34A;
    --a-green-dark: #15803D;
    --a-warn: #D97706;
    --a-bg: #FFFFFF;
    --a-page: #FAFAFC;
    --a-tint: #F0F9FF;
    --a-surface: #F1F5F9;
    --a-border: #E2E8F0;
    --a-muted: #475569;
    --a-on-blue: rgba(255, 255, 255, .88);

    font-family: "Plus Jakarta Sans", system-ui, sans-serif;
    background: var(--a-page);
    color: var(--a-ink);
    padding: 24px 0 64px;
    min-height: 60vh;
}
.auth-page *, .auth-page *::before, .auth-page *::after { box-sizing: border-box; }

.auth-page .auth-container {
    width: 100%;
    max-width: 1020px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ---------- Breadcrumbs ---------- */
.auth-page .auth-crumbs ol {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    list-style: none;
    margin: 0 0 14px;
    padding: 0;
    font-size: 0.8rem;
    color: var(--a-muted);
}
.auth-page .auth-crumbs li:not(:last-child)::after {
    content: ">";
    margin: 0 8px;
    color: #CBD5E1;
}
.auth-page .auth-crumbs a { color: var(--a-muted); text-decoration: none; }
.auth-page .auth-crumbs a:hover { color: var(--a-accent); text-decoration: underline; }
.auth-page .auth-crumbs li[aria-current] { color: var(--a-ink); font-weight: 600; }

/* ---------- Shell ---------- */
.auth-page .auth-shell {
    display: grid;
    grid-template-columns: 0.9fr 1.1fr;
    background: var(--a-bg);
    border: 1px solid var(--a-border);
    border-radius: 4px;
    overflow: hidden;
}

/* ---------- Aside (brand / perks) ---------- */
.auth-page .auth-aside {
    display: flex;
    flex-direction: column;
    padding: 32px 30px;
    background: var(--a-accent);
    color: #fff;
}
.auth-page .auth-brand { display: inline-block; margin-bottom: 26px; text-decoration: none; }
.auth-page .auth-brand img { display: block; height: 52px; width: auto; }

.auth-page .auth-aside-title {
    font-size: 1.4rem;
    font-weight: 800;
    line-height: 1.25;
    margin: 0 0 8px;
    color: #fff;
}
.auth-page .auth-aside-sub {
    font-size: 0.86rem;
    line-height: 1.6;
    color: var(--a-on-blue);
    margin: 0 0 24px;
}

.auth-page .auth-perks {
    list-style: none;
    padding: 0;
    margin: 0 0 24px;
    display: grid;
    gap: 16px;
}
.auth-page .auth-perks li { display: flex; align-items: flex-start; gap: 11px; }
.auth-page .auth-perks iconify-icon { color: #BAE6FD; flex-shrink: 0; margin-top: 2px; }
.auth-page .auth-perks span {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 0.78rem;
    line-height: 1.45;
    color: var(--a-on-blue);
}
.auth-page .auth-perks strong { font-size: 0.85rem; font-weight: 700; color: #fff; }

.auth-page .auth-aside-note {
    display: flex;
    align-items: center;
    gap: 7px;
    margin: auto 0 0;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, .2);
    font-size: 0.74rem;
    line-height: 1.45;
    color: var(--a-on-blue);
}
.auth-page .auth-aside-note iconify-icon { color: #86EFAC; flex-shrink: 0; }

/* ---------- Main (form) ---------- */
.auth-page .auth-main { padding: 28px 32px 30px; min-width: 0; }

/* Tabs */
.auth-page .auth-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    margin-bottom: 22px;
    border-bottom: 1px solid var(--a-border);
}
.auth-page .auth-tab {
    padding: 11px 8px;
    text-align: center;
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--a-muted);
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: color 150ms ease, border-color 150ms ease;
}
.auth-page .auth-tab:hover { color: var(--a-accent); }
.auth-page .auth-tab.is-active { color: var(--a-accent); border-bottom-color: var(--a-accent); }

.auth-page .auth-title {
    font-size: 1.24rem;
    font-weight: 800;
    letter-spacing: -0.01em;
    margin: 0 0 5px;
    color: var(--a-ink);
}
.auth-page .auth-lead { font-size: 0.85rem; color: var(--a-muted); margin: 0 0 22px; }
.auth-page .auth-lead a { color: var(--a-accent); font-weight: 700; text-decoration: none; }
.auth-page .auth-lead a:hover { color: var(--a-accent-hover); text-decoration: underline; }

/* Fields */
.auth-page .auth-form { display: grid; gap: 16px; }
.auth-page .auth-field { display: grid; gap: 6px; min-width: 0; }
.auth-page .auth-field label { font-size: 0.79rem; font-weight: 700; color: var(--a-ink); }
.auth-page .auth-req { color: var(--a-red); }

.auth-page .auth-label-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.auth-page .auth-forgot {
    font-size: 0.76rem;
    font-weight: 700;
    color: var(--a-accent);
    text-decoration: none;
}
.auth-page .auth-forgot:hover { color: var(--a-accent-hover); text-decoration: underline; }

.auth-page .auth-input-wrap {
    display: flex;
    align-items: center;
    gap: 9px;
    height: 42px;
    padding: 0 12px;
    background: var(--a-bg);
    border: 1px solid var(--a-border);
    border-radius: 4px;
    transition: border-color 150ms ease, box-shadow 150ms ease;
}
.auth-page .auth-input-wrap:hover { border-color: #CBD5E1; }
.auth-page .auth-input-wrap:focus-within {
    border-color: var(--a-accent);
    box-shadow: 0 0 0 3px rgba(21, 4, 178, .12);
}
.auth-page .auth-input-wrap > iconify-icon { color: var(--a-muted); flex-shrink: 0; }
.auth-page .auth-input-wrap input {
    flex: 1;
    min-width: 0;
    height: 100%;
    border: none;
    outline: none;
    background: none;
    font-family: inherit;
    font-size: 0.9rem;
    color: var(--a-ink);
}
.auth-page .auth-input-wrap input::placeholder { color: #64748B; }

.auth-page .auth-eye {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    padding: 0;
    background: none;
    border: none;
    border-radius: 4px;
    color: var(--a-muted);
    cursor: pointer;
    flex-shrink: 0;
    transition: color 150ms ease, background-color 150ms ease;
}
.auth-page .auth-eye:hover { color: var(--a-accent); background: var(--a-surface); }

/* Phone prefix */
.auth-page .auth-phone { padding-left: 0; overflow: hidden; }
.auth-page .auth-prefix {
    align-self: stretch;
    display: flex;
    align-items: center;
    padding: 0 12px;
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--a-ink);
    background: var(--a-surface);
    border-right: 1px solid var(--a-border);
    font-variant-numeric: tabular-nums;
}

.auth-page .auth-hint { font-size: 0.73rem; color: var(--a-muted); }

/* Caps-lock warning */
.auth-page .auth-caps {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.74rem;
    font-weight: 600;
    color: var(--a-warn);
}
.auth-page .auth-caps iconify-icon { flex-shrink: 0; }

/* Password strength meter */
.auth-page .auth-meter { display: flex; align-items: center; gap: 9px; }
.auth-page .auth-meter-bar {
    position: relative;
    flex: 1;
    height: 4px;
    border-radius: 2px;
    background: var(--a-border);
    overflow: hidden;
}
.auth-page .auth-meter-bar::after {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    border-radius: 2px;
    transition: width 150ms ease, background-color 150ms ease;
}
.auth-page .auth-meter-bar.is-weak::after { width: 33%; background: var(--a-red); }
.auth-page .auth-meter-bar.is-ok::after { width: 66%; background: var(--a-warn); }
.auth-page .auth-meter-bar.is-strong::after { width: 100%; background: var(--a-green); }
.auth-page .auth-meter-label {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--a-muted);
    white-space: nowrap;
}

/* Checkbox row */
.auth-page .auth-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.auth-page .auth-check {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    font-size: 0.82rem;
    color: var(--a-ink-2);
    line-height: 1.45;
    cursor: pointer;
}
.auth-page .auth-check input {
    width: 16px;
    height: 16px;
    margin: 2px 0 0;
    accent-color: var(--a-accent);
    flex-shrink: 0;
    cursor: pointer;
}
.auth-page .auth-check a { color: var(--a-accent); font-weight: 700; text-decoration: none; }
.auth-page .auth-check a:hover { text-decoration: underline; }

/* Submit */
.auth-page .auth-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 46px;
    margin-top: 2px;
    padding: 0 18px;
    background: var(--a-accent);
    color: #fff;
    border: 1px solid transparent;
    border-radius: 4px;
    font-family: inherit;
    font-size: 0.88rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background-color 150ms ease, transform 150ms ease;
}
.auth-page .auth-submit:hover:not(:disabled) { background: var(--a-accent-hover); transform: translateY(-2px); }
.auth-page .auth-submit:disabled { opacity: .75; cursor: progress; }

.auth-page .auth-loading { display: inline-flex; align-items: center; gap: 9px; }
.auth-page .auth-spinner {
    width: 15px;
    height: 15px;
    border: 2px solid rgba(255, 255, 255, .45);
    border-top-color: #fff;
    border-radius: 50%;
    animation: auth-spin 700ms linear infinite;
    flex-shrink: 0;
}
@keyframes auth-spin { to { transform: rotate(360deg); } }

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

/* Social */
.auth-page .auth-social { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.auth-page .auth-social-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 42px;
    padding: 0 12px;
    background: var(--a-bg);
    border: 1px solid var(--a-border);
    border-radius: 4px;
    font-family: inherit;
    font-size: 0.84rem;
    font-weight: 700;
    color: var(--a-ink);
    cursor: pointer;
    white-space: nowrap;
    transition: border-color 150ms ease, background-color 150ms ease, color 150ms ease;
}
.auth-page .auth-social-btn:hover { border-color: var(--a-accent); background: var(--a-tint); color: var(--a-accent); }
.auth-page .auth-social-btn > iconify-icon { flex-shrink: 0; }
.auth-page .auth-social-btn:first-child > iconify-icon { color: var(--a-accent); }

/* Guest link */
.auth-page .auth-guest {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    width: 100%;
    margin-top: 14px;
    padding: 10px;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--a-muted);
    text-decoration: none;
    border-radius: 4px;
    transition: color 150ms ease, background-color 150ms ease;
}
.auth-page .auth-guest:hover { color: var(--a-accent); background: var(--a-tint); }

.auth-page .auth-terms {
    margin: 16px 0 0;
    font-size: 0.74rem;
    line-height: 1.5;
    color: var(--a-muted);
    text-align: center;
}
.auth-page .auth-terms a { color: var(--a-accent); text-decoration: none; }
.auth-page .auth-terms a:hover { text-decoration: underline; }

/* ---------- Trust strip ---------- */
.auth-page .auth-trust {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    margin-top: 16px;
    background: var(--a-bg);
    border: 1px solid var(--a-border);
    border-radius: 4px;
    overflow: hidden;
}
.auth-page .auth-trust-item {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 13px 10px;
    border-left: 1px solid var(--a-border);
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--a-ink-2);
    text-align: center;
}
.auth-page .auth-trust-item:first-child { border-left: none; }
.auth-page .auth-trust-item iconify-icon { color: var(--a-accent); flex-shrink: 0; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
    .auth-page .auth-container { max-width: 560px; }
    .auth-page .auth-shell { grid-template-columns: 1fr; }

    /* Compact brand band instead of hiding the panel entirely */
    .auth-page .auth-aside { padding: 22px 24px; }
    .auth-page .auth-brand { margin-bottom: 16px; }
    .auth-page .auth-brand img { height: 44px; }
    .auth-page .auth-aside-title { font-size: 1.2rem; }
    .auth-page .auth-aside-sub { margin-bottom: 0; }
    .auth-page .auth-perks,
    .auth-page .auth-aside-note { display: none; }

    .auth-page .auth-trust { grid-template-columns: repeat(2, 1fr); }
    .auth-page .auth-trust-item:nth-child(odd) { border-left: none; }
    .auth-page .auth-trust-item:nth-child(n+3) { border-top: 1px solid var(--a-border); }
}

@media (max-width: 600px) {
    .auth-page { padding: 16px 0 48px; }
    .auth-page .auth-container { padding: 0 12px; }
    .auth-page .auth-main { padding: 22px 18px 24px; }
    .auth-page .auth-title { font-size: 1.12rem; }
    .auth-page .auth-social { grid-template-columns: 1fr; }
}

@media (max-width: 420px) {
    .auth-page .auth-trust { grid-template-columns: 1fr; }
    .auth-page .auth-trust-item { border-left: none; justify-content: flex-start; }
    .auth-page .auth-trust-item + .auth-trust-item { border-top: 1px solid var(--a-border); }
}

/* ---------- Motion preference ---------- */
@media (prefers-reduced-motion: reduce) {
    .auth-page * { transition: none !important; }
    .auth-page .auth-submit:hover { transform: none; }
    .auth-page .auth-spinner { animation-duration: 2s; }
}
