/* ==========================================================================
   Customer auth pages (/customer-login).

   Two panels — a navy brand rail and a focused form — deliberately the same
   shape as the store-owner login at /login.php, so the two doors into the
   product read as siblings. The palettes differ on purpose: /login.php is a
   portal door and follows the store portal's `sp-theme` preference, while this
   is a public-site door and follows the --pub-* tokens in wpl-public-theme.css.

   Namespacing: .auth-* is this layout. See the note at the top of
   wpl-public-theme.css for how --pub-*, --wpl-* and --sp-* divide up.
   ========================================================================== */

/* This page loads no Bootstrap — it uses none of its components — so the
   border-box reset every other page inherits from it has to be stated. Without
   it `width: 100%` on an input adds its padding and border on top, and the
   password field (inside .password-field-wrapper) ends up wider than the email
   field beside it. */
*, *::before, *::after { box-sizing: border-box; }

html, body {
    height: 100%;
    margin: 0;
}

body {
    background: var(--pub-page);
    color: var(--pub-ink);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

.auth-shell {
    min-height: 100vh;
    display: flex;
}

/* --------------------------------------------------------------------------
   Brand rail. Navy in both themes, the same call the header and the store
   portal make — so the page has one fixed anchor whichever way the theme goes.
   -------------------------------------------------------------------------- */

.auth-brand {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    flex: 1 1 45%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 2rem;
    padding: 3rem 3.25rem;
    background: linear-gradient(135deg, #0d2338 0%, #193f63 55%, #235789 100%);
    color: rgba(255, 255, 255, 0.82);
}

/* A soft light source behind the pitch, so the flat gradient has somewhere to
   come from. */
.auth-brand::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: radial-gradient(700px 420px at 18% 22%, rgba(125, 184, 236, 0.22), transparent 68%);
}

.auth-logo {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    font-family: 'Playfair Display', Lora, Georgia, serif;
    font-size: 1.4rem;
    font-weight: 700;
    color: #fff;
    text-decoration: none;
}

.auth-logo:hover { color: #7db8ec; }

.auth-logo-mark {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    border-radius: 10px;
    background: linear-gradient(145deg, #5598e7, #235789);
    color: #fff;
    font-size: 0.95rem;
}

.auth-beta {
    display: inline-block;
    margin-left: 0.5rem;
    padding: 0.12rem 0.55rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    vertical-align: middle;
}

.auth-pitch h2 {
    margin: 0 0 0.75rem;
    font-family: 'Playfair Display', Lora, Georgia, serif;
    font-size: clamp(1.7rem, 2.6vw, 2.1rem);
    font-weight: 700;
    line-height: 1.22;
    color: #fff;
}

.auth-pitch > p {
    max-width: 400px;
    margin-bottom: 2rem;
    font-size: 0.95rem;
    line-height: 1.6;
}

.auth-feature {
    display: flex;
    align-items: flex-start;
    gap: 0.9rem;
    max-width: 420px;
    margin-bottom: 1.15rem;
}

.auth-feature-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    flex-shrink: 0;
    border-radius: 11px;
    background: rgba(255, 255, 255, 0.1);
    color: #7db8ec;
    font-size: 0.95rem;
}

.auth-feature strong {
    display: block;
    margin-bottom: 0.1rem;
    font-size: 0.92rem;
    color: #fff;
}

.auth-feature p {
    margin: 0;
    font-size: 0.85rem;
    line-height: 1.5;
}

.auth-brand-foot {
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.5);
}

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

.auth-main {
    flex: 1 1 55%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2.5rem 1.5rem;
}

.auth-card {
    width: 100%;
    max-width: 430px;
}

/* "Back to where you came from", when the visitor was sent here mid-task. */
.auth-back {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    margin-bottom: 1rem;
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--pub-ink-2);
    text-decoration: none;
}

.auth-back:hover { color: var(--pub-accent-2); }
.auth-back i { transition: transform 0.2s ease; }
.auth-back:hover i { transform: translateX(-3px); }

.auth-card-box {
    padding: 2rem 2rem 1.75rem;
    border: 1px solid var(--pub-border);
    border-radius: 16px;
    background: var(--pub-surface);
    box-shadow: var(--pub-shadow);
}

.auth-title {
    margin: 0 0 0.3rem;
    font-family: 'Playfair Display', Lora, Georgia, serif;
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--pub-ink);
}

.auth-sub {
    margin: 0 0 1.5rem;
    font-size: 0.92rem;
    line-height: 1.5;
    color: var(--pub-ink-2);
}

.auth-field { margin-bottom: 1rem; }

.auth-label {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--pub-muted);
}

.auth-input {
    width: 100%;
    padding: 0.65rem 0.85rem;
    border: 1px solid var(--pub-border);
    border-radius: 10px;
    background: var(--pub-page);
    color: var(--pub-ink);
    font-size: 0.95rem;
    line-height: 1.4;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.auth-input::placeholder { color: var(--pub-muted); }

.auth-input:focus {
    outline: none;
    border-color: var(--pub-accent-2);
    box-shadow: 0 0 0 3px var(--pub-accent-soft);
}

/* Chrome paints autofilled inputs a fixed pale yellow, which is unreadable on
   the dark surface. An inset shadow the size of the field is the only way to
   repaint it. */
.auth-input:-webkit-autofill,
.auth-input:-webkit-autofill:hover,
.auth-input:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--pub-ink);
    -webkit-box-shadow: 0 0 0 1000px var(--pub-page) inset;
    caret-color: var(--pub-ink);
}

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

.auth-forgot {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--pub-accent-2);
    text-decoration: none;
}

.auth-forgot:hover { text-decoration: underline; }

/* The toggle button comes from the shared assets/js/password-toggle.js, which
   keys off .password-field-wrapper / .password-toggle-btn. Only the colours are
   restated here, so the shared script keeps working untouched. */
.auth-card .password-toggle-btn {
    right: 0.6rem;
    color: var(--pub-muted);
}

.auth-card .password-toggle-btn:hover { color: var(--pub-accent-2); }

.auth-card .password-toggle-btn:focus-visible {
    outline: 2px solid var(--pub-accent-2);
    outline-offset: 2px;
    border-radius: 6px;
}

.auth-card .password-field-wrapper input { padding-right: 2.6rem; }

.auth-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    margin-top: 1.35rem;
    padding: 0.7rem 1rem;
    border: 1px solid transparent;
    border-radius: 10px;
    background: linear-gradient(145deg, var(--pub-accent-2), var(--pub-brand));
    color: #fff;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18), 0 6px 18px rgba(35, 87, 137, 0.3);
    transition: filter 0.2s ease, transform 0.15s ease;
}

.auth-submit:hover { filter: brightness(1.09); }
.auth-submit:active { transform: translateY(1px); }

.auth-register {
    margin: 1.4rem 0 0;
    padding-top: 1.25rem;
    border-top: 1px solid var(--pub-border);
    font-size: 0.88rem;
    color: var(--pub-ink-2);
    text-align: center;
}

.auth-register a {
    color: var(--pub-accent-2);
    font-weight: 600;
    text-decoration: none;
}

.auth-register a:hover { text-decoration: underline; }

.auth-legal {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.5rem 1.25rem;
    margin-top: 1.4rem;
    font-size: 0.78rem;
}

.auth-legal a {
    color: var(--pub-muted);
    text-decoration: none;
}

.auth-legal a:hover { color: var(--pub-accent-2); }

/* --------------------------------------------------------------------------
   Register only — the signup form carries more than an email and a password.
   -------------------------------------------------------------------------- */

/* Signup needs the extra width for the side-by-side name row. */
.auth-card-wide { max-width: 520px; }

.auth-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 0.75rem;
}

@media (max-width: 419.98px) {
    .auth-row { grid-template-columns: 1fr; }
}

/* The shop invite that replaces the generic pitch when someone arrives through
   a shop's QR code (/customer-register/{business-slug}). */
.auth-invite {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    max-width: 420px;
    margin-bottom: 1.5rem;
    padding: 0.9rem 1rem;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.07);
}

/* Shop logos arrive at every aspect ratio and usually with white baked in, so
   they sit on a fixed white tile rather than on the navy. */
.auth-invite-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    flex-shrink: 0;
    padding: 5px;
    border-radius: 12px;
    background: #fff;
    overflow: hidden;
}

.auth-invite-logo img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.auth-invite span {
    display: block;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: #7db8ec;
}

.auth-invite strong {
    display: block;
    margin-top: 0.1rem;
    font-size: 1.02rem;
    color: #fff;
}

/* The same invite, restated inside the form panel — on mobile the brand rail
   collapses to a bare logo strip and the invite would vanish with it. */
.auth-invite-inline {
    display: none;
    align-items: center;
    gap: 0.8rem;
    margin-bottom: 1rem;
    padding: 0.8rem 0.95rem;
    border: 1px solid var(--pub-border);
    border-radius: 14px;
    background: var(--pub-surface);
    box-shadow: var(--pub-shadow);
}

.auth-invite-inline span {
    display: block;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--pub-muted);
}

.auth-invite-inline strong {
    display: block;
    margin-top: 0.1rem;
    font-size: 0.98rem;
    color: var(--pub-ink);
}

/* Password rules. assets/css/password-validator.css paints this panel a fixed
   light grey and its rows fixed red/green, which is unreadable on the dark
   card — repainted here, scoped so the other consumers keep what they have.
   The .text-danger / .text-success classes the validator script toggles carry
   !important, so the colour has to be won on the <i> and a sibling selector
   rather than on the row itself. */
.auth-card .password-requirements {
    margin: 0 0 1.15rem;
    padding: 0.9rem 1rem;
    border: 1px solid var(--pub-border);
    border-radius: 12px;
    background: var(--pub-surface-2);
}

.auth-card .password-requirements h6 {
    margin: 0 0 0.55rem;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--pub-muted);
}

.auth-card .password-requirements li {
    margin-bottom: 0.35rem;
    font-size: 0.82rem;
    line-height: 1.4;
    color: var(--pub-ink-2);
}

.auth-card .password-requirements li.text-danger { color: var(--pub-ink-2) !important; }
.auth-card .password-requirements li.text-success { color: var(--pub-good) !important; }
.auth-card .password-requirements li.text-danger .requirement-icon { color: var(--pub-muted); }
.auth-card .password-requirements li.text-success .requirement-icon { color: var(--pub-good); }

/* Consent rows */
.auth-check {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    margin-bottom: 0.75rem;
    font-size: 0.85rem;
    line-height: 1.5;
    color: var(--pub-ink-2);
}

.auth-check input {
    width: 16px;
    height: 16px;
    margin-top: 0.18rem;
    flex-shrink: 0;
    accent-color: var(--pub-accent-2);
    cursor: pointer;
}

.auth-check label { cursor: pointer; }

.auth-check a {
    color: var(--pub-accent-2);
    font-weight: 600;
    text-decoration: none;
}

.auth-check a:hover { text-decoration: underline; }

/* Live mismatch warning under "confirm password". A mismatch used to reach the
   server and come back as a bare white die() page with no way back. */
.auth-mismatch {
    display: none;
    align-items: center;
    gap: 0.4rem;
    margin: 0.4rem 0 0;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--pub-hot);
}

.auth-mismatch.is-on { display: flex; }

/* --------------------------------------------------------------------------
   Messages. The login page used to mix a Bootstrap toast (for the verify-your-
   email notice, easy to miss and gone in 8 seconds) with three different
   flavours of .alert; they are one object now, above the form where they get
   read.
   -------------------------------------------------------------------------- */

.auth-note {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    margin-bottom: 1rem;
    padding: 0.8rem 0.95rem;
    border: 1px solid var(--pub-border);
    border-radius: 12px;
    background: var(--pub-surface);
    font-size: 0.88rem;
    line-height: 1.5;
    color: var(--pub-ink-2);
}

.auth-note i {
    margin-top: 0.15rem;
    flex-shrink: 0;
}

.auth-note-bad {
    border-color: var(--pub-hot);
    background: var(--pub-hot-soft);
    color: var(--pub-ink);
}

.auth-note-bad i { color: var(--pub-hot); }

.auth-note-ok {
    border-color: var(--pub-good);
    background: var(--pub-good-soft);
    color: var(--pub-ink);
}

.auth-note-ok i { color: var(--pub-good); }

.auth-note-info {
    border-color: var(--pub-accent-2);
    background: var(--pub-accent-soft);
    color: var(--pub-ink);
}

.auth-note-info i { color: var(--pub-accent-2); }

/* --------------------------------------------------------------------------
   Responsive — the rail becomes a slim top bar and the pitch stands down.
   -------------------------------------------------------------------------- */

@media (max-width: 991.98px) {
    .auth-shell { flex-direction: column; }

    .auth-brand {
        flex: 0 0 auto;
        flex-direction: row;
        align-items: center;
        padding: 1.1rem 1.5rem;
    }

    .auth-pitch,
    .auth-brand-foot { display: none; }

    .auth-main {
        flex: 1 1 auto;
        align-items: flex-start;
        padding-top: 2.25rem;
    }

    /* The invite lives in the pitch on desktop; below that it moves into the
       form panel so a QR-code visitor still sees whose shop invited them. */
    .auth-invite-inline { display: flex; }
}

@media (max-width: 575.98px) {
    .auth-card-box { padding: 1.5rem 1.25rem 1.35rem; }
}
