:root {
    --tenant-auth-navy: #303030;
    --tenant-auth-navy-dark: #1f2937;
    --tenant-auth-blue: #0b72b0;
    --tenant-auth-blue-soft: #e8f4fb;
    --tenant-auth-surface: #ffffff;
    --tenant-auth-text: #303030;
    --tenant-auth-muted: #687386;
    --tenant-auth-border: #d8e0ec;
    --tenant-auth-danger: #c62828;
    --tenant-auth-danger-bg: #fff1f0;
    --tenant-auth-success: #137c3b;
    --tenant-auth-success-bg: #ecfdf3;
    --tenant-auth-radius: 18px;
    --tenant-auth-control-radius: 12px;
    --tenant-auth-shadow: 0 28px 75px rgba(4, 22, 48, 0.22);
    --tenant-auth-font: Inter, "Source Sans 3";
}

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

html {
    min-height: 100%;
    background: var(--tenant-auth-navy-dark);
}

body.tenant-auth-page {
    min-width: 320px;
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0;
    overflow-x: hidden;
    color: var(--tenant-auth-text);
    background: linear-gradient(145deg, var(--tenant-auth-navy-dark) 0%, #075a91 54%, var(--tenant-auth-blue) 100%);
    font-family: var(--tenant-auth-font);
    -webkit-font-smoothing: antialiased;
}

.tenant-auth-footer-centered {
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    width: 100%;
}

.tenant-auth-footer-centered span {
    width: 100%;
    text-align: center;
}

.tenant-auth-page button,
.tenant-auth-page input {
    font: inherit;
}

.tenant-auth-page a {
    color: var(--tenant-auth-blue);
    text-decoration: none;
}

.tenant-auth-page a:hover {
    color: var(--tenant-auth-navy);
}

.tenant-auth-page a:focus-visible,
.tenant-auth-page button:focus-visible,
.tenant-auth-page input:focus-visible {
    outline: 3px solid rgba(11, 114, 176, 0.25);
    outline-offset: 2px;
}

.tenant-auth-backdrop,
.tenant-auth-grid,
.tenant-auth-glow {
    position: fixed;
    pointer-events: none;
}

.tenant-auth-backdrop {
    inset: 0;
    overflow: hidden;
}

.tenant-auth-grid {
    inset: 0;
    opacity: 0.12;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.16) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.16) 1px, transparent 1px);
    background-size: 56px 56px;
    -webkit-mask-image: linear-gradient(to bottom, black, transparent 82%);
    mask-image: linear-gradient(to bottom, black, transparent 82%);
}

.tenant-auth-glow {
    border-radius: 50%;
    filter: blur(2px);
}

.tenant-auth-glow-one {
    top: -22vw;
    left: -16vw;
    width: 52vw;
    height: 52vw;
    background: rgba(84, 160, 255, 0.18);
}

.tenant-auth-glow-two {
    right: -18vw;
    bottom: -28vw;
    width: 58vw;
    height: 58vw;
    background: rgba(72, 187, 255, 0.16);
}

.tenant-auth-main {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    min-height: 100dvh;
    padding: clamp(24px, 5vw, 56px) 18px;
}

.tenant-auth-card {
    width: min(100%, 470px);
    padding: clamp(26px, 5vw, 42px);
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: var(--tenant-auth-radius);
    background: rgba(255, 255, 255, 0.985);
    box-shadow: var(--tenant-auth-shadow);
    backdrop-filter: blur(18px);
}

.tenant-auth-card-returning {
    width: min(100%, 420px);
}

.tenant-auth-brand {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 32px;
}

.tenant-auth-logo {
    display: block;
    width: auto;
    max-width: min(160px, 48%);
    height: auto;
    max-height: 42px;
    object-fit: contain;
    object-position: left center;
}

.tenant-auth-workspace {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    max-width: 46%;
    min-height: 34px;
    padding: 7px 10px;
    overflow: hidden;
    border: 1px solid #d7e5f8;
    border-radius: 999px;
    color: #315274;
    background: #f5f9ff;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.tenant-auth-workspace span {
    overflow: hidden;
    text-overflow: ellipsis;
}

.tenant-auth-heading {
    margin-bottom: 27px;
}

.tenant-auth-heading-returning {
    text-align: center;
}

.tenant-auth-eyebrow {
    margin: 0 0 8px;
    color: var(--tenant-auth-blue);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.tenant-auth-heading h1 {
    margin: 0;
    color: var(--tenant-auth-text);
    font-size: clamp(25px, 4.5vw, 31px);
    font-weight: 760;
    letter-spacing: -0.035em;
    line-height: 1.18;
}

.tenant-auth-heading p:last-child {
    margin: 10px 0 0;
    color: var(--tenant-auth-muted);
    font-size: 15px;
    line-height: 1.6;
}

.tenant-auth-alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 0 0 18px;
    padding: 12px 14px;
    border: 1px solid transparent;
    border-radius: 11px;
    font-size: 13px;
    line-height: 1.5;
}

.tenant-auth-alert > i {
    margin-top: 3px;
    flex: 0 0 auto;
}

.tenant-auth-alert-danger {
    color: var(--tenant-auth-danger);
    border-color: #f5c7c2;
    background: var(--tenant-auth-danger-bg);
}

.tenant-auth-alert-success {
    color: var(--tenant-auth-success);
    border-color: #b7ebce;
    background: var(--tenant-auth-success-bg);
}

.tenant-auth-alert-info {
    color: #17579c;
    border-color: #bed7f6;
    background: #edf6ff;
}

.tenant-auth-alert[hidden] {
    display: none;
}

.tenant-auth-account {
    display: flex;
    align-items: center;
    gap: 13px;
    margin-bottom: 22px;
    padding: 14px;
    border: 1px solid #dbe7f5;
    border-radius: 14px;
    background: linear-gradient(135deg, #f8fbff, #f1f6fd);
}

.tenant-auth-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    flex: 0 0 48px;
    border-radius: 50%;
    color: #ffffff;
    background: linear-gradient(145deg, var(--tenant-auth-navy), var(--tenant-auth-blue));
    box-shadow: 0 8px 18px rgba(11, 114, 176, 0.22);
    font-size: 15px;
    font-weight: 800;
    letter-spacing: 0.03em;
}

.tenant-auth-account-copy {
    min-width: 0;
    flex: 1;
}

.tenant-auth-account-copy strong,
.tenant-auth-account-copy small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tenant-auth-account-copy strong {
    margin-bottom: 3px;
    color: #18304e;
    font-size: 14px;
}

.tenant-auth-account-copy small {
    color: var(--tenant-auth-muted);
    font-size: 12px;
}

.tenant-auth-account-shield {
    color: #5f82ac;
    font-size: 16px;
}

.tenant-auth-field {
    margin-bottom: 19px;
}

.tenant-auth-field label,
.tenant-auth-label-row {
    color: #263d59;
    font-size: 13px;
    font-weight: 750;
}

.tenant-auth-field > label {
    display: block;
    margin-bottom: 8px;
}

.tenant-auth-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 8px;
}

.tenant-auth-label-row a {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    padding: 6px 0;
    font-size: 12px;
    font-weight: 750;
}

.tenant-auth-input-wrap {
    position: relative;
}

.tenant-auth-input-wrap input {
    width: 100%;
    min-height: 50px;
    padding: 12px 48px 12px 43px;
    border: 1px solid var(--tenant-auth-border);
    border-radius: var(--tenant-auth-control-radius);
    color: var(--tenant-auth-text);
    background: #fbfdff;
    box-shadow: 0 1px 2px rgba(16, 33, 58, 0.03);
    font-size: 15px;
    transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.tenant-auth-input-wrap input::placeholder {
    color: #9aa9bb;
}

.tenant-auth-input-wrap input:hover {
    border-color: #bac9da;
}

.tenant-auth-input-wrap input:focus {
    border-color: var(--tenant-auth-blue);
    outline: 0;
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(11, 114, 176, 0.12);
}

.tenant-auth-input-icon {
    position: absolute;
    top: 50%;
    left: 16px;
    z-index: 1;
    width: 16px;
    color: #7890aa;
    text-align: center;
    transform: translateY(-50%);
}

.tenant-auth-password-toggle {
    position: absolute;
    top: 1px;
    right: 1px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    padding: 0;
    border: 0;
    border-radius: 0 11px 11px 0;
    color: #60758e;
    background: transparent;
    cursor: pointer;
}

.tenant-auth-password-toggle:hover {
    color: var(--tenant-auth-blue);
    background: #f0f6ff;
}

.tenant-auth-check {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 40px;
    margin: -3px 0 12px;
    color: #53677e;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
}

.tenant-auth-check input {
    width: 18px;
    height: 18px;
    margin: 0;
    border-radius: 4px;
    accent-color: var(--tenant-auth-blue);
}

.tenant-auth-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    min-height: 50px;
    padding: 12px 18px;
    border: 1px solid var(--tenant-auth-blue);
    border-radius: var(--tenant-auth-control-radius);
    color: #ffffff;
    background: linear-gradient(135deg, #075a91, var(--tenant-auth-blue));
    box-shadow: 0 12px 24px rgba(11, 114, 176, 0.22);
    cursor: pointer;
    font-size: 15px;
    font-weight: 800;
    transition: transform 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

.tenant-auth-submit:hover {
    background: linear-gradient(135deg, #064b78, #075a91);
    box-shadow: 0 15px 30px rgba(11, 114, 176, 0.28);
    transform: translateY(-1px);
}

.tenant-auth-submit:disabled {
    opacity: 0.72;
    cursor: wait;
    transform: none;
}

.tenant-auth-submit .fa-spinner {
    font-size: 14px;
}

.tenant-auth-demo {
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1px solid #e6edf5;
}

.tenant-auth-demo > span {
    display: block;
    margin-bottom: 10px;
    color: var(--tenant-auth-muted);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.tenant-auth-demo > div {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.tenant-auth-demo button {
    min-height: 40px;
    border: 1px solid #cbd9e9;
    border-radius: 9px;
    color: #365471;
    background: #ffffff;
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
}

.tenant-auth-demo button:hover {
    color: var(--tenant-auth-blue);
    border-color: #8bb7ee;
    background: #f4f8ff;
}

.tenant-auth-account-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 18px;
}

.tenant-auth-account-actions[hidden] {
    display: none;
}

.tenant-auth-account-actions a,
.tenant-auth-account-actions button,
.tenant-auth-return-account a {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    width: 100%;
    min-height: 42px;
    padding: 8px 10px;
    border: 0;
    border-radius: 9px;
    color: #48627e;
    background: transparent;
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
    text-align: center;
}

.tenant-auth-account-actions form {
    margin: 0;
}

.tenant-auth-account-actions a:hover,
.tenant-auth-account-actions button:hover,
.tenant-auth-return-account a:hover {
    color: var(--tenant-auth-blue);
    background: #f1f6fc;
}

.tenant-auth-return-account {
    margin-top: 12px;
}

.tenant-auth-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 24px;
    padding-top: 19px;
    border-top: 1px solid #e9eef5;
    color: #7b8da2;
    font-size: 11px;
}

.tenant-auth-footer span:first-child {
    white-space: nowrap;
}

.tenant-auth-footer strong {
    color: #435c78;
    font-weight: 800;
}

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

@media (max-width: 575.98px) {
    .tenant-auth-main {
        align-items: center;
        padding: max(14px, env(safe-area-inset-top)) 10px max(14px, env(safe-area-inset-bottom));
    }

    .tenant-auth-card {
        padding: 26px 22px 22px;
        border-radius: 16px;
    }

    .tenant-auth-brand {
        margin-bottom: 26px;
    }

    .tenant-auth-workspace {
        max-width: 48%;
    }

    .tenant-auth-account-actions {
        grid-template-columns: 1fr;
        gap: 2px;
    }

    .tenant-auth-footer {
        align-items: flex-start;
        flex-direction: column;
        gap: 7px;
    }
}

@media (max-width: 380px) {
    .tenant-auth-card {
        padding-right: 18px;
        padding-left: 18px;
    }

    .tenant-auth-workspace {
        display: none;
    }

    .tenant-auth-logo {
        max-width: 160px;
    }

    .tenant-auth-demo > div {
        grid-template-columns: 1fr;
    }
}

@media (max-height: 700px) and (min-width: 576px) {
    .tenant-auth-main {
        align-items: flex-start;
        padding-top: 20px;
        padding-bottom: 20px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .tenant-auth-page *,
    .tenant-auth-page *::before,
    .tenant-auth-page *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}
