.login-page {
    min-height: 100vh;
    min-height: 100dvh;

    background:
        radial-gradient(circle at top, rgba(18, 155, 211, .22), transparent 46%),
        #111;
}

.login-shell {
    display: grid;
    place-items: center;

    min-height: 100vh;
    min-height: 100dvh;
    padding:
        calc(1.5rem + env(safe-area-inset-top, 0px))
        calc(1.5rem + env(safe-area-inset-right, 0px))
        calc(1.5rem + env(safe-area-inset-bottom, 0px))
        calc(1.5rem + env(safe-area-inset-left, 0px));
}

.login-card {
    width: min(100%, 420px);
    padding: clamp(1.5rem, 5vw, 2.5rem);

    background: #222;
    border: 3px solid #3cb043;
    border-left-width: 8px;
    border-radius: 14px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .36);
}

.login-kicker {
    margin: 0 0 .4rem;

    color: #129bd3;

    font-size: .8rem;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.login-card h1 {
    margin: 0;

    color: #fff;

    font-size: clamp(1.75rem, 7vw, 2.3rem);
    line-height: 1.1;
}

.login-copy {
    margin: .8rem 0 1.75rem;

    color: #bbb;
    font-size: 1rem;
}

.login-form {
    display: grid;
    gap: .65rem;
}

.login-form label {
    color: #ddd;
    font-size: .95rem;
    font-weight: 600;
}

.login-form input[type="password"] {
    width: 100%;
    min-height: 52px;
    padding: 0 .9rem;

    appearance: none;
    border: 1px solid #666;
    border-radius: 6px;
    outline: none;

    background: #111;
    color: #fff;

    font: inherit;
    font-size: 1.1rem;
}

.login-form input[type="password"]:focus {
    border-color: #129bd3;
    box-shadow: 0 0 0 3px rgba(18, 155, 211, .25);
}

.login-form button {
    min-height: 52px;
    margin-top: .55rem;

    appearance: none;
    border: 1px solid #2d7d32;
    border-radius: 6px;

    background: #3cb043;
    color: #fff;

    font: inherit;
    font-size: 1rem;
    font-weight: 700;

    cursor: pointer;
    touch-action: manipulation;
}

.login-form button:active {
    background: #2d7d32;
}

.login-error {
    margin: .15rem 0 0;
    color: #ff6b61;
    font-size: .9rem;
    font-weight: 600;
}

/* The PIN interface is scoped so the shared administrator logins keep their forms. */
.kds-pin-page .kds-pin-card {
    width: min(100%, 390px);
    padding: clamp(1.4rem, 4vw, 2.15rem);
    border-left-width: 3px;
    text-align: center;
}

.kds-pin-page .login-copy {
    margin-bottom: 1.3rem;
}

.pin-dots {
    display: flex;
    justify-content: center;
    gap: clamp(.75rem, 3vw, 1rem);
    min-height: 18px;
}

.pin-dot {
    width: 15px;
    height: 15px;
    border: 2px solid #f2f2f2;
    border-radius: 50%;
    background: transparent;
    transition: background-color 120ms ease, transform 120ms ease;
}

.pin-dot.is-filled {
    background: #f2f2f2;
    transform: scale(1.05);
}

.pin-status {
    min-height: 1.25rem;
    margin: .85rem 0 .7rem;
    color: #bbb;
    font-size: .9rem;
    font-weight: 600;
}

.pin-status.is-error {
    color: #ff6b61;
}

.pin-status.is-success {
    color: #64d66a;
}

.pin-keypad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    justify-items: center;
    gap: .72rem clamp(.85rem, 4vw, 1.15rem);
    width: min(100%, 286px);
    margin: 0 auto;
}

.pin-key {
    display: grid;
    place-items: center;
    width: clamp(62px, 18vw, 72px);
    height: clamp(62px, 18vw, 72px);
    padding: 0;
    appearance: none;
    border: 1px solid #5e5e5e;
    border-radius: 50%;
    outline: none;
    background: #333;
    color: #fff;
    font: inherit;
    font-size: 1.65rem;
    font-weight: 500;
    line-height: 1;
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    transition: background-color 100ms ease, transform 100ms ease, opacity 100ms ease;
}

.pin-key:hover {
    background: #404040;
}

.pin-key:focus-visible {
    border-color: #129bd3;
    box-shadow: 0 0 0 3px rgba(18, 155, 211, .32);
}

.pin-key:active {
    background: #555;
    transform: scale(.95);
}

.pin-delete {
    border-color: transparent;
    background: transparent;
    color: #bbb;
    font-size: 1.5rem;
}

.pin-delete:hover,
.pin-delete:active {
    background: rgba(255, 255, 255, .08);
}

.pin-keypad.is-disabled .pin-key {
    cursor: default;
    opacity: .55;
    pointer-events: none;
}

.pin-dots.is-error {
    animation: pin-shake 360ms ease-in-out;
}

@keyframes pin-shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-8px); }
    40%, 80% { transform: translateX(8px); }
}

@media (max-height: 620px) {
    .kds-pin-page .login-shell {
        padding-top: calc(.8rem + env(safe-area-inset-top, 0px));
        padding-bottom: calc(.8rem + env(safe-area-inset-bottom, 0px));
    }

    .kds-pin-page .kds-pin-card {
        padding-top: 1.1rem;
        padding-bottom: 1.1rem;
    }

    .kds-pin-page .login-copy {
        margin: .5rem 0 .8rem;
    }

    .pin-status {
        margin: .55rem 0 .45rem;
    }

    .pin-keypad {
        gap: .45rem 1rem;
    }

    .pin-key {
        width: 56px;
        height: 56px;
        font-size: 1.4rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .pin-dot,
    .pin-key {
        transition: none;
    }

    .pin-dots.is-error {
        animation: none;
    }
}
