html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', 'Roboto', Arial, sans-serif;
    box-sizing: border-box;
    overflow-x: hidden;
}

*, *::before, *::after {
    box-sizing: inherit;
}

body {
    background: url('login1.jpg') no-repeat center center fixed;
    background-size: cover;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100vw;
    overflow-x: hidden;
}

main {
    width: 100vw;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow-x: hidden;
}

.login-card {
    background: rgba(255,255,255,0.90);
    box-shadow: 0 6px 40px rgba(31,51,36,0.16), 0 0px 2px rgba(44,62,80,0.03);
    border-radius: 20px;
    padding: 2.5rem 2.2rem 2rem 2.2rem;
    width: 340px;
    display: flex;
    flex-direction: column;
    align-items: center;
    backdrop-filter: blur(2px);
    animation: fadeIn 1s;
    max-width: 95vw;
    min-width: 0;
    overflow-x: hidden;
}

.login-card h2 {
    margin-bottom: 1.2rem;
    font-family: 'Segoe UI', 'Roboto', Arial, sans-serif;
    color: #21825c;
    letter-spacing: 1px;
}

.login-card input[type="text"],
.login-card input[type="password"] {
    width: 100%;
    min-width: 0;
    padding: 13px;
    margin: 10px 0 18px 0;
    border: none;
    border-radius: 8px;
    background: #f5fff7;
    font-size: 1rem;
    color: #21825c;
    box-shadow: 0 2px 10px #21825c10 inset;
    transition: background 0.25s, box-shadow 0.25s;
    outline: none;
    box-sizing: border-box;
    display: block;
}

.login-card input:focus {
    background: #edfff3;
    box-shadow: 0 4px 18px #21825c30 inset;
}

.login-btn {
    width: 100%;
    min-width: 0;
    padding: 12px;
    border: none;
    border-radius: 40px;
    background: linear-gradient(90deg, #21825c 0%, #70c179 100%);
    color: #fff;
    font-size: 1.1rem;
    font-weight: 600;
    margin-top: 8px;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    box-shadow: 0 4px 18px #21825c20;
    letter-spacing: 0.04em;
    box-sizing: border-box;
    display: block;
}

.login-btn:hover, .login-btn:focus {
    background: linear-gradient(90deg, #70c179 0%, #21825c 100%);
    transform: scale(1.03);
    outline: none;
}

.error {
    color: #fc3c3c;
    margin-top: 12px;
    font-size: 15px;
    animation: shake 0.2s;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(30px);}
    to   { opacity: 1; transform: translateY(0);}
}
@keyframes shake {
    10%, 90% { transform: translateX(-1px); }
    20%, 80% { transform: translateX(2px); }
    30%, 50%, 70% { transform: translateX(-4px); }
    40%, 60% { transform: translateX(4px); }
}

.navbar {
    width: 100vw;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f4f9fd8c;
    padding: 6px 24px 6px 16px;
    box-shadow: 0 2px 12px rgba(44, 62, 80, 0.05);
    position: sticky;
    top: 0;
    position: fixed;
    z-index: 100;
    box-sizing: border-box;
    overflow-x: hidden;
}

.navbar-logo-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.navbar-logo {
    height: 48px;
    width: auto;
    min-width: 0;
}

.navbar-title {
    font-family: 'Georgia', 'Times New Roman', Times, serif;
    font-size: 1.2rem;
    font-weight: 700;
    color: #094283;
    letter-spacing: 0.4px;
}

.navbar-home-btn {
    font-size: 1.04rem;
    color: #1769ba;
    background: none;
    border: 2px solid #1769ba;
    border-radius: 22px;
    padding: 7px 21px;
    text-decoration: none;
    font-weight: 500;
    transition: 0.2s;
}

.navbar-home-btn:hover {
    background: #1769ba;
    color: #fff;
    box-shadow: 0 2px 10px #b8cae6;
}

/* Responsive Queries */
@media (max-width: 1200px) {
    .login-card {
        width: 400px;
        max-width: 98vw;
        padding: 2rem 1.2rem 1.5rem 1.2rem;
        border-radius: 18px;
    }
    .navbar-logo {
        height: 40px;
    }
}

@media (max-width: 900px) {
    main {
        height: auto;
        min-height: 100vh;
        padding: 30px 0;
    }
    .login-card {
        width: 95vw;
        max-width: 500px;
        padding: 1.5rem 0.8rem;
        border-radius: 16px;
    }
    .navbar-logo {
        height: 36px;
    }
    .navbar-title {
        font-size: 1rem;
    }
    .navbar {
        padding: 4px 4vw 4px 6px;
    }
    .navbar-home-btn {
        padding: 5px 14px;
        font-size: 0.95rem;
    }
}

@media (max-width: 600px) {
    html, body, main {
        padding: 0;
        margin: 0;
        min-height: 100vh;
        height: auto;
        width: 100vw;
        overflow-x: hidden;
    }
    .login-card {
        width: 94vw;
        max-width: 94vw;
        padding: 1.5rem 1.2rem 1.5rem 1.2rem;
        border-radius: 22px;
        box-shadow: 0 4px 24px rgba(31,51,36,0.13);
        margin: 5vh 3vw 5vh 3vw; /* More margin for clean look */
        background: rgba(255,255,255,0.96);
    }
    .navbar {
        padding: 2px 2vw 2px 4px;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
    }
    .navbar-logo {
        height: 28px;
    }
    .navbar-title {
        font-size: 0.9rem;
    }
    .navbar-home-btn {
        padding: 4px 10px;
        font-size: 0.9rem;
    }
}

@media (max-width: 400px) {
    .login-card {
        width: 100vw;
        max-width: 100vw;
        padding: 0.5rem 0.1rem;
        border-radius: 0;
    }
    .navbar-title {
        font-size: 0.8rem;
    }
}
