:root {
    --forest-dark: #1e4d2b;
    --forest-mid: #2d6e3f;
    --forest-green: #3a8a52;
    --leaf: #4caf50;
    --accent: #c8a84b;
    --accent-light: #f0d080;
    --bark: #5c3d1e;
    --fog: rgba(255,255,255,0.08);
    --text-muted: #a8c4a0;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body.login-page {
    min-height: 100vh;
    background-color: #f7f5f0;
    font-family: 'Poppins', sans-serif;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

/* Slideshow background images */
.bg-slideshow {
    position: fixed;
    inset: 0;
    z-index: 0;
}

.bg-slideshow .slide {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0;
    animation: slideshow 30s infinite;
    filter: blur(6px) saturate(0.8);
    transform: scale(1.05);
}

.bg-slideshow .slide:nth-child(1) { background-image: url('/images/animals/tiger.png'); animation-delay: 0s; }
.bg-slideshow .slide:nth-child(2) { background-image: url('/images/animals/elephant/frame_00_delay-0.1s.gif'); animation-delay: 6s; }
.bg-slideshow .slide:nth-child(3) { background-image: url('/images/animals/leopard/frame_00_delay-0.1s.gif'); animation-delay: 12s; }
.bg-slideshow .slide:nth-child(4) { background-image: url('/images/animals/peafowl/frame_00_delay-0.1s.gif'); animation-delay: 18s; }
.bg-slideshow .slide:nth-child(5) { background-image: url('/images/animals/wolf/frame_00_delay-0.1s.gif'); animation-delay: 24s; }

@keyframes slideshow {
    0% { opacity: 0; }
    4% { opacity: 1; }
    20% { opacity: 1; }
    24% { opacity: 0; }
    100% { opacity: 0; }
}

/* Light overlay on top of slideshow */
body.login-page::before {
    content: '';
    position: fixed;
    inset: 0;
    background: rgba(247, 245, 240, 0.75);
    z-index: 0;
}

/* Subtle texture overlay */
body.login-page::after {
    content: '';
    position: fixed;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.02'/%3E%3C/svg%3E");
    z-index: 1;
    pointer-events: none;
}

/* SVG tree silhouette - full screen */
.bg-trees {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 100vh;
    z-index: 2;
    opacity: 0.5;
    pointer-events: none;
}

/* Flying birds */
.bg-birds {
    position: fixed;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    overflow: hidden;
}

.bird {
    position: absolute;
    opacity: 0.6;
}

.bird-1 {
    width: 60px;
    top: 8%;
    left: 15%;
    animation: flyBird 12s ease-in-out infinite;
}

.bird-2 {
    width: 45px;
    top: 12%;
    left: 25%;
    animation: flyBird 10s ease-in-out infinite 1.5s;
}

.bird-3 {
    width: 55px;
    top: 5%;
    right: 20%;
    animation: flyBird 14s ease-in-out infinite 3s;
}

.bird-4 {
    width: 40px;
    top: 15%;
    right: 30%;
    animation: flyBird 11s ease-in-out infinite 2s;
}

.bird-5 {
    width: 50px;
    top: 10%;
    left: 55%;
    animation: flyBird 13s ease-in-out infinite 4s;
}

.bird-6 {
    width: 35px;
    top: 18%;
    right: 10%;
    animation: flyBird 9s ease-in-out infinite 1s;
}

@keyframes flyBird {
    0%, 100% {
        transform: translateX(0) translateY(0);
    }
    25% {
        transform: translateX(30px) translateY(-10px);
    }
    50% {
        transform: translateX(60px) translateY(5px);
    }
    75% {
        transform: translateX(30px) translateY(-8px);
    }
}

/* Wildlife animal silhouettes - hidden */
.wildlife-bg {
    display: none;
}

.animal {
    position: absolute;
    color: rgba(46, 139, 87, 0.08);
    transition: color 0.5s ease;
}

.animal-tiger {
    width: 180px;
    bottom: 5%;
    left: 3%;
    opacity: 0.9;
    color: rgba(200, 168, 75, 0.07);
    animation: floatSlow 8s ease-in-out infinite;
}

.animal-elephant {
    width: 220px;
    bottom: 3%;
    right: 2%;
    opacity: 0.85;
    color: rgba(46, 139, 87, 0.06);
    animation: floatSlow 10s ease-in-out infinite 1s;
}

.animal-deer {
    width: 130px;
    top: 5%;
    right: 8%;
    opacity: 0.7;
    color: rgba(200, 168, 75, 0.06);
    animation: floatSlow 7s ease-in-out infinite 0.5s;
}

.animal-peacock {
    width: 140px;
    top: 8%;
    left: 5%;
    opacity: 0.7;
    color: rgba(46, 139, 87, 0.07);
    animation: floatSlow 9s ease-in-out infinite 2s;
}

.animal-bear {
    width: 160px;
    bottom: 8%;
    left: 50%;
    margin-left: -80px;
    opacity: 0.6;
    color: rgba(92, 61, 30, 0.06);
    animation: floatSlow 11s ease-in-out infinite 1.5s;
}

.animal-snake {
    width: 200px;
    top: 50%;
    left: -2%;
    opacity: 0.5;
    color: rgba(46, 139, 87, 0.06);
    animation: floatSlow 12s ease-in-out infinite 3s;
}

@keyframes floatSlow {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-12px);
    }
}

/* Login wrapper */
.login-wrap {
    position: relative;
    z-index: 10;
    display: flex;
    width: 900px;
    max-width: 98vw;
    min-height: 540px;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(30,77,43,0.15), 0 0 0 1px rgba(30,77,43,0.06);
    background: #fff;
}

/* Left panel */
.panel-left {
    flex: 1.1;
    background: linear-gradient(160deg, var(--forest-mid) 0%, var(--forest-dark) 100%);
    padding: 52px 44px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    border-right: 1px solid rgba(255,255,255,0.06);
    position: relative;
    overflow: hidden;
}

/* SVG forest scene background */
.panel-left-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

.panel-left-bg .birds-group {
    animation: birdsFloat 6s ease-in-out infinite;
}

@keyframes birdsFloat {
    0%, 100% { transform: translateY(0) translateX(0); }
    50% { transform: translateY(-6px) translateX(4px); }
}

.panel-left > *:not(.panel-left-bg) {
    position: relative;
    z-index: 1;
}

.panel-left::before {
    content: '';
    position: absolute;
    bottom: -60px;
    left: -60px;
    width: 320px;
    height: 320px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(46,139,87,0.2) 0%, transparent 70%);
}

.emblem-wrap {
    display: flex;
    align-items: center;
    gap: 16px;
    animation: fadeUp 0.8s ease both;
}

.emblem {
    width: 58px;
    height: 58px;
    background: var(--accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    box-shadow: 0 0 30px rgba(200,168,75,0.4);
    flex-shrink: 0;
}

.emblem-logo {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    object-fit: contain;
    flex-shrink: 0;
    box-shadow: 0 0 30px rgba(200,168,75,0.4);
    background: #fff;
    padding: 4px;
}

.dept-name {
    color: #fff;
    font-family: 'Noto Serif Devanagari', serif;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.3;
}

.dept-sub {
    color: var(--accent);
    font-size: 11px;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.hero-text {
    animation: fadeUp 0.8s 0.15s ease both;
}

.hero-text h1 {
    font-family: 'Noto Serif Devanagari', serif;
    color: #fff;
    font-size: 36px;
    font-weight: 900;
    line-height: 1.15;
    margin-bottom: 14px;
}

.hero-text h1 span {
    color: var(--accent);
}

.hero-text p {
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1.7;
}

.stats-row {
    display: flex;
    gap: 24px;
    animation: fadeUp 0.8s 0.3s ease both;
}

.stat-pill {
    background: var(--fog);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px;
    padding: 12px 18px;
    text-align: center;
}

.stat-pill .val {
    font-family: 'Noto Serif Devanagari', serif;
    color: var(--accent);
    font-size: 22px;
    font-weight: 700;
}

.stat-pill .lbl {
    color: var(--text-muted);
    font-size: 10px;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-top: 2px;
}

/* Right panel */
.panel-right {
    flex: 1;
    background: #f7f5f0;
    padding: 36px 44px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow-y: auto;
}

.login-title {
    font-family: 'Noto Serif Devanagari', serif;
    font-size: 28px;
    font-weight: 700;
    color: var(--forest-dark);
    margin-bottom: 6px;
    animation: fadeUp 0.7s 0.1s ease both;
}

.login-sub {
    color: #7a8a7a;
    font-size: 13.5px;
    margin-bottom: 20px;
    animation: fadeUp 0.7s 0.2s ease both;
}

.login-form-wrap {
    animation: fadeUp 0.7s 0.25s ease both;
}

.login-page .form-label {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #4a5a4a;
    margin-bottom: 6px;
}

.login-page .form-control {
    border: 1.5px solid #d8e4d0;
    border-radius: 10px;
    padding: 12px 16px;
    font-size: 14px;
    color: var(--forest-dark);
    background: #fff;
    transition: all 0.2s;
}

.login-page .form-control:focus {
    border-color: var(--leaf);
    box-shadow: 0 0 0 3px rgba(46,139,87,0.12);
    outline: none;
}

.input-icon-wrap {
    position: relative;
}

.input-icon-wrap .bi {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #8aaa8a;
    font-size: 16px;
}

.input-icon-wrap .form-control {
    padding-left: 42px;
}

.login-form-wrap .mb-3 {
    margin-bottom: 0.75rem !important;
}

.btn-login {
    background: linear-gradient(135deg, var(--forest-green), var(--leaf));
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 13px;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.5px;
    width: 100%;
    cursor: pointer;
    transition: all 0.25s;
    box-shadow: 0 6px 20px rgba(46,139,87,0.35);
    margin-top: 8px;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(46,139,87,0.45);
    color: #fff;
}

.btn-login:active {
    transform: translateY(0);
}

.divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 14px 0;
}

.divider hr {
    flex: 1;
    border-color: #d8e4d0;
}

.divider span {
    color: #aabcaa;
    font-size: 12px;
}

.quick-access {
    display: flex;
    gap: 10px;
    animation: fadeUp 0.7s 0.4s ease both;
}

.quick-btn {
    flex: 1;
    border: 1.5px solid #d8e4d0;
    border-radius: 10px;
    padding: 10px;
    background: #fff;
    color: #4a5a4a;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.quick-btn:hover {
    border-color: var(--leaf);
    color: var(--leaf);
    background: rgba(46,139,87,0.04);
}

.quick-btn .bi {
    font-size: 18px;
}

.login-page .form-check-input:checked {
    background-color: var(--leaf);
    border-color: var(--leaf);
}

.forgot {
    color: var(--leaf);
    font-size: 13px;
    text-decoration: none;
}

.forgot:hover {
    color: var(--forest-green);
}

/* Validation */
.field-validation-error {
    color: #dc3545;
    font-size: 12px;
    margin-top: 4px;
    display: block;
}

.validation-summary-errors {
    background: rgba(220,53,69,0.08);
    border: 1px solid rgba(220,53,69,0.2);
    border-radius: 10px;
    padding: 10px 16px;
    margin-bottom: 16px;
    color: #dc3545;
    font-size: 13px;
}

.validation-summary-errors ul {
    margin: 0;
    padding-left: 18px;
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(18px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* ── Captcha (single row) ────────────────────── */
.captcha-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.captcha-image {
    flex: 0 0 160px;
    border-radius: 6px;
    overflow: hidden;
    border: 2px solid #c5dbc5;
    background: #e8f0e0;
    line-height: 0;
}

.captcha-image svg {
    display: block;
    width: 100%;
    height: 38px;
}

.captcha-input-wrap {
    flex: 1;
    min-width: 0;
}

.captcha-input-wrap .form-control {
    font-size: 13px;
    letter-spacing: 2px;
}

.btn-captcha-refresh {
    width: 38px;
    height: 38px;
    border-radius: 6px;
    border: 2px solid #c5dbc5;
    background: #f0f6ee;
    color: #2e8b57;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    flex-shrink: 0;
}

.btn-captcha-refresh:hover {
    background: #2e8b57;
    color: white;
    border-color: #2e8b57;
}

.btn-captcha-refresh i.spin {
    animation: captchaSpin 0.6s ease;
}

@keyframes captchaSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@media (max-width: 700px) {
    .panel-left {
        display: none;
    }

    .panel-right {
        padding: 40px 28px;
    }

    .login-wrap {
        width: 100%;
        max-width: 100vw;
        min-height: 100vh;
        border-radius: 0;
    }

    .login-title {
        font-size: 22px;
    }

    .quick-access {
        flex-wrap: wrap;
    }

    .quick-btn {
        flex: 1 1 calc(50% - 5px);
    }
}

@media (min-width: 701px) and (max-width: 1024px) {
    .login-wrap {
        width: 95vw;
        min-height: 480px;
    }

    .panel-left {
        flex: 0.9;
        padding: 36px 28px;
    }

    .panel-right {
        padding: 36px 28px;
    }

    .hero-text h1 {
        font-size: 28px;
    }

    .stats-row {
        gap: 14px;
    }

    .stat-pill {
        padding: 10px 14px;
    }

    .stat-pill .val {
        font-size: 18px;
    }
}

@media (max-width: 400px) {
    .panel-right {
        padding: 30px 18px;
    }

    .login-title {
        font-size: 20px;
    }

    .login-sub {
        font-size: 12px;
    }

    .btn-login {
        padding: 12px;
        font-size: 13px;
    }

    .quick-access {
        flex-direction: column;
    }

    .quick-btn {
        flex-direction: row;
        justify-content: center;
    }
}

@media (min-height: 900px) {
    .login-wrap {
        min-height: 600px;
    }
}

/* Landscape phones */
@media (max-height: 500px) and (orientation: landscape) {
    body.login-page {
        align-items: flex-start;
        padding: 10px;
    }

    .login-wrap {
        min-height: auto;
    }

    .panel-left {
        display: none;
    }

    .panel-right {
        padding: 20px 28px;
    }

    .login-sub {
        margin-bottom: 16px;
    }
}
