/* ===== Base Reset ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Poppins", sans-serif;
}

body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    color: #000;
}

/* ===== Container ===== */
.login-container {
    background: #ffffff;
    padding: 40px 30px;
    border-radius: 16px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
    width: 360px;
    text-align: center;
}

/* ===== Logo Image ===== */
.login-container img {
    max-width: 150px;
    /* maximum size */
    width: 50%;
    /* scales with container */
    height: auto;
    /* maintain aspect ratio */
    margin-bottom: 20px;
}

/* Heading */
.login-container h2 {
    font-size: 1.8rem;
    margin-bottom: 25px;
    letter-spacing: 1px;
    color: #551423;
}

/* ===== Form ===== */
.login-form .form-group {
    margin-bottom: 20px;
}

.input-wrapper {
    position: relative;
}

.input-wrapper input {
    width: 100%;
    padding: 12px 40px 12px 12px;
    background: #ffffff;
    border: 1px solid #bbb;
    border-radius: 8px;
    color: #000;
    outline: none;
    transition: 0.3s;
}

.input-wrapper input:focus {
    border-color: #551423;
    box-shadow: 0 0 6px rgba(206, 18, 18, 0.3);
}

.input-wrapper label {
    position: absolute;
    top: 12px;
    left: 12px;
    font-size: 0.9rem;
    color: #666;
    pointer-events: none;
    transition: 0.3s;
}

.input-wrapper input:focus+label,
.input-wrapper input:valid+label {
    top: -8px;
    left: 8px;
    font-size: 0.75rem;
    background: #fff;
    padding: 0 6px;
    color: #551423;
}

/* Password toggle */
.password-toggle {
    position: absolute;
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    z-index: 10;
}

.toggle-icon::before {
    content: "👁️";
    font-size: 1rem;
}

.password-toggle.active .toggle-icon::before {
    content: "🔒";
}

/* Forgot password */
.forgot-password {
    display: block;
    margin-top: 10px;
    color: #551423;
    text-decoration: none;
    font-size: 0.9rem;
}

.forgot-password:hover {
    text-decoration: underline;
}

/* Submit Button */
.login-btn {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 8px;
    background: #551423;
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 20px;
    transition: 0.3s;
}

.login-btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

/* Flash Message */
#flashMessage {
    margin-top: 15px;
    text-align: center;
    font-size: 0.9rem;
    color: #551423;
    font-weight: 600;
}

/* Validation Error */
.error-message {
    color: #551423;
    font-size: 0.85rem;
    margin-top: 4px;
    display: block;
}

/* Captcha */
.captcha-wrapper {
    margin: 18px 0 10px 0;
}

.captcha-label {
    color: #000;
    font-size: 0.9rem;
    margin-bottom: 6px;
    display: block;
}

.captcha-box {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.captcha-text {
    padding: 12px 20px;
    background: #f3f3f3;
    color: #551423;
    font-size: 1.4rem;
    letter-spacing: 4px;
    font-weight: 700;
    border-radius: 8px;
    border: 1px solid #551423;
    user-select: none;
}

.captcha-refresh {
    padding: 10px 14px;
    background: #551423;
    border: none;
    border-radius: 8px;
    color: #fff;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: 0.3s;
}

.captcha-refresh:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.custom-alert {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 0.95rem;
    margin-bottom: 20px;
}

.custom-alert .alert-icon {
    font-size: 1.2rem;
}

.custom-alert-success {
    background-color: #e6f4ea;
    color: #2e7d32;
    border: 1px solid #a5d6a7;
}

.custom-alert-error {
    background-color: #fdecea;
    color: #551423;
    border: 1px solid #f5c2c7;
}

.custom-alert-warning {
    background-color: #fff4e5;
    color: #f57c00;
    border: 1px solid #ffcc80;
}

.custom-alert-info {
    background-color: #e5f6fd;
    color: #0288d1;
    border: 1px solid #b3e5fc;
}

/* ===== Responsive ===== */
@media (max-width: 480px) {
    .login-container {
        width: 90%;
        padding: 30px 20px;
    }

    .login-container img {
        width: 70%;
        max-width: 120px;
    }

    .login-container h2 {
        font-size: 1.5rem;
    }

    .input-wrapper input {
        padding: 10px 35px 10px 10px;
    }
}
