body {
    --utb-bar-height: 56px;
    --utb-primary: #841818;
    --utb-primary-dark: #6a1313;
    --utb-gold: #841818;
    --text-dark: #841818;
    --muted: rgba(132, 24, 24, 0.7);
    background: #eef1f5;
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    color: var(--text-dark);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main.auth-main {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.ums-bg {
    position: fixed;
    inset: 0;
    background:
        radial-gradient(circle at 8% 20%, rgba(132, 24, 24, 0.08), transparent 35%),
        radial-gradient(circle at 95% 85%, rgba(132, 24, 24, 0.06), transparent 35%),
        linear-gradient(180deg, #faf7f7 0%, #f3ecec 100%);
    z-index: -1;
}

.brand-mini {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    object-fit: cover;
    flex-shrink: 0;
}

.utb-topbar {
    background: #841818;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    position: sticky;
    top: 0;
    z-index: 1040;
    margin-bottom: 0;
    min-height: var(--utb-bar-height);
    display: flex;
    align-items: center;
}

.topbar-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    color: #fff;
    font-weight: 600;
    font-size: 0.9rem;
    padding: 0.45rem 0;
}

.topbar-brand .brand-title {
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.topbar-brand .brand-subtitle {
    font-size: 0.72rem;
    font-weight: 500;
    opacity: 0.88;
    margin-top: 0.05rem;
}

.topbar-brand:hover,
.topbar-brand:focus {
    color: #f5e6e7;
}

.topbar-toggler {
    border: 1px solid rgba(255, 255, 255, 0.35);
    padding: 0.3rem 0.55rem;
}

.topbar-toggler .navbar-toggler-icon {
    filter: brightness(0) invert(1);
    width: 1rem;
    height: 1rem;
}

.topbar-menu {
    gap: 0.2rem;
    padding: 0.25rem 0;
}

.topbar-link {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    color: rgba(255, 255, 255, 0.9);
    background: none;
    border: 1px solid transparent;
    padding: 0.35rem 0.7rem;
    border-radius: 6px;
    line-height: 1;
    font-weight: 500;
    font-size: 0.84rem;
    text-transform: none;
    letter-spacing: 0;
}

.topbar-link i {
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.75);
    opacity: 1;
}

.topbar-link:hover,
.topbar-link:focus {
    color: #fff;
    background: none;
    border-color: transparent;
}

.topbar-menu .nav-item + .nav-item {
    border-left: 1px solid rgba(255, 255, 255, 0.18);
    padding-left: 0.2rem;
    margin-left: 0.1rem;
}

.topbar-menu .nav-item-login {
    margin-top: 0.45rem;
}

.topbar-menu .nav-item-login .topbar-link {
    color: #841818 !important;
    background: rgba(255, 255, 255, 0.96);
    border-radius: 6px;
}

.topbar-menu .nav-item-login .topbar-link i {
    color: #841818;
}

.topbar-menu .nav-item-login .topbar-link:hover,
.topbar-menu .nav-item-login .topbar-link:focus {
    color: #fff !important;
    background: #6a1313;
}

.topbar-menu .nav-item-login .topbar-link:hover i,
.topbar-menu .nav-item-login .topbar-link:focus i {
    color: #fff;
}

#utbTopNav {
    align-items: center;
}

.hero-panel {
    background: linear-gradient(145deg, #841818 0%, #6f1818 58%, #6a1313 100%);
    border-radius: 24px;
    color: #fff;
    position: relative;
    overflow: hidden;
    box-shadow: 0 16px 40px rgba(55, 20, 22, 0.25);
}

.text-light-emphasis {
    color: rgba(255, 255, 255, 0.75) !important;
}

.hero-badge {
    display: inline-block;
    padding: 0.4rem 0.85rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.35);
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.hero-title {
    font-size: clamp(1.7rem, 3.2vw, 2.7rem);
    line-height: 1.18;
    margin: 0;
    font-weight: 700;
    max-width: 740px;
}

.hero-text {
    max-width: 700px;
    font-size: 1.03rem;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.65;
}

.hero-features {
    display: grid;
    gap: 0.65rem;
    max-width: 760px;
}

.hero-features div {
    display: flex;
    align-items: flex-start;
    gap: 0.55rem;
    color: rgba(255, 255, 255, 0.95);
    font-size: 0.96rem;
}

.hero-features span {
    width: 9px;
    height: 9px;
    margin-top: 0.32rem;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(132, 24, 24, 0.25);
}

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.8rem;
    max-width: 760px;
}

.kpi-card {
    background: rgba(255, 255, 255, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 12px;
    padding: 0.9rem;
    backdrop-filter: blur(2px);
}

.kpi-card strong {
    display: block;
    color: #fff;
    font-size: 1.08rem;
}

.kpi-card small {
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.82rem;
}

.lottie-box {
    height: 160px;
    width: 100%;
}

.auth-card {
    max-width: 540px;
    border-radius: 22px;
    position: relative;
    border-top: 5px solid #841818 !important;
    box-shadow: 0 20px 46px rgba(24, 33, 49, 0.15) !important;
    background: #fff;
}

.brand-logo {
    max-height: 92px;
}

.step {
    display: none;
}

.active-step {
    display: block;
}

.lottie-success {
    width: 130px;
    height: 130px;
}

.loading-overlay {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.82);
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 22px;
}

.btn-danger,
.btn-primary,
.btn-success,
.btn-warning {
    border: none;
    border-radius: 10px;
    font-weight: 600;
    min-height: 44px;
}

.btn-danger,
.btn-primary,
.btn-success {
    background: var(--utb-primary);
}

.btn-danger:hover,
.btn-primary:hover,
.btn-success:hover {
    background: var(--utb-primary-dark);
}

.btn-warning {
    background: #841818;
    color: #fff;
}

.btn-warning:hover {
    background: #6a1313;
    color: #fff;
}

.btn-link {
    color: var(--utb-primary);
    text-decoration: none;
}

.btn-link:hover {
    color: #6a1313;
    text-decoration: underline;
}

.form-control:focus {
    border-color: #841818;
    box-shadow: 0 0 0 0.2rem rgba(132, 24, 24, 0.18);
}

.form-label {
    font-weight: 600;
    color: #841818;
}

.alert-info {
    background: rgba(132, 24, 24, 0.06);
    border-color: rgba(132, 24, 24, 0.2);
    color: #841818;
}

.signin-panel .alert-light {
    color: #841818;
    background: rgba(132, 24, 24, 0.04);
    border-color: rgba(132, 24, 24, 0.15);
}

.alert-warning {
    background: rgba(132, 24, 24, 0.06);
    border-color: rgba(132, 24, 24, 0.2);
    color: #841818;
}

.ums-footer {
    background: #841818;
    color: #fff;
    margin-top: auto;
    min-height: var(--utb-bar-height);
    display: flex;
    align-items: center;
}

.footer-item {
    display: flex;
    gap: 0.6rem;
    align-items: center;
    font-size: 0.92rem;
}

.footer-item i {
    width: 18px;
    text-align: center;
    opacity: 0.95;
}

.auth-main {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    max-width: 100% !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    height: auto;
}

.login-shell {
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    margin: 0;
    background: transparent;
    border-radius: 0;
    box-shadow: none;
    border: 0;
    overflow: hidden;
    display: grid;
    grid-template-columns: 1.05fr 1fr;
    grid-template-rows: 1fr;
    align-items: stretch;
    min-height: 0;
    height: auto;
    max-height: none;
}

.showcase-panel {
    position: relative;
    color: #fff;
    display: flex;
    align-items: flex-end;
    min-height: 100%;
    overflow: hidden;
}

/* Feather right edge so gradient visually continues into the sign-in column */
.showcase-panel::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    background: linear-gradient(
        90deg,
        transparent 0%,
        transparent 52%,
        rgba(255, 252, 252, 0.12) 72%,
        rgba(255, 250, 250, 0.45) 88%,
        rgba(255, 255, 255, 0.72) 100%
    );
}

.showcase-slides {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.showcase-slide {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    opacity: 0;
    animation: showcaseFade 24s infinite;
    animation-delay: calc(var(--slide-index, 0) * 6s);
}

.showcase-panel::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    background:
        linear-gradient(180deg, rgba(132, 24, 24, 0.15) 0%, rgba(132, 24, 24, 0.45) 100%),
        linear-gradient(125deg, rgba(106, 19, 19, 0.2) 0%, transparent 42%, rgba(132, 24, 24, 0.12) 100%);
    opacity: 0.35;
    pointer-events: none;
}

.showcase-overlay {
    position: relative;
    z-index: 3;
    width: 100%;
    padding: 2rem 1.8rem 2.2rem;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, rgba(74, 14, 16, 0.68) 70%, rgba(74, 14, 16, 0.82) 100%);
}

@keyframes showcaseFade {
    0%,
    45% {
        opacity: 0.5;
    }
    50%,
    95% {
        opacity: 0;
    }
    100% {
        opacity: 0.5;
    }
}

.showcase-title {
    margin: 0;
    font-size: clamp(2rem, 4vw, 3.1rem);
    font-family: "Segoe Script", "Brush Script MT", cursive;
    line-height: 1.06;
    text-shadow: 0 3px 18px rgba(0, 0, 0, 0.35);
}

.showcase-tagline {
    margin: 0.8rem 0 0;
    max-width: 420px;
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.93);
}

.signin-panel {
    position: relative;
    min-height: 100%;
    align-self: stretch;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 2rem 1.75rem 2.75rem;
    box-sizing: border-box;
    /* Left seam + share with showcase; extra wash from bottom up behind the form */
    background:
        linear-gradient(
            0deg,
            rgba(132, 24, 24, 0.09) 0%,
            rgba(132, 24, 24, 0.03) 18%,
            transparent 38%
        ),
        linear-gradient(
            100deg,
            rgba(132, 24, 24, 0.11) 0%,
            rgba(252, 248, 248, 0.98) 14%,
            rgba(255, 255, 255, 0.99) 32%,
            #ffffff 58%
        );
}

.signin-inner {
    width: 100%;
    max-width: 520px;
    margin: 0 auto;
    padding: 2.75rem 2.5rem 2.5rem;
    max-height: 100%;
    overflow: auto;
    flex: 0 1 auto;
}

.welcome-title {
    color: #841818;
    font-size: 3rem;
    font-weight: 700;
}

.login-emphasis {
    color: #841818;
    font-weight: 600;
}

.brand-logo {
    max-height: 88px;
}

.signin-inner .form-label {
    color: #841818;
    font-size: 0.9rem;
    margin-bottom: 0.35rem;
}

.signin-inner .form-control {
    border: 1px solid rgba(132, 24, 24, 0.35);
    border-radius: 10px;
    min-height: 54px;
    padding: 0.65rem 1rem;
    font-size: 1.05rem;
    color: #841818;
}

.signin-inner .form-control::placeholder {
    color: rgba(132, 24, 24, 0.45);
}

.signin-inner .form-control:focus {
    border-color: #841818;
    box-shadow: 0 0 0 0.18rem rgba(132, 24, 24, 0.15);
}

.signin-panel .text-muted {
    color: rgba(132, 24, 24, 0.68) !important;
}

.signin-panel .invalid-feedback,
.signin-panel .form-text {
    color: #841818 !important;
}

.signin-panel .btn-link {
    color: #841818;
}

.signin-panel .btn-link:hover,
.signin-panel .btn-link:focus {
    color: #6a1313;
}

.signin-panel h4,
.signin-panel .fw-semibold {
    color: #841818;
}

.signin-inner .spinner-border {
    color: #841818;
    border-right-color: transparent;
}

.btn-danger,
.btn-primary,
.btn-success {
    background: #841818;
}

.btn-danger:hover,
.btn-primary:hover,
.btn-success:hover {
    background: #6a1313;
}

.signin-inner .btn:not(.btn-link) {
    min-height: 54px;
    font-size: 1.05rem;
    padding: 0.65rem 1.35rem;
    border-radius: 10px;
}

.signin-inner .btn-login-submit {
    margin-top: 2rem;
    background: #fff !important;
    color: #841818 !important;
    border: 2px solid #841818 !important;
    font-weight: 600;
}

.signin-inner .step-2 .btn-login-submit {
    margin-top: 0;
}

.signin-inner .btn-login-submit:hover:not(:disabled),
.signin-inner .btn-login-submit:focus:not(:disabled) {
    background: #841818 !important;
    color: #fff !important;
    border-color: #841818 !important;
}

.signin-inner .btn-login-submit:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.signin-divider {
    margin-top: 1.3rem;
    text-align: center;
    position: relative;
}

.signin-divider::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    border-top: 1px solid rgba(132, 24, 24, 0.2);
}

.signin-divider span {
    position: relative;
    z-index: 1;
    padding: 0 0.65rem;
    background: #fff;
    font-size: 0.76rem;
    color: #841818;
}

.social-row {
    margin-top: 0.95rem;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.55rem;
}

.social-btn {
    border: 1px solid rgba(132, 24, 24, 0.25);
    border-radius: 10px;
    height: 48px;
    background: rgba(132, 24, 24, 0.06);
    color: #841818;
    font-size: 1.2rem;
}

.social-btn:hover {
    background: rgba(132, 24, 24, 0.12);
    color: #6a1313;
}

@media (max-width: 991px) {
    .utb-topbar {
        margin-bottom: 0.75rem;
    }

    .topbar-menu {
        align-items: stretch;
        gap: 0.3rem;
        padding: 0.25rem 0 0.6rem;
    }

    .topbar-link {
        width: 100%;
        justify-content: flex-start;
        font-size: 0.74rem;
        padding: 0.45rem 0.6rem;
    }

    .topbar-menu .nav-item-login {
        margin-top: 0.25rem;
    }

    .login-shell {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr;
        flex: 1 1 auto;
        min-height: calc(100dvh - 8rem);
        height: auto;
        max-height: none;
    }

    /* Login first on tablet / mobile (DOM keeps showcase then signin for desktop). */
    .signin-panel {
        order: 1;
        min-height: 0;
    }

    .showcase-panel {
        order: 2;
        min-height: 250px;
    }

    .signin-inner {
        max-width: 100%;
        padding: 2rem 1.5rem 1.75rem;
    }
}

@media (max-width: 576px) {
    .topbar-brand span {
        font-size: 0.92rem;
    }

    .welcome-title {
        font-size: 2.45rem;
    }

    .signin-inner .form-control {
        min-height: 50px;
        font-size: 1rem;
    }

    .signin-inner .btn:not(.btn-link) {
        min-height: 50px;
        font-size: 1rem;
    }
}
