/*
 * Staff sign-in and password reset (layouts/auth.blade.php).
 * Split panel restored from the earlier login modal (owner decision 2026-10-14):
 * photo panel left with a dark overlay, red vertical accent line and the PANEXIS
 * wordmark; white form panel right. --primary, --secondary, --fh and --fb come from
 * Settings > Appearance (printed by the layout). 0px radius, like the public site.
 */

:root {
    --auth-surface: #f5f5f5;
    --auth-border: #e8e8e8;
    --auth-muted: #595959;      /* 7:1 on white */
    --auth-input-border: #767676; /* 4.5:1 on white, visible field edge */
    --auth-on-dark-muted: rgba(255, 255, 255, 0.82);
    --auth-tap: 44px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body.auth-body {
    margin: 0;
    min-height: 100vh;
    background: var(--auth-surface);
    color: var(--primary);
    font-family: var(--fb);
    font-size: 15px;
    line-height: 1.5;
}

.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 16px;
}

.auth-split {
    width: 100%;
    max-width: 960px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
    min-height: 580px;
    background: #fff;
    border: 1px solid var(--auth-border);
}

/* ---------- Photo panel ---------- */

.auth-visual {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    background: var(--primary);
    color: #fff;
}

.auth-visual-photo {
    position: absolute;
    inset: 0;
    z-index: -2;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Overlay purpose: readability. White text stays above 7:1 even on the brightest part of the photo. */
.auth-visual::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.9), rgba(0, 0, 0, 0.74));
}

/* Red vertical accent line: the one accent in the panel. */
.auth-visual::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 4px;
    background: var(--secondary);
}

.auth-visual-inner {
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: 40px;
    padding: 56px 40px 40px 44px;
}

.auth-wordmark {
    display: flex;
    flex-direction: column;
    margin: 0;
}

.auth-wordmark-main {
    font-family: var(--fh);
    font-size: 48px;
    font-weight: 800;
    letter-spacing: 0.04em;
    line-height: 1;
}

.auth-wordmark-sub {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.38em;
    margin-top: 6px;
    color: var(--auth-on-dark-muted);
}

.auth-visual-body {
    margin-top: auto;
}

.auth-visual-title {
    font-family: var(--fh);
    font-size: 28px;
    font-weight: 800;
    line-height: 1.1;
    text-transform: uppercase;
    margin: 0 0 14px;
}

.auth-visual-text {
    font-size: 14px;
    line-height: 1.65;
    color: var(--auth-on-dark-muted);
    margin: 0;
    max-width: 34ch;
}

.auth-visual-footer {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--auth-on-dark-muted);
    margin: 0;
}

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

.auth-main {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 56px 52px 40px;
}

.auth-header {
    margin-bottom: 28px;
}

.auth-title {
    font-family: var(--fh);
    font-size: 32px;
    font-weight: 800;
    line-height: 1;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    margin: 0 0 8px;
}

.auth-subtitle {
    color: var(--auth-muted);
    font-size: 14px;
    margin: 0;
}

.auth-alert {
    padding: 12px 16px;
    margin-bottom: 20px;
    font-size: 14px;
    border-left: 3px solid;
}

.auth-alert ul {
    margin: 0;
    padding-left: 18px;
}

.auth-alert--error {
    background: #fdf2f2;
    border-color: #b91c1c;
    color: #8f1515;
}

.auth-alert--success {
    background: #e6f4ea;
    border-color: #1e7a37;
    color: #17602b;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.auth-field label {
    display: block;
    font-family: var(--fh);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.auth-input {
    width: 100%;
    min-height: var(--auth-tap);
    padding: 10px 14px;
    border: 1px solid var(--auth-input-border);
    border-radius: 0;
    background: #fff;
    color: var(--primary);
    font-family: var(--fb);
    font-size: 15px;
}

.auth-input:focus {
    border-color: var(--primary);
}

.auth-input[aria-invalid="true"] {
    border-color: #b91c1c;
}

.auth-help {
    font-size: 13px;
    color: var(--auth-muted);
    margin: 6px 0 0;
}

.auth-password {
    display: flex;
}

.auth-password .auth-input {
    flex: 1;
    min-width: 0;
}

.auth-reveal {
    min-width: 64px;
    min-height: var(--auth-tap);
    border: 1px solid var(--auth-input-border);
    border-left: 0;
    background: #fff;
    color: var(--primary);
    font-family: var(--fh);
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    cursor: pointer;
}

.auth-reveal[aria-pressed="true"] {
    background: var(--primary);
    color: #fff;
}

.auth-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 16px;
}

.auth-check {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: var(--auth-tap);
    font-size: 14px;
    cursor: pointer;
}

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

.auth-link-accent {
    display: inline-flex;
    align-items: center;
    min-height: var(--auth-tap);
    color: var(--secondary);
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
}

.auth-link-accent:hover {
    text-decoration: underline;
}

.auth-submit {
    width: 100%;
    min-height: 48px;
    margin-top: 6px;
    border: 0;
    border-radius: 0;
    background: var(--primary);
    color: #fff;
    font-family: var(--fh);
    font-size: 17px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    cursor: pointer;
}

.auth-submit:hover,
.auth-submit:focus-visible {
    background: var(--secondary);
}

.auth-secondary {
    margin: 20px 0 0;
    font-size: 14px;
}

.auth-secondary a,
.auth-back a {
    display: inline-flex;
    align-items: center;
    min-height: var(--auth-tap);
    color: var(--primary);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.auth-secondary a:hover,
.auth-back a:hover {
    color: var(--secondary);
}

.auth-back {
    margin: auto 0 0;
    padding-top: 24px;
    font-size: 13px;
}

.auth-back a {
    color: var(--auth-muted);
    font-weight: 500;
}

/* One visible focus style for every control: 2px outline in the Primary color. */
.auth-body a:focus-visible,
.auth-body button:focus-visible,
.auth-body input:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.auth-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ---------- Small screens: the photo panel becomes a short banner above the form ---------- */

@media (max-width: 767px) {
    .auth-page {
        padding: 0;
        align-items: stretch;
    }

    .auth-split {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr;
        min-height: 100vh;
        border: 0;
    }

    .auth-visual-inner {
        gap: 16px;
        padding: 24px 16px 22px 20px;
    }

    .auth-wordmark-main {
        font-size: 30px;
    }

    .auth-wordmark-sub {
        font-size: 11px;
    }

    .auth-visual-title {
        font-size: 22px;
        margin: 0;
    }

    .auth-visual-text,
    .auth-visual-footer {
        display: none;
    }

    .auth-main {
        justify-content: flex-start;
        padding: 28px 16px 24px;
    }

    .auth-title {
        font-size: 26px;
    }

    /* Keep the catalog link next to the form instead of at the bottom of the screen. */
    .auth-back {
        margin-top: 8px;
    }
}

@media (prefers-reduced-motion: no-preference) {
    .auth-submit,
    .auth-reveal,
    .auth-input {
        transition: background-color 0.15s ease, border-color 0.15s ease;
    }
}
