/* ===== Phase 1 — PIN lock screen ===== */
#phase-1 {
    background-image: url("../background/raw_background.webp");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: grid;
    place-items: center;
    z-index: 80;
}

.lock-frame {
    width: min(320px, 86vw);
    padding: 22px 26px 26px;
    background: rgba(255, 255, 255, 0.22);
    backdrop-filter: blur(6px) saturate(120%);
    -webkit-backdrop-filter: blur(6px) saturate(120%);
    border: 1px solid rgba(255, 255, 255, 0.45);
    border-radius: 22px;
    box-shadow: 0 14px 36px rgba(184, 92, 111, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.55);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
    /* Centered on screen via #phase-1 place-items: center */
}

.lock-info {
    font-family: "Shantell Sans", "Quicksand", system-ui, sans-serif;
    color: var(--pink-900);
    line-height: 1.5;
    text-align: center;
    width: 100%;
}

.lock-info-row {
    font-size: 20px;
    font-weight: 400;
    letter-spacing: 0.2px;
}

.lock-info-row .label {
    color: var(--pink-500);
    font-weight: 400;
    margin-right: 6px;
}

.lock-info-pin {
    margin-top: 16px;
    font-size: 15px;
    font-weight: 300;
    letter-spacing: 2px;
    color: var(--pink-700);
    opacity: 0.85;
}

.pin-hearts {
    margin-top: 10px;
    display: flex;
    gap: 10px;
    justify-content: center;
}

.pin-heart {
    width: 18px;
    height: 18px;
    background-color: transparent;
    -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M12 21s-7.5-4.6-9.5-9.2C1 8 3 4 7 4c2.2 0 3.7 1.2 5 3 1.3-1.8 2.8-3 5-3 4 0 6 4 4.5 7.8C19.5 16.4 12 21 12 21z'/></svg>") center/contain no-repeat;
            mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M12 21s-7.5-4.6-9.5-9.2C1 8 3 4 7 4c2.2 0 3.7 1.2 5 3 1.3-1.8 2.8-3 5-3 4 0 6 4 4.5 7.8C19.5 16.4 12 21 12 21z'/></svg>") center/contain no-repeat;
    background-color: rgba(184, 92, 111, 0.25);
    transition: background-color 0.25s ease, transform 0.25s var(--ease-out-strong);
}

.pin-heart.is-filled {
    background-color: var(--pink-700);
    transform: scale(1.18);
}

.pin-heart.is-error {
    background-color: #c83a4f !important;
    animation: pin-heart-flash 0.4s ease-in-out;
}

.pin-heart.is-success {
    background-color: #d44b66 !important;
    animation: pin-heart-pop 0.5s var(--ease-out-strong);
}

/* Keypad */
.keypad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.keypad-btn {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.7);
    background: rgba(255, 255, 255, 0.55);
    color: var(--pink-700);
    font-family: 'Quicksand', system-ui, sans-serif;
    font-size: 22px;
    font-weight: 500;
    cursor: pointer;
    display: grid;
    place-items: center;
    transition: transform 0.15s var(--ease-out-strong), background 0.15s ease, box-shadow 0.15s ease;
    box-shadow: 0 4px 10px rgba(184, 92, 111, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.9);
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    justify-self: center;
}

.keypad-btn:hover {
    background: rgba(255, 255, 255, 0.75);
    transform: scale(1.06);
}

.keypad-btn:active {
    transform: scale(0.95);
    background: var(--pink-200);
}

.keypad-btn.is-action {
    color: var(--pink-500);
    font-size: 20px;
}

.keypad-btn svg {
    width: 22px;
    height: 22px;
    fill: currentColor;
}

.lock-frame.is-shaking {
    animation: lock-shake 0.45s ease-in-out;
}

.lock-frame.is-unlocking {
    animation: lock-unlock 1.2s var(--ease-out-strong) forwards;
}

@keyframes pin-heart-flash {
    0%, 100% { transform: scale(1.18); }
    50%      { transform: scale(1.4); }
}

@keyframes pin-heart-pop {
    0%   { transform: scale(1.18); }
    50%  { transform: scale(1.6); }
    100% { transform: scale(1.3); }
}

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

@keyframes lock-unlock {
    0%   { transform: scale(1); opacity: 1; }
    40%  { transform: scale(1.04); opacity: 1; }
    100% { transform: scale(0.85); opacity: 0; }
}

/* Tablet */
@media (max-width: 900px) {
    .lock-frame {
        gap: 16px;
        padding: 22px 22px 24px;
    }
}

/* Mobile */
@media (max-width: 480px) {
    .lock-frame { padding: 20px 18px 22px; width: min(290px, 86vw); }
    .lock-info-row { font-size: 18px; }
    .lock-info-pin { font-size: 13px; letter-spacing: 1.5px; }
    .keypad-btn { width: 54px; height: 54px; font-size: 20px; }
    .keypad { gap: 7px; }
}

@media (prefers-reduced-motion: reduce) {
    .keypad-btn { transition: none; }
    .lock-frame.is-shaking { animation: none; }
    .lock-frame.is-unlocking { opacity: 0; transition: opacity 0.4s linear; }
}
