/* ==========================================
   login.css — ADMIN LOGIN PAGE (self-contained)
   Left 50%: background photo  |  Right 50%: logo + login form
   ========================================== */

:root {
    --green-dark: #205c3b;
    --green-main: #318354;
    --green-light: #eaf5ed;
    --green-pale: #f5faf6;
    --text-dark: #25372c;
    --text-muted: #68766d;
    --border: #dce8df;
    --white: #ffffff;
    --error-bg: #fdecea;
    --error-border: #f5c2c0;
    --error-text: #b3261e;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    min-height: 100vh;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-dark);
    background: var(--green-pale);
}

/* ---------- Split layout ---------- */
.login-page-wrapper {
    display: flex;
    min-height: 100vh;
}

/* LEFT 50% — the photo is Pic/Background1.jpg (change the path below to use another).
   If the image is missing, the green gradient shows instead. */
.login-bg-section {
    flex: 0 0 50%;
    background:
        linear-gradient(rgba(32, 92, 59, 0.30), rgba(32, 92, 59, 0.55)),
        url("Pic/Background1.jpg") center / cover no-repeat,
        linear-gradient(135deg, #205c3b, #318354);
}

/* RIGHT 50% — centered form */
.login-form-section {
    flex: 0 0 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 20px;
    background: var(--green-pale);
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 36px 32px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: 0 8px 25px rgba(32, 92, 59, 0.09);
    text-align: center;
}

/* ---------- Logo & headings ---------- */
.login-logo-img {
    display: block;
    width: 96px;
    height: 96px;
    margin: 0 auto 14px;
    object-fit: contain;
}

.login-container h2 {
    color: var(--green-dark);
    font-size: 24px;
    line-height: 1.2;
}

.login-subtitle {
    margin: 4px 0 22px;
    color: var(--text-muted);
    font-size: 14px;
}

/* ---------- Message box (shown by admin-login.js) ----------
   red = login error, green (.is-info) = "you were signed out" notice */
#login-error {
    display: none;
    margin-bottom: 16px;
    padding: 10px 12px;
    background: var(--error-bg);
    border: 1px solid var(--error-border);
    border-radius: 8px;
    color: var(--error-text);
    font-size: 14px;
    font-weight: 700;
}

#login-error.is-info {
    background: var(--green-light);
    border-color: #bfdcc8;
    color: var(--green-dark);
}

/* ---------- Form ---------- */
.form-group {
    margin-bottom: 16px;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 700;
    font-size: 14px;
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ccdacf;
    border-radius: 8px;
    font: inherit;
    color: var(--text-dark);
    background: var(--white);
    outline: none;
    transition: border-color .15s, box-shadow .15s;
}

.form-group input::placeholder { color: #9aa8a0; }

.form-group input:focus {
    border-color: var(--green-main);
    box-shadow: 0 0 0 3px rgba(49, 131, 84, 0.15);
}

/* ---------- Password field with show/hide eye ---------- */
.password-field { position: relative; }

.form-group .password-field input { padding-right: 46px; }

.toggle-password {
    position: absolute;
    top: 50%;
    right: 6px;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: background .15s, color .15s;
}

.toggle-password:hover { background: var(--green-light); color: var(--green-dark); }
.toggle-password:focus-visible { outline: 3px solid rgba(49, 131, 84, 0.35); outline-offset: 1px; }

.toggle-password svg { display: block; }
.toggle-password .icon-eye-off { display: none; }
.toggle-password[aria-pressed="true"] .icon-eye { display: none; }
.toggle-password[aria-pressed="true"] .icon-eye-off { display: block; }

/* ---------- Sign-in button ---------- */
.btn-primary {
    width: 100%;
    margin-top: 4px;
    padding: 12px 20px;
    border: 0;
    border-radius: 8px;
    background: var(--green-dark);
    color: var(--white);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    transition: background .15s, transform .05s;
}

.btn-primary:hover { background: var(--green-main); }
.btn-primary:active { transform: translateY(1px); }
.btn-primary:focus-visible { outline: 3px solid rgba(49, 131, 84, 0.35); outline-offset: 2px; }
.btn-primary:disabled { opacity: .7; cursor: not-allowed; }
.btn-primary:disabled:hover { background: var(--green-dark); }

/* ---------- Mobile: image becomes a short banner on top ---------- */
@media (max-width: 800px) {
    .login-page-wrapper { flex-direction: column; }
    .login-bg-section { flex: 0 0 180px; }
    .login-form-section { flex: 1 1 auto; align-items: flex-start; padding: 28px 16px 40px; }
    .login-container { padding: 28px 22px; }
}