/* Poshan Tracker — sign-in page */
:root {
    --bg: #f8f6f0;
    --surface: #fffefb;
    --border: #e6e3d8;
    --text: #17211b;
    --text-2: #56605a;
    --muted: #8a938c;
    --brand: #1d4a33;
    --brand-2: #2b7a4b;
    --brand-50: #e6f3ea;
    --accent: #ef8a22;
    --critical: #b3261e;
    --font: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body { font-family: var(--font); background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased; font-size: 15px; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
svg.lucide { width: 20px; height: 20px; stroke-width: 2; flex-shrink: 0; }

.login-shell { display: flex; min-height: 100vh; }

/* Left illustration: keeps the poster's own proportions, cropping only on very wide screens */
.login-art { flex: 0 0 auto; height: 100vh; position: sticky; top: 0; aspect-ratio: 1122 / 1402; max-width: 58vw; overflow: hidden; background: #fbf3e4; }
.login-art img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: left center; }

/* Right side */
.login-side { flex: 1; min-width: 0; position: relative; overflow: hidden; display: grid; place-items: center; padding: 48px 40px; }
.leaf { position: absolute; pointer-events: none; user-select: none; z-index: 0; }
.leaf-top { top: -40px; right: -30px; width: min(420px, 48%); opacity: .9; }
.leaf-bottom { bottom: -60px; right: -40px; width: min(360px, 42%); opacity: .45; transform: scaleY(-1) rotate(-8deg); }

.login-card {
    position: relative; z-index: 1; width: 100%; max-width: 520px;
    background: var(--surface); border: 1px solid var(--border); border-radius: 22px;
    padding: 48px 44px 36px; box-shadow: 0 24px 60px rgba(40, 45, 35, .08);
}

.login-brand { display: flex; align-items: center; justify-content: center; gap: 12px; }
.login-brand img { width: 74px; height: auto; }
.login-brand div { display: flex; flex-direction: column; line-height: 1; }
.login-brand b { font-size: 34px; font-weight: 800; color: var(--brand); letter-spacing: .01em; }
.login-brand span { font-size: 27px; font-weight: 500; color: var(--brand); letter-spacing: .06em; margin-top: 2px; }
.login-org { text-align: center; font-size: 14.5px; color: var(--text); font-weight: 500; margin-top: 12px; }

.login-card h1 { text-align: center; font-size: 32px; font-weight: 800; letter-spacing: -.02em; margin-top: 30px; }
.login-lead { text-align: center; color: var(--text-2); font-size: 15px; line-height: 1.55; margin: 10px auto 0; max-width: 400px; }

form { margin-top: 30px; display: flex; flex-direction: column; gap: 16px; }
.field {
    display: flex; align-items: center; gap: 12px; height: 56px; padding: 0 16px;
    border: 1px solid var(--border); border-radius: 12px; background: #fff;
    transition: border-color .15s, box-shadow .15s;
}
.field:focus-within { border-color: var(--brand-2); box-shadow: 0 0 0 4px rgba(43, 122, 75, .12); }
.field > svg { color: var(--text-2); }
.field input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent; font-size: 15px; }
.field input::placeholder { color: var(--muted); }
.eye { border: 0; background: none; color: var(--text-2); display: grid; place-items: center; width: 36px; height: 36px; border-radius: 8px; margin-right: -8px; }
.eye:hover { background: #f1efe8; }
.eye:focus-visible, .link:focus-visible, .login-btn:focus-visible, .check input:focus-visible + .box { outline: 2px solid var(--brand-2); outline-offset: 2px; }

.login-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 2px; }
.check { display: inline-flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 500; cursor: pointer; user-select: none; }
.check input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.check .box { width: 22px; height: 22px; border-radius: 6px; border: 1.5px solid var(--border); background: #fff; display: grid; place-items: center; transition: all .15s; }
.check .box svg { width: 15px; height: 15px; stroke-width: 3; color: #fff; opacity: 0; }
.check input:checked + .box { background: var(--brand-2); border-color: var(--brand-2); }
.check input:checked + .box svg { opacity: 1; }
.link { border: 0; background: none; color: var(--brand-2); font-weight: 600; font-size: 15px; }
.link:hover { text-decoration: underline; }

.login-msg { display: none; font-size: 13.5px; padding: 11px 14px; border-radius: 10px; line-height: 1.45; }
.login-msg.show { display: block; }
.login-msg.error { background: #fdecea; color: var(--critical); }
.login-msg.info { background: var(--brand-50); color: var(--brand); }

.login-btn {
    height: 56px; border: 0; border-radius: 12px; background: var(--brand); color: #fff;
    display: flex; align-items: center; justify-content: center; gap: 10px; font-size: 17px; font-weight: 700;
    margin-top: 6px; transition: background .15s, transform .1s;
}
.login-btn:hover { background: #163a28; }
.login-btn:active { transform: translateY(1px); }
.login-btn:disabled { opacity: .7; cursor: progress; }
.login-btn.busy svg { animation: nudge .8s ease-in-out infinite alternate; }
@keyframes nudge { to { transform: translateX(4px); } }

.login-secure { display: flex; align-items: center; gap: 14px; margin-top: 28px; padding: 16px 18px; border-radius: 12px; background: #f3f5ef; }
.login-secure .ic { width: 44px; height: 44px; border-radius: 50%; background: var(--brand-50); color: var(--brand-2); display: grid; place-items: center; flex-shrink: 0; }
.login-secure p { font-size: 13px; color: var(--text-2); line-height: 1.5; }

@media (max-width: 1100px) {
    .login-art { max-width: 48vw; }
    .login-card { padding: 40px 32px 30px; }
}
@media (max-width: 860px) {
    .login-shell { flex-direction: column; }
    .login-art { position: static; height: auto; width: 100%; max-width: none; aspect-ratio: 16 / 9; }
    .login-art img { object-position: center 40%; }
    .login-side { padding: 28px 16px 40px; }
}
@media (max-width: 520px) {
    .login-art { display: none; }
    .login-side { min-height: 100vh; }
    .login-card { padding: 32px 20px 24px; border-radius: 18px; }
    .login-brand b { font-size: 28px; }
    .login-brand span { font-size: 22px; }
    .login-brand img { width: 60px; }
    .login-card h1 { font-size: 27px; }
    .leaf-top { width: 220px; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
