/* ==========================================================================
   APP LOCK STYLES (BEM Architecture)
   ========================================================================== */

/* --------------------------------------------------
   1. App Lock Full-screen Overlay
   -------------------------------------------------- */
.app-lock-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999999;
    background: radial-gradient(circle at 50% 20%, #16422b 0%, #0c2417 60%, #06140d 100%);
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: #ffffff;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
}

.app-lock-overlay.is-active {
    display: flex;
}

.app-lock-overlay.is-unlocked {
    display: none !important;
}

.app-lock-overlay__content {
    width: 100%;
    max-width: 360px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

/* User Info Header */
.app-lock-overlay__avatar-wrap {
    width: 76px;
    height: 76px;
    border-radius: 50%;
    border: 3px solid rgba(75, 140, 97, 0.5);
    padding: 3px;
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
    margin-bottom: 14px;
}

.app-lock-overlay__avatar {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}

.app-lock-overlay__title {
    font-size: 19px;
    font-weight: 700;
    color: #ffffff;
    margin: 0 0 6px;
    letter-spacing: -0.2px;
}

.app-lock-overlay__subtitle {
    font-size: 13.5px;
    color: rgba(255, 255, 255, 0.7);
    margin: 0 0 28px;
    min-height: 20px;
}

.app-lock-overlay__subtitle.is-error {
    color: #f87171;
    font-weight: 600;
    animation: appLockShake 0.35s ease;
}

/* 4 Dots PIN Indicator */
.app-lock-dots {
    display: flex;
    gap: 18px;
    margin-bottom: 36px;
    align-items: center;
    justify-content: center;
}

.app-lock-dots.is-error {
    animation: appLockShake 0.38s ease;
}

.app-lock-dot {
    width: 15px;
    height: 15px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.4);
    background: transparent;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.app-lock-dot.is-filled {
    background: #4ade80;
    border-color: #4ade80;
    transform: scale(1.15);
    box-shadow: 0 0 12px rgba(74, 222, 128, 0.6);
}

@keyframes appLockShake {

    0%,
    100% {
        transform: translateX(0);
    }

    20%,
    60% {
        transform: translateX(-9px);
    }

    40%,
    80% {
        transform: translateX(9px);
    }
}

/* Keypad (3x4 grid) */
.app-lock-pad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px 22px;
    width: 100%;
    max-width: 290px;
}

.app-lock-key {
    width: 68px;
    height: 68px;
    margin: 0 auto;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.09);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #ffffff;
    font-size: 24px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s, border-color 0.15s;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
    -webkit-tap-highlight-color: transparent;
}

.app-lock-key:active {
    background: rgba(74, 222, 128, 0.35);
    border-color: rgba(74, 222, 128, 0.6);
    transform: scale(0.92);
}

.app-lock-key--action {
    background: transparent;
    border-color: transparent;
    box-shadow: none;
    font-size: 22px;
    color: rgba(255, 255, 255, 0.85);
}

.app-lock-key--action:active {
    background: rgba(255, 255, 255, 0.12);
    border-color: transparent;
}

.app-lock-key--biometric {
    color: #4ade80;
}

.app-lock-key--biometric:active {
    background: rgba(74, 222, 128, 0.2);
}

.app-lock-key .material-icons-outlined {
    font-size: 26px;
}

/* --------------------------------------------------
   2. PIN Setup / Change Modal
   -------------------------------------------------- */
.app-lock-modal {
    position: fixed;
    inset: 0;
    z-index: 999999;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.app-lock-modal.is-open {
    display: flex;
}

.app-lock-modal__container {
    background: #ffffff;
    border-radius: 24px;
    width: 100%;
    max-width: 420px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.18), 0 8px 16px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    animation: appLockModalSlideUp 0.28s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes appLockModalSlideUp {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.97);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.app-lock-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #f1f5f9;
}

.app-lock-modal__header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.app-lock-modal__header-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: #1e4a30;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.app-lock-modal__header-icon .material-icons-outlined {
    font-size: 20px;
}

.app-lock-modal__title {
    font-size: 16px;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
}

.app-lock-modal__close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #f1f5f9;
    border: none;
    cursor: pointer;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
}

.app-lock-modal__body {
    padding: 24px 20px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    align-items: center;
    text-align: center;
}

.app-lock-modal__step-title {
    font-size: 15px;
    font-weight: 600;
    color: #1e293b;
    margin: 0;
}

.app-lock-modal__step-desc {
    font-size: 13px;
    color: #64748b;
    margin: 0 0 12px;
}

.app-lock-modal__hidden-input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.app-lock-modal__dots {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
}

.app-lock-modal__dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid #cbd5e1;
    background: #f8fafc;
    transition: all 0.18s ease;
}

.app-lock-modal__dot.is-filled {
    background: #10b981;
    border-color: #10b981;
    transform: scale(1.15);
}

.app-lock-modal__pad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px 16px;
    width: 100%;
    max-width: 250px;
}

.app-lock-modal__key {
    width: 58px;
    height: 58px;
    margin: 0 auto;
    border-radius: 50%;
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    color: #1e293b;
    font-size: 22px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s;
    -webkit-tap-highlight-color: transparent;
}

.app-lock-modal__key:active {
    background: #e2e8f0;
    transform: scale(0.92);
}

.app-lock-modal__key--action {
    background: transparent;
    border-color: transparent;
    color: #64748b;
}

.app-lock-modal__key--action:active {
    background: #f1f5f9;
}

.app-lock-modal__footer {
    padding: 12px 20px;
    border-top: 1px solid #f1f5f9;
    display: flex;
    justify-content: flex-end;
    background: #f8fafc;
}

/* --------------------------------------------------
   3. Switch Toggle Component in Settings
   -------------------------------------------------- */
.app-lock-switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
    flex-shrink: 0;
}

.app-lock-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.app-lock-switch__slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background-color: #cbd5e1;
    transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 26px;
}

.app-lock-switch__slider::before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: #ffffff;
    transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.app-lock-switch input:checked+.app-lock-switch__slider {
    background-color: #10b981;
}

.app-lock-switch input:checked+.app-lock-switch__slider::before {
    transform: translateX(22px);
}