/* =========================================
   Dorfpolizei – Login.css (clean)
========================================= */

/* ---------- Variablen ---------- */
:root {
    --ink: #1b1a18;
    --ink-soft: #2a2a28;
    --parchment-1: #f6f1e8;
    --parchment-2: #efe7d6;
    --parchment-edge: #c1a67b;
    --leather-1: #6e4d33;
    --leather-2: #3f2f23;
    --stone-1: #6c737a;
    --stone-2: #545b62;
    --brass: #b48a49;
    --shadow: 0 18px 40px rgba(0,0,0,.35);
}

/* ---------- Basis / Vollbild ---------- */
html, body {
    height: 100%;
    margin: 0;
    padding: 0;
}

body {
    min-height: 100vh;
    width: 100vw;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ink);
    font-family: "Cormorant Garamond", serif;
    overflow: hidden;
    background: #000;
}

/* ---------- Hintergrund ---------- */
#bg {
    position: fixed;
    inset: 0;
    z-index: -2;
    background: center / cover no-repeat fixed;
}

body::before {
    content: "";
    position: fixed;
    inset: -2rem;
    z-index: -1;
    pointer-events: none;
    background: radial-gradient(80% 100% at 50% 0%, rgba(0,0,0,.25) 0%, rgba(0,0,0,0) 60%) top/100% 100% no-repeat, radial-gradient(100% 60% at 50% 100%, rgba(0,0,0,.25) 0%, rgba(0,0,0,0) 60%) bottom/100% 100% no-repeat, repeating-linear-gradient(0deg, rgba(0,0,0,.04) 0 2px, rgba(0,0,0,.02) 2px 4px);
    mix-blend-mode: multiply;
}

/* ---------- Footer / Disclaimer ---------- */
#dp-footer {
    position: fixed;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    color: rgba(255, 255, 255, 0.75);
    font-family: "Lora", serif;
    font-size: 0.9rem;
    letter-spacing: 0.3px;
    background: rgba(0, 0, 0, 0.4);
    padding: 8px 16px;
    border-radius: 8px;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
    z-index: 5;
}

    #dp-footer p {
        margin: 0;
        line-height: 1.4;
    }

/* ---------- Landing + FirstLogin (identischer Look) ---------- */
#landing-container,
#firstLogin-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 10px;
    opacity: 0;
    background: rgba(246,241,232,.18);
    border: 1px solid rgba(140,110,70,.25);
    border-radius: 16px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: 0 18px 40px rgba(0,0,0,.35);
    transform: translateY(10px);
}

    /* Einblenden: Landing nutzt .show, FirstLogin nutzt .visible */
    #landing-container.show,
    #firstLogin-container.visible {
        opacity: 1;
        transform: translateY(0);
        transition: opacity 1s ease, transform 1s ease;
    }

    #landing-container.fade-out,
    #firstLogin-container.fade-out {
        opacity: 0;
        transform: translateY(10px);
        transition: opacity .2s ease, transform .2s ease;
    }

/* Extra Air-Space unten im FirstLogin */
#firstLogin-container {
    padding-bottom: 18px;
}

/* ---------- Panels ---------- */
.panel {
    box-shadow: var(--shadow);
    border-radius: 16px;
    position: relative;
}

.panel--parchment {
    background: radial-gradient(120% 100% at 0% 0%, rgba(255,255,255,.70), rgba(255,255,255,0) 60%) no-repeat, radial-gradient(120% 100% at 100% 0%, rgba(255,255,255,.60), rgba(255,255,255,0) 60%) no-repeat, linear-gradient(180deg, var(--parchment-1), var(--parchment-2));
    border: 1px solid var(--parchment-edge);
}

    .panel--parchment::after {
        content: "";
        position: absolute;
        inset: 0;
        border-radius: 16px;
        pointer-events: none;
        box-shadow: inset 0 0 0 2px rgba(140,110,70,.10), inset 0 0 56px rgba(110,75,40,.10);
    }

/* Login-Panel (glasiger Look + Ein-/Ausblendung) */
#login-container {
    display: none;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity .28s ease, transform .28s ease;
    padding: 26px 36px;
    text-align: center;
    min-width: 320px;
    max-width: 92vw;
    background: rgba(246,241,232,.18);
    border: 1px solid rgba(140,110,70,.25);
    border-radius: 16px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: 0 18px 40px rgba(0,0,0,.35);
    position: relative;
}

    #login-container::before {
        content: "";
        position: absolute;
        inset: 0;
        border-radius: inherit;
        pointer-events: none;
        box-shadow: inset 0 60px 80px rgba(0,0,0,.18), inset 0 -40px 60px rgba(0,0,0,.16);
    }

    #login-container.visible {
        opacity: 1;
        transform: translateY(0);
    }

/* ---------- Typo ---------- */
.title-serif {
    margin: 0 0 18px 0;
    font-family: "Cinzel", serif;
    font-weight: 700;
    font-size: 1.55rem;
    text-align: center;
    color: #b08c4e;
    letter-spacing: .5px;
    text-shadow: 0 1px 1px rgba(0,0,0,.6), 0 2px 4px rgba(0,0,0,.35), 0 -1px 0 rgba(255,255,255,.25);
}

    .title-serif::after {
        content: "";
        display: block;
        margin: 6px auto 0;
        width: 50%;
        height: 1.5px;
        background: linear-gradient(90deg,transparent,#b08c4e 20%,#d2b679 50%,transparent 80%);
        opacity: .5;
        border-radius: 1px;
    }

.title-bar {
    background: rgba(246,241,232,.65);
    border: 1px solid rgba(140,110,70,.25);
    border-radius: 10px;
    padding: 8px 16px;
    display: inline-block;
}

/* ---------- Inputs ---------- */
#login-container input,
#firstLogin-container input {
    display: block;
    margin: 12px auto;
    width: 260px;
    padding: 12px 14px;
    border-radius: 12px;
    outline: none;
    background: #fdf8ed;
    color: #2a2216;
    border: 1.5px solid #cdb893;
    box-shadow: inset 0 2px 4px rgba(0,0,0,.08), 0 1px 0 rgba(255,255,255,.15);
    font-family: "Cormorant Garamond", serif;
    font-size: 1.05rem;
    font-weight: 500;
}

    #login-container input::placeholder,
    #firstLogin-container input::placeholder {
        color: rgba(80,60,30,.8);
        font-style: italic;
    }

    #login-container input:focus,
    #firstLogin-container input:focus {
        border-color: #b08c4e;
        background: #fffaf0;
        box-shadow: inset 0 2px 4px rgba(0,0,0,.06), 0 0 0 3px rgba(176,140,78,.25);
    }

/* ---------- Fehler ---------- */
.error {
    color: #a94442;
    background: rgba(255,240,240,.85);
    border: 1px solid #d9534f;
    padding: 8px 12px;
    border-radius: 6px;
    margin-bottom: 15px;
    font-weight: 600;
}

/* ---------- Buttons (Basis + Varianten) ---------- */
.btn {
    appearance: none;
    border: none;
    cursor: pointer;
    user-select: none;
    padding: 14px 26px;
    font-weight: 700;
    font-size: 1.05rem;
    letter-spacing: .2px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    will-change: transform, filter, box-shadow;
    filter: drop-shadow(0 0 3px rgba(0,0,0,.5));
    transition: transform 0.25s ease, filter 0.25s ease, brightness 0.25s ease;
}

    .btn:active {
        transform: translateY(1px) scale(.995);
    }

#login-container .btn,
#firstLogin-container .btn {
    width: 260px;
}

    #login-container .btn + .btn,
    #firstLogin-container .btn + .btn {
        margin-top: 12px;
    }

/* Leder */
.btn--leather {
    background: linear-gradient(180deg, var(--leather-1), var(--leather-2));
    border: 1px solid rgba(0,0,0,.35);
    color: #f9f6ee;
}
/* Stein */
.btn--stone {
    background: linear-gradient(180deg, var(--stone-1), var(--stone-2));
    border: 1px solid rgba(0,0,0,.35);
    color: #f3f3f3;
}
/* Pergament */
.btn--parchment {
    font-family: "Cinzel", serif;
    color: var(--ink-soft);
    background: radial-gradient(120% 180% at 10% 0%, rgba(255,255,255,.55), rgba(255,255,255,0)) no-repeat, linear-gradient(180deg, rgba(255,255,255,.92), rgba(249,245,236,.9));
    border: 1px solid rgba(153,128,96,.45);
    backdrop-filter: blur(1.5px);
}

    /* ---------- Button States (Hover / Active / Click) ---------- */
    .btn--leather:hover,
    .btn--stone:hover,
    .btn--parchment:hover {
        transform: scale(1.05);
        filter: drop-shadow(0 0 6px rgba(255, 220, 150, 0.4));
    }

    .btn--leather:active,
    .btn--stone:active,
    .btn--parchment:active {
        transform: scale(1.15);
        filter: drop-shadow(0 0 10px rgba(255, 235, 180, 0.7)) brightness(1.3);
    }

/* Pulse-Animation (per .clicked Klasse vom JS) */
@keyframes brassPulse {
    0% {
        transform: scale(1);
        filter: brightness(1);
    }

    50% {
        transform: scale(1.12);
        filter: brightness(1.25);
    }

    100% {
        transform: scale(1);
        filter: brightness(1);
    }
}

.btn--leather.clicked,
.btn--stone.clicked,
.btn--parchment.clicked {
    animation: brassPulse .35s ease-in-out;
}

/* ====== FINAL FIX – Button Hover/Click Animation ====== */
.btn {
    transition: transform 0.25s ease, filter 0.25s ease, box-shadow 0.25s ease !important;
    will-change: transform, filter, box-shadow;
    position: relative;
    z-index: 1;
}

    .btn:hover {
        transform: translateY(-2px) scale(1.06) !important;
        filter: brightness(1.15) !important;
        box-shadow: 0 0 8px rgba(255, 215, 160, 0.4), 0 8px 20px rgba(0, 0, 0, 0.4) !important;
    }

    .btn:active {
        transform: scale(1.12) !important;
        filter: brightness(1.3) !important;
        box-shadow: 0 0 12px rgba(255, 240, 190, 0.6), 0 4px 12px rgba(0, 0, 0, 0.5) !important;
    }

    .btn.clicked {
        animation: brassPulse 0.35s ease-in-out !important;
    }

/* ---------- Responsiv ---------- */
@media (max-width: 480px) {
    #login-container {
        padding: 24px 20px;
    }

        #login-container input, #login-container .btn,
        #firstLogin-container input, #firstLogin-container .btn {
            width: 92%;
        }
}

/* ---------- Bewegungsreduktion (Buttons ausgenommen) ---------- */
@media (prefers-reduced-motion: reduce) {
    /* Global reduzieren, aber Buttons & Landing-Transitions behalten */
    *:not(.btn):not(#landing-container):not(#landing-container *) {
        transition: none !important;
        animation: none !important;
    }
}
