/* Fullscreen container */
body, html {
    margin: 0;
    padding: 0;
    height: 100%;
    font-family: 'Open Sans', sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    background-attachment: fixed;
    background-size: cover;
    background-position: center bottom;
    overflow: hidden;
    background-color: #ffffff; /* fallback */
}

/* The container that holds both the login form and animated text */
.container {
    display: flex;
    flex-direction: column;  /* Stack elements vertically */
    justify-content: center;
    align-items: center;
    min-height: 100vh; /* Take up full viewport height */
    width: 100%;
    padding: 20px;
    box-sizing: border-box;
}

/* Animated "blanket" */
.background-blanket {
    position: absolute;
    top: 0;
    left: -100%;
    width: 200%;
    height: 100%;
    background: linear-gradient(
        120deg, 
        #ffffff, 
        rgba(25,58,135,0.2), 
        #f2f2f2, 
        rgba(25,58,135,0.1), 
        #ffffff
    );
    animation: slideBlanket 6s linear infinite;
    z-index: 1;
}

@keyframes slideBlanket {
    0% { left: -100%; }
    50% { left: 0; }
    100% { left: 100%; }
}

/* Huge faint letters */
.thps-tas {
    position: relative;
    width: 100%;
    text-align: center;
    z-index: 2;
    margin-top: 40px; /* Ensures there's some space between the login box and the text */
}

.thps-tas .letter {
    display: inline-block;
    opacity: 0;
    color: rgba(25,58,135,0.15);
    font-size: 90px; /* Reduced font size from 120px to 90px */
    font-weight: 900;
    transform: translateY(60px) rotate(-15deg);
    animation: letterReveal 6s ease-in-out infinite;
}

/* staggered animation delays */
.thps-tas .letter:nth-child(1) { animation-delay: 0.2s; }
.thps-tas .letter:nth-child(2) { animation-delay: 0.4s; }
.thps-tas .letter:nth-child(3) { animation-delay: 0.6s; }
.thps-tas .letter:nth-child(4) { animation-delay: 0.8s; }
.thps-tas .letter:nth-child(5) { animation-delay: 1s; }
.thps-tas .letter:nth-child(6) { animation-delay: 1.2s; }
.thps-tas .letter:nth-child(7) { animation-delay: 1.4s; }
.thps-tas .letter:nth-child(8) { animation-delay: 1.6s; }

@keyframes letterReveal {
    0%   { opacity: 0; transform: translateY(50px) rotate(-15deg); }
    20%  { opacity: 1; transform: translateY(0) rotate(0deg); }
    80%  { opacity: 1; transform: translateY(0) rotate(0deg); }
    100% { opacity: 0; transform: translateY(100px) rotate(15deg); }
}

/* Mobile responsive adjustments */
@media(max-width: 768px) {
    .thps-tas .letter {
        font-size: 70px; /* Further reduce size on tablets */
    }
}

@media(max-width: 480px) {
    .thps-tas .letter {
        font-size: 50px; /* Reduce font size even more on smaller screens */
    }
}

/* Login box */
.login-box {
    position: relative;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 15px 25px rgba(0,0,0,0.2);
    padding: 40px 30px;
    width: 100%;
    max-width: 420px; /* Prevent overflow on large screens */
    z-index: 3;
    border: 1px solid #193A87;
    box-sizing: border-box;
}

.login-box .login-logo img {
    display: block;
    margin: 0 auto 20px;
    max-width: 180px;
    width: 100%; /* Ensure responsiveness */
}

.login-box .form-group { margin-bottom: 20px; }
.login-box label { font-weight: 600; margin-bottom: 5px; color: #333; }
.login-box input.form-control {
    width: 100%;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 14px;
    transition: 0.3s;
    box-sizing: border-box;
}
.login-box input.form-control:focus {
    border-color: #193A87;
    box-shadow: 0 0 5px rgba(25,58,135,0.5);
}

.login-box .d-flex { display: flex; justify-content: space-between; align-items: center; }
.login-box .d-flex a { color: #193A87; font-size: 13px; text-decoration: none; }
.login-box .d-flex a:hover { text-decoration: underline; }

.login-box button.btn-info {
    width: 100%;
    padding: 12px;
    border-radius: 6px;
    background-color: #193A87;
    border: none;
    color: white;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.3s;
}
.login-box button.btn-info:hover { background-color: #1e4b9e; }

.login-box .bg-danger, .login-box .bg-success {
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 15px;
}

.login-box .register-link {
    text-align: center;
    font-size: 12px;
    color: #777;
    margin-top: 15px;
}

/* Mobile responsive adjustments */
@media(max-width: 768px) {
    .login-box {
        padding: 30px 20px; /* Reduce padding on mobile */
    }
    .thps-tas .letter {
        font-size: 40px; /* Scale down the letters on smaller screens */
    }
    .login-box button.btn-info {
        font-size: 14px; /* Make the button text smaller */
    }
}

@media(max-width: 480px) {
    .login-box {
        max-width: 100%;
        padding: 20px; /* Further reduce padding on very small screens */
    }
    .thps-tas .letter {
        font-size: 60px; /* Further reduce the font size of the letters */
    }
    .login-box button.btn-info {
        padding: 10px;
        font-size: 14px;
    }
}
