/* ============================================================
   brafa Systems — Auth screens + error pages
   Part of the brafa shell. Loaded after brafa-shell.css (which holds
   the layout shell + .brafa-screen primitives). Split out of the former
   monolithic brafa-shell.css so per-area page work stops colliding.
   ============================================================ */

/* ============================================================
   AUTH SCREENS (sign in) — full-screen split layout.
   Self-contained (does not depend on .brafa-screen) so it can
   run on the guest routes that don't carry the shell body class.
   ============================================================ */
.brafa-auth {
    display: grid;
    grid-template-columns: 1.05fr 1fr;
    min-height: 100vh;
    background: var(--bg);
    color: var(--fg);
    font-family: var(--font-body);
}
@media (max-width: 859.98px) {
    .brafa-auth { grid-template-columns: 1fr; }
}

/* ---- Left brand panel ---- */
.brafa-auth__brand {
    position: relative;
    background: var(--brafa-ink);
    color: var(--brafa-white);
    padding: 48px 56px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
}
@media (max-width: 859.98px) {
    .brafa-auth__brand { display: none; }
}
.brafa-auth__brand::after {
    /* subtle hairline grid texture, monochrome (no gradients/mesh) */
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.04) 1px, transparent 1px);
    background-size: 48px 48px;
    pointer-events: none;
}
.brafa-auth__brand > * { position: relative; z-index: 1; }
.brafa-auth__brand-mark {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
/* brafa Systems lockup. Artwork is white — used as-is on the dark brand
   panel; inverted to black for the light mobile lockup. */
.brafa-auth__logo {
    width: 160px;
    max-width: 70%;
    height: auto;
    display: block;
}
.brafa-auth__logo--dark { filter: brightness(0); width: 130px; }
.brafa-auth__brand-name {
    font-family: var(--font-display);
    font-size: 30px;
    font-weight: var(--weight-light);
    letter-spacing: -0.01em;
    line-height: 1;
    color: var(--brafa-white);
}
.brafa-auth__brand-sub {
    font-family: var(--font-wide);
    font-size: 10px;
    letter-spacing: 0.4em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.55);
}
.brafa-auth__brand-tagline {
    max-width: 380px;
}
.brafa-auth__brand-tagline h2 {
    font-family: var(--font-display);
    font-weight: var(--weight-light);
    font-size: 38px;
    line-height: 1.12;
    letter-spacing: -0.01em;
    margin: 0 0 14px;
    color: var(--brafa-white);
}
.brafa-auth__brand-tagline p {
    margin: 0;
    color: rgba(255,255,255,0.6);
    font-size: 14px;
    line-height: 1.6;
}
.brafa-auth__brand-foot {
    font-family: var(--font-wide);
    font-size: 10px;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.4);
}

/* ---- Right form panel ---- */
.brafa-auth__panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
}
.brafa-auth__card {
    width: 100%;
    max-width: 380px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
/* Small phones: trim the panel gutter and let the card use the full width
   so the form isn't crammed into a sliver. */
@media (max-width: 575.98px) {
    .brafa-auth__panel { padding: 32px 16px; }
    .brafa-auth__card { max-width: 100%; }
}
.brafa-auth__eyebrow {
    font-family: var(--font-wide);
    font-size: 10px;
    font-weight: var(--weight-medium);
    letter-spacing: 0.4em;
    text-transform: uppercase;
    color: var(--fg-subtle);
}
.brafa-auth__title {
    font-family: var(--font-display);
    font-size: 34px;
    font-weight: var(--weight-light);
    letter-spacing: -0.01em;
    color: var(--fg);
    margin: 2px 0 4px;
}
.brafa-auth__subtitle {
    color: var(--fg-muted);
    font-size: 13.5px;
    margin: 0 0 22px;
}

/* Mobile-only brand lockup above the form */
.brafa-auth__mobile-brand {
    display: none;
}
@media (max-width: 859.98px) {
    .brafa-auth__mobile-brand {
        display: flex;
        flex-direction: column;
        gap: 2px;
        margin-bottom: 28px;
    }
    .brafa-auth__mobile-brand .brafa-auth__brand-name { color: var(--fg); }
}

.brafa-auth__form { display: flex; flex-direction: column; gap: 16px; }
.brafa-auth__field { display: flex; flex-direction: column; }
.brafa-auth label.brafa-auth__label {
    display: block;
    font-family: var(--font-wide);
    font-size: 11px;
    font-weight: var(--weight-medium);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--fg-subtle);
    margin: 0 0 6px;
}
.brafa-auth input.brafa-auth__input {
    display: block;
    width: 100%;
    padding: 11px 14px;
    font-family: var(--font-body);
    font-size: 14px;
    color: var(--fg);
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    outline: none;
    box-shadow: none;
    transition: border-color var(--dur-fast) var(--ease);
}
.brafa-auth input.brafa-auth__input:hover { border-color: var(--brafa-steel); }
.brafa-auth input.brafa-auth__input:focus { border-color: var(--brafa-black); }
.brafa-auth input.brafa-auth__input.is-invalid { border-color: var(--brafa-red); }
.brafa-auth__error { margin: 6px 0 0; font-size: 12px; color: var(--brafa-red); }

.brafa-auth__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 2px 0 4px;
}
.brafa-auth__check {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--fg-muted);
    cursor: pointer;
    user-select: none;
}
.brafa-auth__check input {
    width: 15px;
    height: 15px;
    accent-color: var(--brafa-black);
    cursor: pointer;
}
.brafa-auth__link {
    font-size: 13px;
    color: var(--fg);
    text-decoration: none;
    border-bottom: 1px solid var(--border);
    transition: border-color var(--dur-fast) var(--ease);
}
.brafa-auth__link:hover { color: var(--fg); border-color: var(--brafa-black); }

.brafa-auth button.brafa-auth__submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px 16px;
    margin-top: 4px;
    font-family: var(--font-body);
    font-size: 13.5px;
    font-weight: var(--weight-medium);
    letter-spacing: 0.02em;
    color: var(--brafa-white);
    background: var(--brafa-black);
    border: 1px solid var(--brafa-black);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: background var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
}
.brafa-auth button.brafa-auth__submit:hover { background: var(--brafa-ink); }
.brafa-auth button.brafa-auth__submit:active { transform: translateY(1px); }

.brafa-auth__foot {
    margin: 20px 0 0;
    text-align: center;
    font-size: 13px;
    color: var(--fg-muted);
}

.brafa-auth__status {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 14px;
    margin-bottom: 18px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--brafa-green-deep);
    background: var(--brafa-green-soft);
    color: var(--brafa-green-deep);
    font-size: 13px;
}
.brafa-auth__status--danger {
    border-color: var(--brafa-red);
    background: var(--brafa-red-soft);
    color: var(--brafa-red);
}

/* ============================================================
   ERROR PAGES (404 / 500) — full-screen centered brafa.
   ============================================================ */
.brafa-error {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 40px 24px;
    background: var(--bg);
    color: var(--fg);
    font-family: var(--font-body);
}
.brafa-error__inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 8px;
    max-width: 460px;
}
.brafa-error__logo {
    width: 130px;
    height: auto;
    filter: brightness(0);
    margin-bottom: 18px;
}
.brafa-error__eyebrow {
    font-family: var(--font-wide);
    font-size: 10px;
    font-weight: var(--weight-medium);
    letter-spacing: 0.4em;
    text-transform: uppercase;
    color: var(--fg-subtle);
}
.brafa-error__code {
    font-family: var(--font-display);
    font-size: 96px;
    font-weight: var(--weight-light);
    line-height: 1;
    letter-spacing: -0.02em;
    color: var(--fg);
    margin: 4px 0;
}
.brafa-error__title {
    font-family: var(--font-display);
    font-size: 24px;
    font-weight: var(--weight-regular);
    color: var(--fg);
    margin: 0;
}
.brafa-error__text {
    color: var(--fg-muted);
    font-size: 14px;
    line-height: 1.6;
    margin: 4px 0 22px;
}
.brafa-error .btn,
.brafa-error a.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 20px;
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: var(--weight-medium);
    letter-spacing: 0.02em;
    color: var(--brafa-white);
    background: var(--brafa-black);
    border: 1px solid var(--brafa-black);
    border-radius: var(--radius-md);
    text-decoration: none;
    cursor: pointer;
    transition: background var(--dur-fast) var(--ease);
}
.brafa-error .btn:hover { background: var(--brafa-ink); color: var(--brafa-white); }

