/* ─── @font-face ────────────────────────────────────────────────────────── */

@font-face {
    font-family: "Balsamiq Sans";
    font-weight: 400;
    font-style: normal;
    src: url("static/Balsamiq_Sans/BalsamiqSans-Regular.ttf") format("truetype");
}

@font-face {
    font-family: "Balsamiq Sans";
    font-weight: 700;
    font-style: normal;
    src: url("static/Balsamiq_Sans/BalsamiqSans-Bold.ttf") format("truetype");
}

@font-face {
    font-family: "Balsamiq Sans";
    font-weight: 400;
    font-style: italic;
    src: url("static/Balsamiq_Sans/BalsamiqSans-Italic.ttf") format("truetype");
}

@font-face {
    font-family: "Balsamiq Sans";
    font-weight: 700;
    font-style: italic;
    src: url("static/Balsamiq_Sans/BalsamiqSans-BoldItalic.ttf") format("truetype");
}

/* ─── Root / reset ─────────────────────────────────────────────────────── */

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

html,
body {
    height: 100%;
    overflow: hidden;
    font-family: "Balsamiq Sans", sans-serif;
}

/* ─── Animated gradient background ──────────────────────────────────────── */

@keyframes gradient-shift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

body {
    background: linear-gradient(135deg, #409bf0, #ff8585, #8598ff);
    background-size: 300% 300%;
    animation: gradient-shift 20s ease infinite;
}

/* ─── Wrapper ───────────────────────────────────────────────────────────── */

#wrapper {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    width: 100%;
}

/* ─── Clock (optional, hidden by default) ────────────────────────────────── */

#clock-box {
    font-family: "Balsamiq Sans", sans-serif;
    font-size: 5rem;
    text-align: center;
    color: white;
}

/* ─── Login card ────────────────────────────────────────────────────────── */

#login-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 1.25rem;
    width: 18rem;
    min-height: 24rem;
    padding: 2.5rem 1.5rem 1.5rem;
    background-color: #fff;
    border-radius: 1.5rem;
    box-shadow: 0 0 4rem rgba(0, 0, 0, 0.15);
    overflow: hidden;
}

/* ─── User avatar ────────────────────────────────────────────────────────── */

#login-picture {
    display: block;
    width: 5em;
    height: 5em;
    border-radius: 50%;
    object-fit: cover;
    transition: opacity 0.5s ease-in-out;
}

/* ─── Feedback / error message ────────────────────────────────────────────── */

#login-response {
    width: 100%;
    font-size: 0.85rem;
    color: #ff6f6f;
    min-height: 1.2em;
}

#login-response.success {
    color: #4caf50;
}

/* ─── Form ───────────────────────────────────────────────────────────────── */

#login-form {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
}

/* ─── User list (prev / next carousel) ────────────────────────────────────── */

#container {
    display: flex;
    align-items: center;
    width: 100%;
    overflow: hidden;
    background-color: #f9f9f9;
    border: 1px solid #f5f5f5;
    border-radius: 0.625rem;
    position: relative;
}

#name {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    flex-shrink: 0;
    transition: transform 0.4s ease-in-out;
}

#name span {
    flex: 0 0 100%;
    padding: 0.5rem;
    text-align: center;
    font-size: 0.9rem;
    color: #555;
}

/* Nav buttons inside the carousel track */
#last,
#next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    background: none;
    border: none;
    padding: 0.25rem 0.5rem;
    color: #bbb;
    font-size: 1rem;
    cursor: pointer;
    transition: color 0.2s;
    line-height: 1;
}

#last:hover,
#next:hover {
    color: #409bf0;
}

#last {
    left: 0.25rem;
}

#next {
    right: 0.25rem;
}

/* ─── Password field ─────────────────────────────────────────────────────── */

#login-password {
    width: 100%;
    height: 2.5rem;
    padding: 0.5rem 0.75rem;
    font-family: "Balsamiq Sans", sans-serif;
    font-size: 0.9rem;
    text-align: center;
    background-color: #fff;
    border: 1px solid #e2e1e1;
    border-radius: 1.25rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

#login-password::placeholder {
    font-family: "Balsamiq Sans", sans-serif;
    color: #b4b4b4;
}

#login-password:hover {
    border-color: #e0e0e0;
}

#login-password:focus,
#login-password:active {
    border-color: #cacaca;
    box-shadow: inset 0 1px 2px rgba(255, 140, 140, 0.3);
}

/* ─── Login button ───────────────────────────────────────────────────────── */

#login-button {
    width: 100%;
    height: 2.5rem;
    font-family: "Balsamiq Sans", sans-serif;
    font-weight: 700;
    font-size: 0.9rem;
    color: #fff;
    background: linear-gradient(135deg, #409bf0, #ff8585, #8598ff);
    background-size: 300% 300%;
    border: none;
    border-radius: 1.25rem;
    cursor: pointer;
    animation: gradient-shift 20s ease infinite;
    transition: box-shadow 0.2s, transform 0.1s;
    outline: none;
}

#login-button:hover {
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
}

#login-button:active {
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
    transform: scale(0.99);
}

/* ─── Responsive adjustments ─────────────────────────────────────────────── */

@media (min-width: 768px) {
    #login-box {
        width: 20rem;
        min-height: 26rem;
        padding: 3rem 2rem 2rem;
    }

    #clock-box {
        font-size: 6rem;
    }
}

@media (min-width: 1200px) {
    #login-box {
        width: 22rem;
        min-height: 28rem;
        padding: 3.5rem 2.5rem 2rem;
    }
}
