/* ============================================================
   LOGIN & TOTP — Variant A "Minimal Slate"
   Flat, sharp, professional. Graphite dark mode.
   No box-shadow hover effects on buttons.
   ============================================================ */

:root {
    --bg: #f4f5f7;
    --surface: #ffffff;
    --surface-border: rgba(15, 23, 42, 0.07);
    --accent: #2563eb;
    --accent-hover: #1d4ed8;
    --accent-active: #1e40af;
    --accent-subtle: rgba(37, 99, 235, 0.08);
    --title: #0f172a;
    --body: #475569;
    --muted: #94a3b8;
    --label: #334155;
    --field-bg: #f8fafc;
    --field-border: rgba(15, 23, 42, 0.10);
    --field-focus-border: rgba(37, 99, 235, 0.40);
    --field-placeholder: #94a3b8;
    --btn-text: #ffffff;
    --checkbox-bg: #ffffff;
    --checkbox-border: rgba(15, 23, 42, 0.16);
    --error-bg: rgba(239, 68, 68, 0.06);
    --error-border: rgba(239, 68, 68, 0.14);
    --error-text: #dc2626;
    --secondary-bg: #eef4ff;
    --secondary-hover: #dbeafe;
    --secondary-border: #bfdbfe;
    --secondary-text: #1e40af;
    --chip-bg: rgba(15, 23, 42, 0.04);
    --chip-border: rgba(15, 23, 42, 0.08);
}

/* Graphite dark mode */
[data-theme="dark"] {
    --bg: #28292b;
    --surface: #323335;
    --surface-border: rgba(255, 255, 255, 0.06);
    --accent: #4f8cff;
    --accent-hover: #6a9dff;
    --accent-active: #3b78e7;
    --accent-subtle: rgba(79, 140, 255, 0.16);
    --title: #eaeaea;
    --body: #9ca3af;
    --muted: #6b7280;
    --label: #d1d5db;
    --field-bg: #2c2d2f;
    --field-border: rgba(255, 255, 255, 0.07);
    --field-focus-border: rgba(96, 165, 250, 0.28);
    --field-placeholder: #6b7280;
    --btn-text: #ffffff;
    --checkbox-bg: #2c2d2f;
    --checkbox-border: rgba(255, 255, 255, 0.10);
    --error-bg: rgba(248, 113, 113, 0.08);
    --error-border: rgba(248, 113, 113, 0.14);
    --error-text: #fca5a5;
    --secondary-bg: rgba(79, 140, 255, 0.16);
    --secondary-hover: rgba(79, 140, 255, 0.24);
    --secondary-border: rgba(79, 140, 255, 0.36);
    --secondary-text: #d8ecff;
    --chip-bg: rgba(255, 255, 255, 0.04);
    --chip-border: rgba(255, 255, 255, 0.06);
}

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

html,
body {
    min-height: 100%;
}

body {
    margin: 0;
    font-family: var(--erp-font-sans, "Inter", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, Arial, sans-serif);
    color: var(--title);
    background: var(--bg);
    line-height: 1.5;
}

body.login-page-splitscreen {
    overflow: hidden;
}

/* ==========================
   SHELL
   ========================== */
.login-shell {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 32px 18px;
    position: relative;
}

/* ==========================
   THEME TOGGLE (outside card)
   ========================== */
.login-theme-toggle {
    position: absolute;
    top: calc(var(--erp-env-banner-offset, 0px) + 24px);
    right: 24px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--surface-border);
    background: var(--surface);
    color: var(--muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
    padding: 0;
    z-index: 10;
}

.login-theme-toggle:hover {
    background: var(--accent-subtle);
    border-color: var(--accent);
    color: var(--accent);
}

.login-theme-toggle .material-icons-round {
    font-size: 20px;
}

/* Icon visibility */
.login-theme-toggle .theme-icon-dark  { display: inline-flex; }
.login-theme-toggle .theme-icon-light { display: none; }

[data-theme="dark"] .login-theme-toggle .theme-icon-dark  { display: none; }
[data-theme="dark"] .login-theme-toggle .theme-icon-light { display: inline-flex; }

/* ==========================
   CARD
   ========================== */
.login-card {
    width: 400px;
    max-width: 100%;
    padding: 32px;
    border-radius: 4px;
    background: var(--surface);
    border: 1px solid var(--surface-border);
}

.login-card--auth-failed {
    animation: login-auth-shake 360ms cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

@keyframes login-auth-shake {
    0%,
    100% {
        transform: translateX(0);
    }

    18%,
    54% {
        transform: translateX(-6px);
    }

    36%,
    72% {
        transform: translateX(4px);
    }
}

/* ==========================
   LOGO
   ========================== */
.logo-wrapper {
    width: 45px;
    height: 45px;
    margin-bottom: 24px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: var(--accent-subtle);
    overflow: hidden;
}

.logo {
    width: 45px;
    height: 45px;
    object-fit: contain;
}

/* ==========================
   HEADER
   ========================== */
.login-header {
    margin-bottom: 28px;
}

.login-title {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--title);
    line-height: 1.15;
}

.login-subtitle {
    margin: 6px 0 0;
    font-size: 0.875rem;
    color: var(--body);
    line-height: 1.5;
}

/* ==========================
   ERROR MESSAGE
   ========================== */
.message-box {
    margin: 0 0 18px;
    padding: 10px 14px;
    border-radius: 8px;
    background: var(--error-bg);
    border: 1px solid var(--error-border);
    color: var(--error-text);
    font-size: 0.8125rem;
    font-weight: 500;
}

@media (prefers-reduced-motion: reduce) {
    .login-card--auth-failed {
        animation: none;
    }
}

/* ==========================
   FORM
   ========================== */
.login-form {
    display: grid;
    gap: 18px;
}

.login-passkey {
    margin-top: 18px;
    display: grid;
    gap: 14px;
}

.login-passkey-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--muted);
    font-size: 0.75rem;
}

.login-passkey-divider::before,
.login-passkey-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--surface-border);
}

.btn-passkey {
    width: 100%;
    height: 44px;
    border: 1px solid var(--secondary-border);
    border-radius: 6px;
    background: var(--secondary-bg);
    color: var(--secondary-text);
    font: inherit;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.btn-passkey:hover {
    background: var(--secondary-hover);
    border-color: var(--field-focus-border);
}

.btn-passkey:active {
    background: var(--accent-subtle);
    border-color: var(--accent);
}

.btn-passkey:disabled {
    opacity: 0.65;
    cursor: wait;
}

.btn-passkey .material-icons-round {
    font-size: 20px;
}

.login-passkey-message {
    margin: 0;
}

.input-group {
    display: grid;
    gap: 6px;
}

.input-group label {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--label);
}

input[type="text"],
input[type="password"] {
    width: 100%;
    height: 44px;
    padding: 0 14px;
    border: 1px solid var(--field-border);
    border-radius: 4px;
    background: var(--field-bg);
    color: var(--title);
    font: inherit;
    font-size: 0.875rem;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}

input::placeholder {
    color: var(--field-placeholder);
}

input:focus {
    border-color: var(--field-focus-border);
    box-shadow: 0 0 0 3px var(--accent-subtle);
}

/* -- Floating username field -- */
.floating-field {
    --floating-label-bg: var(--surface);
    position: relative;
}

.floating-field input {
    padding-top: 2px;
}

.floating-field label {
    position: absolute;
    left: 14px;
    top: 50%;
    color: var(--field-placeholder);
    font-size: 0.875rem;
    line-height: 1;
    pointer-events: none;
    transform: translateY(-50%);
    transform-origin: left center;
    transition:
        top 280ms cubic-bezier(0.22, 0.8, 0.22, 1),
        transform 280ms cubic-bezier(0.22, 0.8, 0.22, 1),
        color 200ms ease,
        background-color 200ms ease,
        padding 200ms ease;
}

.floating-field input {
    caret-color: var(--accent);
    transition:
        border-color 250ms cubic-bezier(0.22, 0.8, 0.22, 1),
        box-shadow 300ms cubic-bezier(0.22, 0.8, 0.22, 1),
        background-color 200ms ease;
}

.floating-field input::placeholder {
    color: transparent;
}

.floating-field input:focus + label,
.floating-field input:not(:placeholder-shown) + label {
    color: var(--accent);
}

.floating-field input:-webkit-autofill + label {
    color: var(--accent);
}

/* -- Variant A: notched outline -- */
.floating-field--slide input:focus,
.floating-field--slide input:not(:placeholder-shown) {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-subtle);
}

.floating-field--slide input:-webkit-autofill {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-subtle);
}

.floating-field--slide input:focus + label,
.floating-field--slide input:not(:placeholder-shown) + label {
    top: 0;
    padding: 0 6px;
    background: var(--floating-label-bg);
    transform: translate(2px, -50%) scale(0.78);
}

.floating-field--slide input:-webkit-autofill + label {
    top: 0;
    padding: 0 6px;
    background: var(--floating-label-bg);
    transform: translate(2px, -50%) scale(0.78);
}

/* -- Password field -- */
.password-field {
    position: relative;
}

.password-field input {
    padding-right: 44px;
}

.password-toggle {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    transition: color 0.15s;
}

.password-toggle:hover,
.password-toggle:focus-visible {
    color: var(--body);
    outline: none;
}

.password-toggle .material-icons-round {
    font-size: 18px;
}

/* -- Remember me -- */
.login-meta {
    display: flex;
    align-items: center;
}

.remember {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--body);
    font-size: 0.8125rem;
    cursor: pointer;
}

.remember input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    margin: 0;
    border: 1px solid var(--checkbox-border);
    border-radius: 4px;
    background: var(--checkbox-bg);
    position: relative;
    transition: border-color 0.15s, background-color 0.15s;
}

.remember input[type="checkbox"]:checked {
    border-color: var(--accent);
    background: var(--accent);
}

.remember input[type="checkbox"]:checked::after {
    content: "";
    position: absolute;
    left: 5px;
    top: 2px;
    width: 4px;
    height: 8px;
    border: solid #fff;
    border-width: 0 1.5px 1.5px 0;
    transform: rotate(45deg);
}

.remember input[type="checkbox"]:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px var(--accent-subtle);
}

/* ==========================
   BUTTONS
   ========================== */
.btn-login {
    width: 100%;
    height: 44px;
    border: none;
    border-radius: 6px;
    background: var(--accent);
    color: var(--btn-text);
    font: inherit;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.10);
    transition: background 0.15s, box-shadow 0.15s;
}

.btn-login:hover,
.btn-login:focus-visible {
    background: var(--accent-hover);
    outline: none;
    box-shadow: 0 2px 4px rgba(15, 23, 42, 0.14);
}

.btn-login:active {
    background: var(--accent-active);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.18);
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 44px;
    border: 1px solid var(--secondary-border);
    border-radius: 6px;
    background: var(--secondary-bg);
    color: var(--secondary-text);
    font: inherit;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.btn-secondary:hover,
.btn-secondary:focus-visible {
    background: var(--secondary-hover);
    border-color: var(--field-focus-border);
    outline: none;
}

.btn-secondary:active {
    background: var(--accent-subtle);
    border-color: var(--accent);
}

/* ==========================
   TOTP DIGIT INPUTS
   ========================== */
.totp-digits {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin: 4px 0;
}

.totp-digit {
    width: 46px;
    height: 54px;
    padding: 0;
    border: 1px solid var(--field-border);
    border-radius: 4px;
    background: var(--field-bg);
    color: var(--title);
    font-family: 'SF Mono', 'Cascadia Code', 'Fira Code', monospace;
    font-size: 1.25rem;
    font-weight: 600;
    text-align: center;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
    caret-color: var(--accent);
}

.totp-digit:focus {
    border-color: var(--field-focus-border);
    box-shadow: 0 0 0 3px var(--accent-subtle);
}

.totp-digit::placeholder {
    color: var(--field-placeholder);
    font-weight: 400;
}

.totp-separator {
    display: flex;
    align-items: center;
    color: var(--muted);
    font-size: 1.25rem;
    font-weight: 300;
    padding: 0 2px;
    user-select: none;
}

/* -- Recovery code fallback input (visibility via hidden attr) -- */
.totp-recovery-input input[type="text"] {
    text-align: center;
    letter-spacing: 0.04em;
    font-size: 0.9375rem;
}

/* -- Toggle link between digit/recovery -- */
.totp-mode-toggle {
    margin: 0;
    text-align: center;
    font-size: 0.8125rem;
}

.totp-mode-toggle button {
    border: none;
    background: none;
    color: var(--accent);
    font: inherit;
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    padding: 0;
    text-decoration: none;
}

.totp-mode-toggle button:hover {
    text-decoration: underline;
}

.totp-helper {
    margin: 8px 0 0;
    font-size: 0.8125rem;
    color: var(--body);
    text-align: center;
}

.login-actions {
    display: grid;
    gap: 10px;
}

/* ==========================
   TOTP HEADER ICON
   ========================== */
.totp-header-icon {
    width: 40px;
    height: 40px;
    margin-bottom: 24px;
    border-radius: 10px;
    background: var(--accent-subtle);
    display: grid;
    place-items: center;
    color: var(--accent);
}

.totp-header-icon .material-icons-round {
    font-size: 22px;
}

/* ==========================
   TOTP BRAND LOCKUP
   ========================== */
.totp-brand-lockup {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 22px;
}

.totp-brand-logo {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: var(--accent-subtle);
    display: grid;
    place-items: center;
    overflow: hidden;
    flex-shrink: 0;
}

.totp-brand-logo img {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.totp-brand-sep {
    width: 1px;
    height: 28px;
    background: var(--surface-border);
}

.totp-brand-badge {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--field-bg);
    color: var(--accent);
    border: 1px solid var(--surface-border);
    display: grid;
    place-items: center;
    flex-shrink: 0;
}

.totp-brand-badge .material-icons-round {
    font-size: 20px;
}

.totp-brand-meta {
    margin-left: auto;
    font-size: 0.7rem;
    color: var(--muted);
    text-align: right;
    line-height: 1.3;
}

.totp-brand-meta strong {
    display: block;
    color: var(--title);
    font-weight: 600;
    font-size: 0.78rem;
}

/* ==========================
   USER CHIP
   ========================== */
.user-chip {
    display: flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    max-width: 100%;
    margin: 20px auto 0;
    padding: 7px 14px;
    border-radius: 999px;
    background: var(--chip-bg);
    border: 1px solid var(--chip-border);
    color: var(--body);
    font-size: 0.78rem;
}

.user-chip strong {
    color: var(--title);
    font-weight: 600;
    margin-left: 4px;
}

/* ==========================
   HELPER TEXT
   ========================== */
.form-helper {
    margin: -2px 0 0;
    color: var(--body);
    font-size: 0.8125rem;
    line-height: 1.5;
}

/* ==========================
   FOOTER
   ========================== */
.footer {
    margin-top: 24px;
    text-align: center;
    color: var(--muted);
    font-size: 0.6875rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.login-footer-meta {
    display: flex;
    justify-content: center;
    margin: 16px auto 0;
    text-transform: none;
    letter-spacing: 0;
    width: 100%;
}

.gc-footer-meta-row {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 4px 9px;
    border-radius: 4px;
    background: rgba(100, 116, 139, 0.08);
    border: 1px solid rgba(100, 116, 139, 0.20);
    color: #475569;
    font-size: 10.5px;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
    transition: background-color 200ms ease, border-color 200ms ease, color 200ms ease;
}

.gc-footer-meta-row.is-unknown {
    background: rgba(100, 116, 139, 0.08);
    border-color: rgba(100, 116, 139, 0.20);
    color: #475569;
}

.gc-footer-meta-row .gc-footer-env-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 17px;
    box-sizing: border-box;
    padding: 0 7px;
    border-radius: 4px;
    background: #ffffff;
    color: #475569;
    border: 1px solid rgba(100, 116, 139, 0.28);
    font-size: 9.5px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.gc-footer-divider {
    width: 1px;
    height: 14px;
    display: inline-block;
    background: rgba(100, 116, 139, 0.32);
    opacity: 1;
    margin: 0 2px;
}

.gc-footer-meta-text {
    display: inline;
    color: var(--color-text-secondary, #475569);
    font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0;
}

/* ============================================================
   SPLIT-SCREEN LAYOUT
   When .login-splitscreen is present the login becomes a
   two-column layout: form left, image right.
   ============================================================ */

/* ── Base split-screen shell ── */
.login-shell.login-splitscreen {
    display: grid;
    grid-template-columns: minmax(380px, 480px) 1fr;
    padding: 0;
    height: 100vh;
    height: 100svh;
    height: 100dvh;
    min-height: 100vh;
    min-height: 100svh;
    min-height: 100dvh;
    align-items: stretch;
}

/* Theme toggle repositioned in splitscreen */
.login-splitscreen .login-theme-toggle {
    position: fixed;
    top: calc(var(--erp-env-banner-offset, 0px) + 20px);
    right: 20px;
    z-index: 20;
}

/* ── Left panel (form) ── */
.login-split-left {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 0;
    padding: 40px 32px;
    background: var(--bg);
    overflow-y: auto;
}

.login-splitscreen .login-card {
    width: 100%;
    max-width: 380px;
    border: none;
    border-radius: 0;
    background: transparent;
    padding: 0;
}

.login-splitscreen .floating-field {
    --floating-label-bg: var(--bg);
}

/* ── Right panel (image) ── */
.login-split-right {
    position: relative;
    min-height: 0;
    overflow: hidden;
}

.login-split-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* ─────────────────────────────────────────────
   VARIANT A — Clean Split
   Pure image, no overlay. Thin left-border accent.
   ───────────────────────────────────────────── */
[data-login-variant="A"] .login-split-right {
    border-left: 3px solid var(--accent);
}

/* ─────────────────────────────────────────────
   VARIANT B — Branded Overlay
   Dark gradient overlay with text bottom-left.
   ───────────────────────────────────────────── */
.login-split-overlay {
    --login-split-overlay-edge-space: clamp(32px, 4vw, 64px);
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to top,
        rgba(15, 23, 42, 0.85) 0%,
        rgba(15, 23, 42, 0.40) 40%,
        rgba(15, 23, 42, 0.10) 100%
    );
    display: flex;
    align-items: flex-end;
    padding-top: 40px;
    padding-right: 40px;
    padding-bottom: calc(var(--login-split-overlay-edge-space) + env(safe-area-inset-bottom, 0px));
    padding-left: calc(var(--login-split-overlay-edge-space) + env(safe-area-inset-left, 0px));
}

[data-theme="dark"] .login-split-overlay {
    background: linear-gradient(
        to top,
        rgba(0, 0, 0, 0.80) 0%,
        rgba(0, 0, 0, 0.35) 40%,
        rgba(0, 0, 0, 0.08) 100%
    );
}

.login-split-overlay-content {
    color: #ffffff;
    max-width: 420px;
}

.login-split-overlay-content h2 {
    margin: 16px 0 8px;
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.login-split-overlay-content p {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.6;
    opacity: 0.85;
}

/* ─────────────────────────────────────────────
   VARIANT C — Glassmorphism
   Frosted glass edge between left and right panels.
   ───────────────────────────────────────────── */
.login-split-glass {
    position: absolute;
    top: 0;
    left: 0;
    width: 80px;
    height: 100%;
    backdrop-filter: blur(20px) saturate(1.4);
    -webkit-backdrop-filter: blur(20px) saturate(1.4);
    background: linear-gradient(
        to right,
        rgba(244, 245, 247, 0.65) 0%,
        rgba(244, 245, 247, 0.15) 100%
    );
    border-right: 1px solid rgba(255, 255, 255, 0.18);
}

.login-split-glass-content {
    position: absolute;
    inset: auto auto clamp(24px, 4vw, 48px) clamp(24px, 4vw, 48px);
    z-index: 1;
    max-width: min(420px, calc(100% - 48px));
    padding: 24px 26px;
    border: 1px solid rgba(255, 255, 255, 0.24);
    border-radius: 4px;
    backdrop-filter: blur(18px) saturate(1.2);
    -webkit-backdrop-filter: blur(18px) saturate(1.2);
    background: rgba(255, 255, 255, 0.16);
    box-shadow: 0 20px 45px rgba(15, 23, 42, 0.16);
}

.login-split-glass-content .login-split-overlay-content {
    max-width: none;
}

[data-theme="dark"] .login-split-glass {
    background: linear-gradient(
        to right,
        rgba(40, 41, 43, 0.70) 0%,
        rgba(40, 41, 43, 0.10) 100%
    );
    border-right: 1px solid rgba(255, 255, 255, 0.06);
}

[data-theme="dark"] .login-split-glass-content {
    border-color: rgba(255, 255, 255, 0.10);
    background: rgba(17, 24, 39, 0.22);
    box-shadow: 0 24px 56px rgba(0, 0, 0, 0.28);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

/* Tablet: stack to single column */
@media (max-width: 900px) {
    body.login-page-splitscreen {
        overflow-x: hidden;
        overflow-y: auto;
    }

    .login-shell.login-splitscreen {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto;
        height: auto;
        min-height: auto;
    }

    .login-split-left {
        padding: 32px 24px;
        order: 1;
        overflow: visible;
    }

    .login-split-right {
        order: 2;
        min-height: clamp(220px, 35svh, 360px);
        max-height: none;
    }

    .login-splitscreen .login-card {
        max-width: 400px;
    }

    .login-splitscreen .login-theme-toggle {
        position: absolute;
    }

    .login-split-overlay {
        --login-split-overlay-edge-space: clamp(20px, 4vw, 28px);
        padding-top: 24px;
        padding-right: 20px;
        padding-bottom: calc(var(--login-split-overlay-edge-space) + env(safe-area-inset-bottom, 0px));
        padding-left: calc(var(--login-split-overlay-edge-space) + env(safe-area-inset-left, 0px));
    }

    .login-split-overlay-content h2 {
        font-size: 1.25rem;
    }

    .login-split-glass {
        width: 0;
        height: 60px;
        top: auto;
        bottom: unset;
        top: 0;
        left: 0;
        right: 0;
        width: 100%;
        backdrop-filter: blur(16px) saturate(1.3);
        -webkit-backdrop-filter: blur(16px) saturate(1.3);
        background: linear-gradient(
            to bottom,
            rgba(244, 245, 247, 0.60),
            rgba(244, 245, 247, 0.0)
        );
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    }

    .login-split-glass-content {
        inset: auto 20px 20px 20px;
        max-width: none;
        padding: 18px 20px;
        border-radius: 4px;
    }

    [data-theme="dark"] .login-split-glass {
        background: linear-gradient(
            to bottom,
            rgba(40, 41, 43, 0.65),
            rgba(40, 41, 43, 0.0)
        );
        border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    }
}

/* Small mobile (non-splitscreen fallback + splitscreen) */
@media (max-width: 480px) {
    .login-shell:not(.login-splitscreen) {
        padding: 16px;
    }

    .login-card {
        padding: 24px 20px;
        border-radius: 4px;
    }

    .login-splitscreen .login-card {
        border-radius: 0;
        padding: 0;
    }

    .login-title {
        font-size: 1.375rem;
    }

    .totp-digit {
        width: 40px;
        height: 48px;
        font-size: 1.1rem;
    }

    .totp-digits {
        gap: 6px;
    }

    input[type="text"],
    input[type="password"],
    .btn-login,
    .btn-secondary {
        height: 42px;
    }

    .login-split-right {
        min-height: clamp(200px, 28svh, 280px);
    }

    .login-split-left {
        padding: 24px 18px;
    }

    .login-split-overlay {
        --login-split-overlay-edge-space: clamp(14px, 4vw, 18px);
        padding-top: 16px;
        padding-right: 14px;
        padding-bottom: calc(var(--login-split-overlay-edge-space) + env(safe-area-inset-bottom, 0px));
        padding-left: calc(var(--login-split-overlay-edge-space) + env(safe-area-inset-left, 0px));
    }

    .login-split-overlay-content h2 {
        font-size: 1.1rem;
        margin-top: 10px;
    }

    .login-split-overlay-content p {
        font-size: 0.82rem;
    }
}

/* ==========================
   FOOTER — dark mode
   ========================== */
[data-theme="dark"] .gc-footer-meta-row {
    background: rgba(100, 116, 139, 0.16);
    border-color: rgba(100, 116, 139, 0.36);
    color: rgba(240, 240, 236, 0.78);
}

[data-theme="dark"] .gc-footer-meta-row.is-unknown {
    color: rgba(240, 240, 236, 0.78);
}

[data-theme="dark"] .gc-footer-meta-row .gc-footer-env-badge {
    background: rgba(15, 23, 42, 0.7);
    color: rgba(240, 240, 236, 0.78);
    border-color: rgba(100, 116, 139, 0.42);
}

[data-theme="dark"] .gc-footer-meta-text {
    color: rgba(240, 240, 236, 0.6);
}

[data-theme="dark"] .gc-footer-divider {
    background: rgba(100, 116, 139, 0.42);
}

/* ============================================================
   FLUENT AUTH VARIANTS
   Microsoft Fluent-inspired shell for login and 2FA.
   ============================================================ */
:root {
    --fluent-bg: #f5f5f5;
    --fluent-surface: #ffffff;
    --fluent-surface-raised: #fafafa;
    --fluent-text: #242424;
    --fluent-body: #616161;
    --fluent-muted: #8a8886;
    --fluent-border: #d1d1d1;
    --fluent-border-soft: rgba(36, 36, 36, 0.10);
    --fluent-accent: #2563eb;
    --fluent-accent-hover: #1d4ed8;
    --fluent-accent-active: #1e40af;
    --fluent-accent-soft: rgba(37, 99, 235, 0.12);
    --fluent-shadow: 0 8px 24px rgba(0, 0, 0, 0.14);
    --fluent-shadow-soft: 0 2px 8px rgba(0, 0, 0, 0.08);
}

[data-theme="dark"] {
    --fluent-bg: #2f302d;
    --fluent-surface: #333431;
    --fluent-surface-raised: #3d3e3b;
    --fluent-text: #f0f0ec;
    --fluent-body: #bebeb7;
    --fluent-muted: #8e8e88;
    --fluent-border: rgba(255, 255, 255, 0.14);
    --fluent-border-soft: rgba(255, 255, 255, 0.08);
    --fluent-accent: #4f8cff;
    --fluent-accent-hover: #6a9dff;
    --fluent-accent-active: #3b78e7;
    --fluent-accent-soft: rgba(79, 140, 255, 0.16);
    --fluent-shadow: 0 14px 34px rgba(0, 0, 0, 0.34);
    --fluent-shadow-soft: 0 3px 14px rgba(0, 0, 0, 0.26);
}

body.login-page-fluent-a,
.login-shell--fluent-a {
    background: var(--fluent-bg);
    color: var(--fluent-text);
}

body.login-page-fluent-a {
    font-family: var(--erp-font-sans, "Inter", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, Arial, sans-serif);
}

body.login-page-fluent-b {
    min-height: 100vh;
    min-height: 100svh;
}

.login-shell--fluent-a {
    padding: 28px;
}

.login-shell--fluent-b {
    --login-fluent-auth-bg: none;
    --login-fluent-brand-gap: 20px;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: var(--login-fluent-brand-gap);
    min-height: 100vh;
    min-height: 100svh;
    padding: clamp(72px, 8vh, 96px) clamp(24px, 6vw, 64px);
    overflow: hidden;
    background: var(--login-fluent-auth-bg) center / cover no-repeat, var(--fluent-bg);
}

.login-shell.login-splitscreen.login-shell--fluent-a {
    grid-template-columns: minmax(390px, 460px) 1fr;
    gap: 0;
    padding: 0;
    background: var(--fluent-bg);
}

.login-shell--fluent-a .login-theme-toggle {
    top: calc(var(--erp-env-banner-offset, 0px) + 18px);
    right: 18px;
    width: 36px;
    height: 36px;
    border-radius: 4px;
    border-color: var(--fluent-border-soft);
    background: color-mix(in srgb, var(--fluent-surface) 90%, transparent);
    color: var(--fluent-body);
    box-shadow: var(--fluent-shadow-soft);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.login-shell--fluent-a .login-theme-toggle:hover,
.login-shell--fluent-a .login-theme-toggle:focus-visible {
    border-color: var(--fluent-accent);
    background: var(--fluent-accent-soft);
    color: var(--fluent-accent);
}

.login-shell--fluent-a .login-split-left {
    padding: 48px 40px;
    background: var(--fluent-bg);
}

.login-shell--fluent-a .login-card {
    width: 100%;
    max-width: 356px;
    padding: 28px;
    border: 1px solid var(--fluent-border-soft);
    border-radius: 4px;
    background: color-mix(in srgb, var(--fluent-surface) 94%, transparent);
    box-shadow: var(--fluent-shadow);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.login-splitscreen.login-shell--fluent-a .login-card {
    max-width: 356px;
    padding: 28px;
    border: 1px solid var(--fluent-border-soft);
    border-radius: 4px;
    background: color-mix(in srgb, var(--fluent-surface) 94%, transparent);
}

.login-shell--fluent-b .login-card {
    position: relative;
    z-index: 2;
    width: 400px;
    max-width: calc(100vw - 36px);
    padding: 32px;
    background: color-mix(in srgb, var(--fluent-surface) 96%, transparent);
}

.login-fluent-brand-overlay {
    position: relative;
    left: auto;
    bottom: auto;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 12px;
    width: min(400px, calc(100vw - 36px));
    padding: 14px 16px;
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 4px;
    background: color-mix(in srgb, var(--fluent-surface) 86%, transparent);
    color: var(--fluent-text);
    box-shadow: var(--fluent-shadow-soft);
    backdrop-filter: blur(20px) saturate(150%);
    -webkit-backdrop-filter: blur(20px) saturate(150%);
    pointer-events: none;
}

.login-fluent-brand-overlay > .material-icons-round {
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 6px;
    background: var(--fluent-accent-soft);
    color: var(--fluent-accent);
    font-size: 20px;
}

.login-fluent-brand-overlay div {
    min-width: 0;
}

.login-fluent-brand-overlay strong,
.login-fluent-brand-overlay span:not(.material-icons-round) {
    display: block;
}

.login-fluent-brand-overlay strong {
    overflow: hidden;
    color: var(--fluent-text);
    font-size: 0.92rem;
    font-weight: 600;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.login-fluent-brand-overlay span:not(.material-icons-round) {
    margin-top: 2px;
    color: var(--fluent-body);
    font-size: 0.78rem;
    line-height: 1.35;
}

.login-shell--fluent-a .logo-wrapper,
.login-shell--fluent-a .totp-brand-logo,
.login-shell--fluent-a .totp-brand-badge {
    border-radius: 6px;
    background: var(--fluent-surface-raised);
    border: 1px solid var(--fluent-border-soft);
}

.login-shell--fluent-a .logo-wrapper {
    width: 40px;
    height: 40px;
    margin-bottom: 24px;
}

.login-shell--fluent-a .logo {
    width: 30px;
    height: 30px;
}

.login-shell--fluent-a .login-header {
    margin-bottom: 24px;
}

.login-shell--fluent-a .login-title {
    color: var(--fluent-text);
    font-size: 1.6rem;
    font-weight: 600;
    letter-spacing: 0;
}

.login-shell--fluent-a .login-subtitle,
.login-shell--fluent-a .form-helper,
.login-shell--fluent-a .totp-helper {
    color: var(--fluent-body);
}

.login-shell--fluent-a .message-box {
    border-radius: 4px;
}

.login-shell--fluent-a .input-group label,
.login-shell--fluent-a .floating-field label {
    color: var(--fluent-body);
    font-weight: 600;
}

.login-shell--fluent-a input[type="text"],
.login-shell--fluent-a input[type="password"] {
    height: 40px;
    border-color: var(--fluent-border);
    border-radius: 4px;
    background: var(--fluent-surface);
    color: var(--fluent-text);
}

.login-shell--fluent-a input:focus {
    border-color: var(--fluent-accent);
    box-shadow: 0 0 0 3px var(--fluent-accent-soft);
}

.login-shell--fluent-a .floating-field {
    --floating-label-bg: var(--fluent-surface);
}

.login-shell--fluent-a .floating-field input:focus + label,
.login-shell--fluent-a .floating-field input:not(:placeholder-shown) + label,
.login-shell--fluent-a .floating-field input:-webkit-autofill + label {
    color: var(--fluent-accent);
}

.login-shell--fluent-a .remember {
    color: var(--fluent-body);
}

.login-shell--fluent-a .remember input[type="checkbox"] {
    border-color: var(--fluent-border);
    border-radius: 3px;
    background: var(--fluent-surface);
}

.login-shell--fluent-a .remember input[type="checkbox"]:checked {
    border-color: var(--fluent-accent);
    background: var(--fluent-accent);
}

.login-shell--fluent-a .btn-login,
.login-shell--fluent-a .btn-secondary,
.login-shell--fluent-a .btn-passkey {
    height: 40px;
    border-radius: 6px;
    font-size: 0.875rem;
}

.login-shell--fluent-a .btn-login {
    background: var(--fluent-accent);
    color: #ffffff;
}

[data-theme="dark"] .login-shell--fluent-a .btn-login {
    color: #ffffff;
}

.login-shell--fluent-a .btn-login:hover,
.login-shell--fluent-a .btn-login:focus-visible {
    background: var(--fluent-accent-hover);
}

.login-shell--fluent-a .btn-login:active {
    background: var(--fluent-accent-active);
}

.login-shell--fluent-a .btn-secondary,
.login-shell--fluent-a .btn-passkey {
    border-color: var(--fluent-border-soft);
    background: var(--fluent-surface-raised);
    color: var(--fluent-body);
}

.login-shell--fluent-a .btn-secondary:hover,
.login-shell--fluent-a .btn-passkey:hover,
.login-shell--fluent-a .btn-secondary:focus-visible,
.login-shell--fluent-a .btn-passkey:focus-visible {
    border-color: var(--fluent-accent);
    background: var(--fluent-accent-soft);
    color: var(--fluent-accent);
}

.login-shell--fluent-a .login-passkey-divider {
    color: var(--fluent-muted);
}

.login-shell--fluent-a .login-passkey-divider::before,
.login-shell--fluent-a .login-passkey-divider::after,
.login-shell--fluent-a .totp-brand-sep {
    background: var(--fluent-border-soft);
}

.login-fluent-visual {
    isolation: isolate;
    display: grid;
    align-items: stretch;
    padding: 28px;
    background: var(--fluent-bg);
}

.login-fluent-visual .login-split-img {
    box-shadow: var(--fluent-shadow);
}

.login-fluent-visual-panel {
    position: absolute;
    left: 56px;
    bottom: 56px;
    z-index: 2;
    width: min(390px, calc(100% - 112px));
    padding: 22px;
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.78);
    color: #242424;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.18);
    backdrop-filter: blur(22px) saturate(160%);
    -webkit-backdrop-filter: blur(22px) saturate(160%);
}

.login-fluent-visual-panel .material-icons-round {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    margin-bottom: 14px;
    border-radius: 6px;
    background: var(--fluent-accent-soft);
    color: var(--fluent-accent);
}

.login-fluent-visual-panel h2 {
    margin: 0;
    color: #242424;
    font-size: clamp(1.45rem, 2.1vw, 2rem);
    font-weight: 600;
    line-height: 1.1;
}

.login-fluent-visual-panel p {
    margin: 8px 0 0;
    color: #3b3a39;
    font-size: 0.95rem;
    line-height: 1.45;
}

.login-shell--fluent-a .footer {
    color: var(--fluent-muted);
}

.login-shell--fluent-a .gc-footer-meta-row {
    background: var(--fluent-surface-raised);
    border-color: var(--fluent-border-soft);
    color: var(--fluent-body);
}

.login-shell--fluent-a .gc-footer-meta-text {
    color: var(--fluent-body);
}

.login-shell--fluent-2fa-bg {
    --login-fluent-2fa-bg: none;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    min-height: 100svh;
    padding: 32px;
    overflow: hidden;
    background: var(--login-fluent-2fa-bg) center / cover no-repeat, var(--fluent-bg);
}

.login-shell--fluent-2fa-bg .login-card {
    max-width: 420px;
    background: color-mix(in srgb, var(--fluent-surface) 96%, transparent);
}

.login-shell--fluent-a .totp-brand-lockup {
    gap: 10px;
    margin-bottom: 24px;
}

.login-shell--fluent-a .totp-brand-logo,
.login-shell--fluent-a .totp-brand-badge {
    width: 38px;
    height: 38px;
}

.login-shell--fluent-a .totp-brand-logo img {
    width: 28px;
    height: 28px;
}

.login-shell--fluent-a .totp-brand-meta strong {
    color: var(--fluent-text);
}

.login-shell--fluent-a .totp-brand-meta,
.login-shell--fluent-a .totp-separator {
    color: var(--fluent-muted);
}

.login-shell--fluent-a .totp-digits {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr)) 12px repeat(3, minmax(0, 1fr));
    align-items: center;
    gap: 8px;
}

.login-shell--fluent-a .totp-digit {
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1.08;
    border-color: var(--fluent-border);
    border-radius: 4px;
    background: var(--fluent-surface);
    color: var(--fluent-text);
}

.login-shell--fluent-a .totp-digit:focus {
    border-color: var(--fluent-accent);
    box-shadow: 0 0 0 3px var(--fluent-accent-soft);
}

.login-shell--fluent-a .totp-mode-toggle button,
.login-shell--fluent-a .login-passkey-divider span {
    color: var(--fluent-accent);
}

.login-shell--fluent-a .user-chip {
    border-radius: 4px;
    border-color: var(--fluent-border-soft);
    background: var(--fluent-surface-raised);
    color: var(--fluent-body);
}

.login-shell--fluent-a .user-chip strong {
    color: var(--fluent-text);
}

@media (max-width: 900px) {
    .login-shell.login-splitscreen.login-shell--fluent-a {
        grid-template-columns: 1fr;
        height: auto;
        min-height: 100vh;
        min-height: 100svh;
    }

    .login-shell--fluent-a .login-split-left {
        padding: 72px 24px 30px;
    }

    .login-fluent-visual {
        min-height: 260px;
        padding: 0 24px 30px;
    }

    .login-fluent-visual-panel {
        left: 44px;
        right: 44px;
        bottom: 50px;
        width: auto;
        padding: 18px;
    }

    .login-shell--fluent-2fa-bg {
        padding: 72px 24px 30px;
    }

    .login-shell--fluent-b {
        --login-fluent-mobile-brand-gap: 18px;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: var(--login-fluent-mobile-brand-gap);
        padding: 72px 24px 30px;
        overflow-y: auto;
    }

    .login-fluent-brand-overlay {
        position: relative;
        top: auto;
        right: auto;
        bottom: auto;
        left: auto;
        order: 2;
        width: min(400px, calc(100vw - 48px));
        padding: 11px 12px;
    }
}

@media (max-width: 640px) {
    input[type="text"],
    input[type="password"] {
        font-size: 16px;
    }
}

@media (max-width: 560px) {
    .login-shell--fluent-a {
        padding: 18px;
    }

    .login-shell--fluent-a .login-card,
    .login-splitscreen.login-shell--fluent-a .login-card,
    .login-shell--fluent-b .login-card,
    .login-shell--fluent-2fa-bg .login-card {
        max-width: 100%;
        padding: 22px;
    }

    .login-shell--fluent-b .login-card {
        width: min(400px, calc(100vw - 36px));
    }

    .login-shell--fluent-a .login-title {
        font-size: 1.42rem;
    }

    .login-shell--fluent-a .totp-digits {
        gap: 5px;
    }

    .login-fluent-visual {
        min-height: 220px;
        padding: 0 18px 24px;
    }

    .login-fluent-visual-panel {
        left: 32px;
        right: 32px;
        bottom: 38px;
        padding: 14px;
    }

    .login-fluent-visual-panel .material-icons-round {
        display: none;
    }

    .login-fluent-visual-panel h2 {
        font-size: 1.15rem;
    }

    .login-fluent-visual-panel p {
        font-size: 0.82rem;
    }

    .login-shell--fluent-2fa-bg {
        padding: 68px 18px 24px;
    }

    .login-shell--fluent-b {
        --login-fluent-mobile-brand-gap: 16px;
        padding: 68px 18px 24px;
    }

    .login-fluent-brand-overlay {
        width: min(400px, calc(100vw - 36px));
        gap: 10px;
        padding: 10px 12px;
    }

    .login-fluent-brand-overlay > .material-icons-round {
        width: 30px;
        height: 30px;
        font-size: 18px;
    }

    .login-fluent-brand-overlay strong {
        font-size: 0.82rem;
    }

    .login-fluent-brand-overlay span:not(.material-icons-round) {
        display: block;
        font-size: 0.72rem;
        line-height: 1.3;
    }
}
