html, body {
    height: 100%;
    margin: 0;
    padding: 0;
}

body.login {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background-color: #f0f2f5;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    min-height: 100vh;
    padding-top: 5vh; /* Add padding to prevent cutting off on small screens */
    box-sizing: border-box;
}

#login {
    background: white;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    width: 360px;
    max-width: 90%;
    box-sizing: border-box;
    text-align: center;
    margin-top: 10vh; /* Add some spacing for larger screens */
}

.login h1 a {
    background-image: url('../img/asfar-logo.png') !important;
    background-size: contain;
    background-repeat: no-repeat;
    width: 200px !important;
    height: 80px !important;
    margin: 0 auto 30px;
    padding: 0;
}

.login form {
    margin-top: 20px;
    padding: 0;
    background: none;
    box-shadow: none;
    border: none;
}

.login form .input,
.login input[type="text"],
.login input[type="password"] {
    width: 100%;
    padding: 15px;
    margin: 10px 0;
    border: 1px solid #ddd;
    background-color: #f9f9f9;
    border-radius: 10px;
    font-size: 16px;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.login form .input:focus,
.login input[type="text"]:focus,
.login input[type="password"]:focus {
    outline: none;
    border-color: #006652;
    box-shadow: 0 0 0 2px rgba(0,102,82,0.1);
}

/* Hide default labels */
.login label {
    display: none;
}

.wp-core-ui .button-primary {
    width: 100%;
    padding: 15px;
    border: none;
    border-radius: 10px;
    font-size: 18px;
    font-weight: bold;
    color: white;
    cursor: pointer;
    background: linear-gradient(-45deg, #006652, #00a86b, #ffc107, #006652);
    background-size: 300% 300%;
    animation: gradientWave 5s ease infinite;
    transition: all 0.3s ease;
    text-shadow: none;
    box-shadow: none;
    margin-top: 20px;
}

.wp-core-ui .button-primary:hover,
.wp-core-ui .button-primary:focus {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,102,82,0.3);
}

@keyframes gradientWave {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.login #nav,
.login #backtoblog {
    text-align: center;
    margin: 20px 0 0;
    padding: 0;
}

.login #nav a,
.login #backtoblog a {
    color: #006652;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s ease;
}

.login #nav a:hover,
.login #backtoblog a:hover {
    color: #00a86b;
}

#language-switcher {
    text-align: center;
    margin-top: 20px;
    width: 100%;
    margin-bottom: 65px;
}

.custom-message {
    background-color: #e7f5f3;
    border-left: 4px solid #006652;
    padding: 12px;
    margin-bottom: 20px;
    color: #006652;
    border-radius: 4px;
    text-align: left;
    font-size: 14px;
}

.login #login_error,
.login .message,
.login .success {
    border-left: 4px solid #006652;
    padding: 12px;
    margin-bottom: 20px;
    background-color: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,.1);
    border-radius: 4px;
    font-size: 14px;
}

.login #login_error {
    border-left-color: #dc3232;
}

.login .success {
    border-left-color: #46b450;
}

.login .forgetmenot {
    margin-bottom: 10px;
}

.login .forgetmenot label {
    font-size: 14px;
    color: #444;
    display: inline;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    #login {
        margin-top: 5vh; /* Reduce the margin for smaller screens */
    }
}

@media (max-width: 480px) {
    #login {
        margin-top: 3vh; /* Further reduce the margin on very small screens */
    }
}

.login .button.wp-hide-pw {
    margin-top: 16px;
}

/* Ensure consistent font for placeholders */
::-webkit-input-placeholder {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}
::-moz-placeholder {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}
:-ms-input-placeholder {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}
