:root {
    --brass-500: #c79a5c;
    --brass-300: #e6c78f;
    --forest-950: #0f2019;
    --forest-800: #1b3a2a;
    --parchment: #f5efdd;
    --ink: #231c13;
    --slate: #6e6551;
    --slate-light: #a79c81;
    --line: #d9cba0;
}

body {
    background: radial-gradient(120% 90% at 50% -10%, #1c3527 0%, #0f2019 45%, #0a1712 100%);
    color: #e0e0e0;
    font-family: 'Inter', sans-serif;
}

.login-scene {
    position: relative;
    overflow: hidden;
    min-height: 100vh;
}

/* ---------- Ambient lamp glow ---------- */
.lamp-glow {
    position: absolute;
    top: -18%;
    left: 50%;
    transform: translateX(-50%);
    width: 900px;
    height: 700px;
    background: radial-gradient(ellipse at center, rgba(243,199,122,0.22) 0%, rgba(243,199,122,0.08) 35%, transparent 70%);
    animation: lampPulse 6s ease-in-out infinite;
    pointer-events: none;
}

@keyframes lampPulse {
    0%, 100% {
        opacity: 0.75;
    }

    50% {
        opacity: 1;
    }
}

/* ---------- Floating dust motes ---------- */
.motes {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.mote {
    position: absolute;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: rgba(230,199,143,0.55);
    animation-name: floatUp;
    animation-timing-function: linear;
    animation-iteration-count: infinite;
}

@keyframes floatUp {
    0% {
        transform: translateY(0);
        opacity: 0;
    }

    10% {
        opacity: 0.7;
    }

    90% {
        opacity: 0.3;
    }

    100% {
        transform: translateY(-260px) translateX(16px);
        opacity: 0;
    }
}

/* ---------- Floating book stack ---------- */
.book-stack {
    position: absolute;
    left: 7%;
    bottom: 9%;
    animation: gentleFloat 5.5s ease-in-out infinite;
    z-index: 1;
}

    .book-stack .book {
        width: 96px;
        height: 16px;
        border-radius: 3px;
        box-shadow: 0 4px 10px rgba(0,0,0,0.35);
    }

.book1 {
    background: #7a5230;
    transform: rotate(-3deg);
}

.book2 {
    background: #3e5c4a;
    transform: rotate(2deg);
    margin-top: -2px;
    width: 84px;
}

.book3 {
    background: #8b3a2e;
    transform: rotate(-1.5deg);
    margin-top: -2px;
    width: 100px;
}

@keyframes gentleFloat {
    0%, 100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-7px);
    }
}

/* ---------- Flipping page illustration ---------- */
.flip-book {
    position: absolute;
    right: 8%;
    bottom: 11%;
    width: 84px;
    height: 60px;
    perspective: 400px;
    opacity: 0.9;
    z-index: 1;
}

    .flip-book .cover {
        position: absolute;
        inset: 0;
        background: #234a36;
        border-radius: 2px 6px 6px 2px;
        box-shadow: 0 8px 18px rgba(0,0,0,0.4);
    }

    .flip-book .page {
        position: absolute;
        top: 3px;
        bottom: 3px;
        left: 3px;
        width: 38px;
        background: var(--parchment);
        border-radius: 1px 4px 4px 1px;
        transform-origin: left center;
        animation: pageTurn 3.4s ease-in-out infinite;
    }

        .flip-book .page.p2 {
            animation-delay: 1.7s;
        }

@keyframes pageTurn {
    0% {
        transform: rotateY(0deg);
    }

    45% {
        transform: rotateY(-158deg);
    }

    50% {
        transform: rotateY(-158deg);
    }

    95% {
        transform: rotateY(0deg);
    }

    100% {
        transform: rotateY(0deg);
    }
}

/* ---------- Eyebrow tag ---------- */
.eyebrow {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 10.5px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--brass-500);
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
}

    .eyebrow::before {
        content: "";
        width: 14px;
        height: 1px;
        background: var(--brass-500);
    }

/* ---------- Card ---------- */
.login-card {
    background-color: rgba(245, 239, 221, 0.96) !important;
    color: var(--ink) !important;
    backdrop-filter: blur(6px);
    border: 1px solid rgba(199, 154, 92, 0.35);
    border-radius: 16px !important;
    box-shadow: 0 30px 70px rgba(0,0,0,0.55);
    opacity: 0;
    animation: cardIn 0.8s cubic-bezier(.22,1,.36,1) 0.15s forwards;
    position: relative;
    z-index: 5;
}

@keyframes cardIn {
    from {
        opacity: 0;
        transform: translateY(24px) scale(0.97);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.login-card h3 {
    font-family: 'Spectral', serif;
    font-weight: 600;
    color: var(--ink);
}

.login-card .form-label {
    font-size: 12.5px;
    font-weight: 600;
    letter-spacing: 0.01em;
    color: var(--ink) !important;
}

.login-card .input-group {
    border-bottom: 1.5px solid var(--line);
    transition: border-color 0.25s ease;
}

    .login-card .input-group:focus-within {
        border-color: var(--brass-500);
    }

.login-card .input-group-text,
.login-card .form-control {
    background: transparent;
    border: none !important;
    box-shadow: none !important;
    color: var(--ink) !important;
}

    .login-card .form-control:focus {
        background: transparent;
    }

    .login-card .form-control::placeholder {
        color: var(--slate-light) !important;
        opacity: 1;
    }

.login-card .input-group-text {
    color: var(--brass-500) !important;
}

/* ---------- Button ---------- */
.btn-login {
    background: var(--forest-950);
    border-color: var(--forest-950);
    border-radius: 8px;
    font-weight: 600;
    padding: 12px 18px;
    transition: background-color 0.2s ease, transform 0.15s ease;
}

    .btn-login:hover, .btn-login:focus {
        background: var(--forest-800);
        border-color: var(--forest-800);
    }

    .btn-login:active {
        transform: scale(0.99);
    }

/* ---------- Staggered field entrance ---------- */
.field-anim {
    opacity: 0;
    animation: fadeUp 0.5s ease forwards;
}

    .field-anim.d1 {
        animation-delay: 0.45s;
    }

    .field-anim.d2 {
        animation-delay: 0.6s;
    }

    .field-anim.d3 {
        animation-delay: 0.75s;
    }

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.helper-line {
    font-size: 12.5px;
    color: var(--slate) !important;
}

    .helper-line strong {
        color: var(--ink) !important;
    }

.alert-danger {
    background-color: #661111;
    border-color: #990000;
    color: #fff;
}

a {
    color: var(--brass-300);
}

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
    .book-stack, .flip-book {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation: none !important;
        transition: none !important;
    }

    .login-card, .field-anim {
        opacity: 1 !important;
        transform: none !important;
    }
}
