.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}

.login-shell {
    width: min(360px, 100%);
    text-align: center;
}

.login-shell h1 {
    margin-bottom: 12px;
}

.login-shell > p {
    margin: 0 auto 40px;
    max-width: 320px;
    font-size: 1.1rem;
    font-style: italic;
    color: #6b525a;
}

.login-form {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 28px;
}

.login-form > input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
    width: 1px;
    height: 1px;
}

.pin-dots {
    display: flex;
    gap: 18px;
    justify-content: center;
    min-height: 18px;
}

.pin-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid #b83b5e;
    background: transparent;
    transition: background 0.12s ease, transform 0.12s ease;
}

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

.pin-dots.shake {
    animation: pin-shake 0.45s ease;
}

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

.passcode-keypad {
    display: grid;
    grid-template-columns: repeat(3, 76px);
    gap: 18px 22px;
    justify-content: center;
    user-select: none;
}

.keypad-key {
    width: 76px;
    height: 76px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.72);
    color: #4a3a3f;
    font-family: 'Playfair Display', serif;
    font-size: 1.7rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(184, 59, 94, 0.1);
    transition: background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.keypad-key:hover {
    background: rgba(255, 255, 255, 0.95);
}

.keypad-key:active {
    transform: scale(0.94);
    background: rgba(224, 122, 157, 0.28);
}

.keypad-delete {
    font-size: 1.35rem;
    background: transparent;
    box-shadow: none;
    color: #b83b5e;
}

.keypad-delete:hover,
.keypad-delete:active {
    background: rgba(184, 59, 94, 0.08);
    box-shadow: none;
}

.keypad-spacer {
    width: 76px;
    height: 76px;
}

.login-form.is-loading .passcode-keypad {
    opacity: 0.55;
    pointer-events: none;
}

.login-error {
    margin: 0;
    min-height: 1.4em;
    color: #b83b5e;
    font-size: 0.95rem;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

@media (max-width: 420px) {
    .login-page {
        padding: 28px 16px;
        align-items: flex-start;
        padding-top: max(28px, env(safe-area-inset-top));
        padding-bottom: max(28px, env(safe-area-inset-bottom));
    }

    .login-shell > p {
        font-size: 1rem;
        margin-bottom: 28px;
    }

    .passcode-keypad {
        grid-template-columns: repeat(3, 68px);
        gap: 14px 16px;
    }

    .keypad-key,
    .keypad-spacer {
        width: 68px;
        height: 68px;
        font-size: 1.55rem;
    }

    .keypad-delete {
        font-size: 1.25rem;
    }
}

@media (max-height: 700px) and (max-width: 520px) {
    .login-page {
        align-items: flex-start;
    }

    .login-shell > p {
        margin-bottom: 22px;
    }

    .login-form {
        gap: 20px;
    }

    .passcode-keypad {
        gap: 12px 14px;
    }

    .keypad-key,
    .keypad-spacer {
        width: 62px;
        height: 62px;
        font-size: 1.4rem;
    }
}
