/* ==========================================================================
   Barter Express - Authentication pages (login, register, forgot/reset
   password, resend verification). Mobile-first; scoped under .au.
   Uses the --bx-* tokens from app-shell.css.
   ========================================================================== */

.au {
    background: var(--bx-bg);
    color: var(--bx-text);
    min-height: calc(100vh - var(--bx-nav-h));
    overflow-x: clip;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.55;
}
.au *, .au *::before, .au *::after { box-sizing: border-box; }
:where(.au) :is(h1, h2, h3, p, ul, ol) { margin: 0; padding: 0; }
.au ul { list-style: none; }
.au a { color: var(--bx-blue); font-weight: 600; text-decoration: none; }
html.dark-mode .au a { color: #8dbcf2; }
.au a:hover { text-decoration: underline; }
.au :focus-visible { outline: 3px solid var(--bx-orange); outline-offset: 2px; border-radius: 8px; }

.au-grid { max-width: 1040px; margin: 0 auto; padding: 0 0 36px; }

/* ---------- Side panel: hero banner on phones, brand panel on desktop ---------- */
.au-side {
    position: relative; overflow: hidden;
    padding: 30px 20px 74px;
    color: #fff; text-align: center;
    background: linear-gradient(145deg, var(--bx-blue), var(--bx-blue-dark));
    border-radius: 0 0 28px 28px;
}
.au-side::before {
    content: ''; position: absolute; right: -90px; top: -110px; width: 260px; height: 260px; border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 122, 0, .45), rgba(255, 122, 0, 0) 70%); pointer-events: none;
}
.au-side::after {
    content: ''; position: absolute; left: -90px; bottom: -120px; width: 220px; height: 220px; border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, .16), rgba(255, 255, 255, 0) 70%); pointer-events: none;
}
.au-side > * { position: relative; z-index: 1; }
.au-side > .bx-floaters { position: absolute; z-index: 0; }
.au-kicker {
    display: inline-flex; align-items: center; gap: 8px; margin-bottom: 12px; padding: 6px 14px;
    border-radius: 999px; background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .22);
    font-size: .8rem; font-weight: 600;
}
.au-kicker i { color: var(--bx-orange); }
.au-side h1 { font-size: clamp(1.6rem, 6vw, 2.4rem); line-height: 1.15; font-weight: 800; letter-spacing: -.02em; color: #fff; }
.au-side > p { margin: 10px auto 0; max-width: 460px; color: rgba(255, 255, 255, .88); font-size: 1rem; }
.au-highlight {
    display: flex; align-items: center; gap: 14px; margin: 18px auto 0; padding: 12px 16px; max-width: 460px; text-align: left;
    border-radius: 16px; background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .26);
    font-size: .95rem; color: rgba(255, 255, 255, .92);
}
.au-highlight i {
    flex: 0 0 auto; width: 42px; height: 42px; display: grid; place-items: center;
    border-radius: 13px; background: rgba(255, 255, 255, .16); color: #ffb066; font-size: 1.1rem;
}
.au-highlight strong { display: block; color: #fff; font-size: 1.02rem; }

/* ---------- Card ---------- */
.au-card {
    position: relative; z-index: 2;
    margin: -48px 16px 0;
    padding: 22px 16px;
    background: var(--bx-surface); border: 1px solid var(--bx-border);
    border-radius: var(--bx-radius); box-shadow: var(--bx-shadow);
}
.au-card-head { margin-bottom: 18px; }
.au-card-head h2 { font-size: 1.3rem; font-weight: 800; }
.au-card-head p { color: var(--bx-muted); font-size: .94rem; margin-top: 2px; }

/* ---------- Fields ---------- */
.au-fields { display: grid; gap: 16px; grid-template-columns: 1fr; }
.au-field { min-width: 0; }
.au .au-label { display: block; margin-bottom: 7px; color: var(--bx-text); font-size: .88rem; font-weight: 700; }
.au-wrap { position: relative; }
.au-wrap > .au-lead {
    position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
    color: var(--bx-muted); font-size: .95rem; pointer-events: none;
}
.au .au-input {
    display: block; width: 100%; min-height: 52px;
    padding: 12px 14px 12px 42px;
    border: 1.5px solid var(--bx-border); border-radius: 14px;
    background: var(--bx-surface); color: var(--bx-text);
    font: inherit; font-size: 16px; /* 16px stops iOS zooming on focus */
    transition: border-color .15s ease, box-shadow .15s ease;
    appearance: none; -webkit-appearance: none;
}
.au .au-input::placeholder { color: var(--bx-muted); opacity: .75; }
.au .au-input:focus { outline: none; border-color: var(--bx-orange); box-shadow: 0 0 0 4px rgba(255, 122, 0, .18); }
.au-wrap:focus-within > .au-lead { color: var(--bx-orange); }
.au-wrap.has-eye > .au-input { padding-right: 52px; }
.au .au-input.is-invalid { border-color: var(--bx-danger); }
.au .au-input.is-valid { border-color: var(--bx-success); }
.au-eye {
    position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
    width: 44px; height: 44px; border: 0; border-radius: 12px; background: transparent;
    color: var(--bx-muted); font-size: 1rem; cursor: pointer;
}
.au-hint { margin-top: 6px; color: var(--bx-muted); font-size: .82rem; }
.au-error { margin-top: 6px; color: var(--bx-danger); font-size: .84rem; font-weight: 600; }
.au-error:empty { display: none; }

/* ---------- Password strength & requirements ---------- */
.au-meter { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 10px; }
.au-meter span { height: 6px; border-radius: 3px; background: var(--bx-border); transition: background .2s ease; }
.au-meter[data-level="1"] span:nth-child(-n+1) { background: var(--bx-danger); }
.au-meter[data-level="2"] span:nth-child(-n+2) { background: #f59e0b; }
.au-meter[data-level="3"] span:nth-child(-n+3) { background: #84cc16; }
.au-meter[data-level="4"] span:nth-child(-n+4) { background: var(--bx-success); }
.au-meter-text { margin-top: 6px; min-height: 1.2em; color: var(--bx-muted); font-size: .82rem; }
.au-reqs { display: grid; grid-template-columns: 1fr; gap: 6px; margin-top: 10px; padding: 12px 14px; border-radius: 12px; background: var(--bx-tint); font-size: .85rem; }
.au-req { display: flex; align-items: center; gap: 8px; color: var(--bx-muted); }
.au-req i { width: 16px; text-align: center; font-size: .75rem; color: var(--bx-muted); }
.au-req.is-met { color: var(--bx-success); }
.au-req.is-met i { color: var(--bx-success); }

/* ---------- Checkbox ---------- */
.au .au-check { color: var(--bx-text); display: flex; align-items: flex-start; gap: 12px; min-height: 44px; padding: 6px 0; cursor: pointer; font-size: .92rem; }
.au-check input { flex: 0 0 auto; width: 22px; height: 22px; margin-top: 1px; accent-color: var(--bx-orange); }
.au-row { display: flex; align-items: center; justify-content: space-between; gap: 0 12px; flex-wrap: wrap; }
.au-row > a { margin-left: auto; min-height: 44px; display: inline-flex; align-items: center; }

/* ---------- Buttons & misc ---------- */
.au-btn {
    display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%;
    min-height: 52px; padding: 12px 22px; margin-top: 20px;
    border: 0; border-radius: 14px;
    background: var(--bx-orange); color: #fff !important;
    font: inherit; font-size: 1.02rem; font-weight: 700; cursor: pointer; text-decoration: none !important;
    box-shadow: 0 8px 18px rgba(255, 122, 0, .3);
    transition: transform .15s ease, background .15s ease;
    -webkit-tap-highlight-color: transparent;
}
.au-btn:hover { background: var(--bx-orange-dark); }
.au-btn:active { transform: scale(.98); }
.au-btn[disabled] { opacity: .6; cursor: progress; }
.au-btn.ghost { background: var(--bx-surface); color: var(--bx-blue) !important; border: 2px solid var(--bx-border); box-shadow: none; }
html.dark-mode .au-btn.ghost { color: #9cc7f5 !important; }
.au-alt { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--bx-border); text-align: center; color: var(--bx-muted); font-size: .94rem; }
.au-alt a { display: inline-block; margin-top: 4px; }
.au-callout {
    display: flex; gap: 12px; align-items: flex-start; margin-bottom: 18px; padding: 14px 16px;
    border-radius: 14px; background: #fff7e6; border-left: 4px solid var(--bx-orange); font-size: .92rem; color: #7a4a00;
}
html.dark-mode .au-callout { background: rgba(245, 158, 11, .12); color: #fcd34d; }
.au-callout > i { margin-top: 3px; color: var(--bx-orange); }
.au-callout p + a { display: inline-block; margin-top: 6px; }
.au-callout.info { background: var(--bx-tint); border-left-color: var(--bx-blue); color: var(--bx-text); }
.au-callout.info > i { color: var(--bx-blue); }
html.dark-mode .au-callout.info > i { color: #8dbcf2; }
.au-referral summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; color: var(--bx-blue); font-weight: 700; font-size: .92rem; }
html.dark-mode .au-referral summary { color: #8dbcf2; }
.au-referral summary::-webkit-details-marker { display: none; }
.au-referral[open] summary i { transform: rotate(90deg); }
.au-referral summary i { transition: transform .2s ease; font-size: .75rem; }
.au-referral .au-field { margin-top: 6px; }

.au-why { margin: 18px 16px 0; padding: 16px; border-radius: var(--bx-radius-sm); background: var(--bx-surface); border: 1px solid var(--bx-border); font-size: .9rem; }
.au-why h3 { font-size: .95rem; font-weight: 800; margin-bottom: 8px; }
.au-why li { position: relative; padding: 3px 0 3px 22px; color: var(--bx-muted); }
.au-why li::before { content: '\f00c'; font-family: 'Font Awesome 6 Free'; font-weight: 900; position: absolute; left: 0; top: 5px; font-size: .7rem; color: var(--bx-success); }

/* ---------- Tablet / desktop ---------- */
@media (min-width: 640px) {
    .au-side { padding: 44px 24px 86px; }
    .au-card { margin: -52px auto 0; max-width: 520px; padding: 30px; }
    .au-why { max-width: 520px; margin: 18px auto 0; }
    .au-fields.cols-2 { grid-template-columns: 1fr 1fr; }
    .au-fields .full { grid-column: 1 / -1; }
}
@media (min-width: 960px) {
    .au-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; align-items: stretch; padding: 32px 24px 48px; }
    .au-side {
        display: flex; flex-direction: column; justify-content: center; align-items: flex-start; text-align: left;
        padding: 48px 40px; border-radius: 28px;
    }
    .au-side > p { margin-left: 0; }
    .au-highlight { margin-left: 0; margin-top: 26px; }
    .au-card { margin: 0; max-width: none; align-self: center; }
    .au-why { grid-column: 2; margin: 0; max-width: none; }
    .au-grid.is-wide { grid-template-columns: 5fr 7fr; }
}
@media (min-width: 640px) {
    .au-reqs { grid-template-columns: 1fr 1fr; }
}
@media (prefers-reduced-motion: reduce) {
    .au .au-input, .au-btn, .au-meter span { transition: none; }
}
