html {
    /* Prevent horizontal scroll caused by off-canvas decorative elements */
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
}

body {
    min-height: 100vh;
    font-family: Arial, Helvetica, sans-serif;
    background: linear-gradient(135deg, #f6f8fc 0%, #eef2f7 100%);
    /* Keep desktop tidy, vertical scroll handled by main layout; x is always hidden */
    overflow: hidden; /* fallback */
    overflow-x: hidden;
    position: relative;
    color: #172033;
}

.decor {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
}

.decor-top {
    width: 560px;
    height: 560px;
    top: -230px;
    right: -120px;
    background: radial-gradient(circle, rgba(255,255,255,0.96), rgba(226,232,242,0.55));
}

.decor-bottom {
    width: 620px;
    height: 620px;
    left: -260px;
    bottom: -260px;
    background: radial-gradient(circle, rgba(255,255,255,0.96), rgba(226,232,242,0.5));
}

.decor-curve {
    position: absolute;
    right: -180px;
    bottom: -120px;
    width: 520px;
    height: 520px;
    border-radius: 50%;
    background: rgba(207, 220, 241, 0.5);
    z-index: 0;
}

.dot-grid {
    position: absolute;
    left: 120px;
    bottom: 120px;
    grid-template-columns: repeat(4, 8px);
    gap: 12px;
    opacity: 0.45;
    z-index: 0;
}

.dot-grid span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #cbd5e1;
}

.login-panel {
    width: 100%;
    max-width: 560px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.12);
    backdrop-filter: blur(12px);
    position: relative;
    z-index: 1;
}

/* Make the inner card padding a bit tighter on all screens */
.login-panel .card-body {
    padding: 1rem 1.25rem; /* overrides Bootstrap p-4/p-md-5 to reduce vertical padding */
}

.brand-logo {
    font-size: 34px;
    line-height: 1;
    font-weight: 800;
    letter-spacing: 1px;
    color: #0878c9;
}

.brand-logo span {
    padding: 0 4px;
}

.brand-divider {
    width: 72px;
    height: 2px;
    background: #e6ebf2;
    border-radius: 10px;
}

.login-title {
    font-size: 25px;
    font-weight: 400;
    color: #111827;
}

.login-title strong {
    font-weight: 700;
}

.custom-input {
    height: 56px; /* slightly thinner input height */
    border-radius: 14px;
    border: 1px solid #dce4ee;
    padding-left: 58px;
    padding-right: 90px;
    color: #334155;
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.03);
}

.custom-input::placeholder {
    color: #94a3b8;
}

.custom-input:focus {
    border-color: #8ec8f3;
    box-shadow: 0 0 0 4px rgba(8, 120, 201, 0.08);
}

.input-icon,
.input-action {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 20px;
    z-index: 2;
}

.input-icon {
    left: 20px;
}

.input-action {
    right: 20px;
}

.input-action-secondary {
    right: 54px;
}

.custom-check .form-check-input {
    width: 22px;
    height: 22px;
    border-radius: 6px;
    margin-top: 0;
    cursor: pointer;
}

.custom-check .form-check-input:checked {
    background-color: #2f73d2;
    border-color: #2f73d2;
}

.custom-check .form-check-label {
    padding-left: 6px;
    color: #374151;
    cursor: pointer;
}

.forgot-link {
    color: #2f73d2;
    text-decoration: none;
}

.forgot-link:hover {
    text-decoration: underline;
}

.login-btn {
    height: 56px; /* slightly thinner button height */
    border-radius: 14px;
    background: linear-gradient(90deg, #ff7315 0%, #ff8a1c 100%);
    color: #ffffff;
    font-size: 20px;
    font-weight: 700;
    border: none;
    box-shadow: 0 12px 26px rgba(255, 115, 21, 0.28);
    transition: 0.2s ease;
}

.login-btn:hover {
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 16px 32px rgba(255, 115, 21, 0.35);
}

.login-btn:active {
    transform: translateY(0);
}

.security-text {
    color: #7c8ca6;
    font-size: 15px;
}

hr {
    border-color: #dce4ee;
    opacity: 1;
}

@media (max-width: 768px) {
    /* Allow vertical scrolling on small screens, but keep horizontal locked */
    body {
        overflow-y: auto;
        overflow-x: hidden;
        max-width: 100vw;
    }

    html {
        overflow-x: hidden;
    }

    /* Scale and reposition decorative shapes so they don't exceed viewport */
    .decor-top {
        width: 70vw;
        height: 70vw;
        top: -28vw;
        right: -18vw;
        /* subtle opacity tweak to keep similar look on smaller size */
        background: radial-gradient(circle, rgba(255,255,255,0.96), rgba(226,232,242,0.55));
    }

    .decor-bottom {
        width: 78vw;
        height: 78vw;
        left: -26vw;
        bottom: -28vw;
        background: radial-gradient(circle, rgba(255,255,255,0.96), rgba(226,232,242,0.5));
    }

    .decor-curve {
        width: 68vw;
        height: 68vw;
        right: -22vw;
        bottom: -20vw;
        background: rgba(207, 220, 241, 0.5);
    }

    .brand-logo {
        font-size: 28px;
    }

    .login-title {
        font-size: 22px;
    }

    .login-panel .card-body {
        padding: 0.875rem 1rem; /* slightly tighter on small screens */
    }

    .custom-input,
    .login-btn {
        height: 50px; /* more compact on small screens */
    }
}
