/* ================================================
   Numpad keyboard-active flash (triggered by JS)
   ================================================ */
.numpad-btn.numpad-key-active {
    transform: scale(0.91);
    background: var(--primary-color);
    color: var(--white-color);
    border-color: var(--primary-color);
    transition: background 0.05s, transform 0.05s;
}

.numpad-btn-ghost.numpad-key-active {
    background: #e0e0e0;
    color: var(--dark-grey-color);
    transform: scale(0.91);
}

/* ================================================
   File drop zone: drag-over body guard
   Prevents cursor flicker when dragging over child elements
   ================================================ */
.file-input-wrap.dragging * {
    pointer-events: none;
}

/* ================================================
   Keyboard hint inside PIN modals
   ================================================ */
.pin-keyboard-hint {
    text-align: center;
    font-size: 0.76rem;
    color: #bbb;
    margin-top: 0.5rem;
    letter-spacing: 0.02em;
}

/* ================================================
   Nav Icon Button
   ================================================ */
.btn-icon-nav {
    position: relative;
    background: transparent;
    border: none;
    cursor: pointer;
    color: #555;
    font-size: 1.25rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, color 0.2s;
    -webkit-tap-highlight-color: transparent;
}

.btn-icon-nav:hover {
    background: var(--primary-light);
    color: var(--primary-color);
}

.notification-bell-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.notif-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    background: var(--danger);
    color: #fff;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
    pointer-events: none;
    border: 2px solid var(--white-color);
}

/* ================================================
   Notification Drawer
   ================================================ */
.notif-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0);
    z-index: 1900;
    pointer-events: none;
    transition: background 0.3s ease;
}

.notif-overlay.open {
    background: rgba(0, 0, 0, 0.35);
    pointer-events: auto;
}

.notif-drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: min(400px, 100vw);
    height: 100dvh;
    background: var(--white-color);
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.14);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
}

.notif-drawer.open {
    transform: translateX(0);
}

.notif-drawer-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 1.1rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.notif-drawer-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--primary-color);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.notif-drawer-head-actions {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-shrink: 0;
}

.btn-text-action {
    background: transparent;
    border: none;
    cursor: pointer;
    font-family: 'Prompt', sans-serif;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--primary-color);
    padding: 5px 8px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
}

.btn-text-action:hover {
    background: var(--primary-light);
}

.btn-text-danger {
    color: var(--danger);
}

.btn-text-danger:hover {
    background: #fff0f0;
    color: var(--danger);
}

.notif-drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem 0;
}

.notif-drawer-footer {
    padding: 0.75rem 1.25rem;
    border-top: 1px solid var(--border-color);
    flex-shrink: 0;
    min-height: 42px;
}

.notif-state-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    padding: 3rem 1.5rem;
    color: #bbb;
    font-size: 0.92rem;
    text-align: center;
}

.notif-state-wrap i {
    font-size: 2.2rem;
}

.notif-list {
    list-style: none;
    margin: 0;
    padding: 0 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.notif-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.85rem 0.9rem;
    border-radius: 10px;
    cursor: default;
    transition: background 0.15s;
    position: relative;
}

.notif-item:hover {
    background: #f7f9f8;
}

.notif-item.unread {
    background: #f0f8f5;
}

.notif-item.unread:hover {
    background: #e6f4ef;
}

.notif-item-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary-color);
    flex-shrink: 0;
    margin-top: 6px;
    transition: opacity 0.2s;
}

.notif-item.read .notif-item-dot {
    opacity: 0;
}

.notif-item-body {
    flex: 1;
    min-width: 0;
}

.notif-item-message {
    font-size: 0.88rem;
    color: var(--dark-grey-color);
    line-height: 1.55;
    word-break: break-word;
}

.notif-item.read .notif-item-message {
    color: #888;
}

.notif-item-time {
    font-size: 0.74rem;
    color: #bbb;
    margin-top: 3px;
}

.notif-item-actions {
    display: flex;
    align-items: center;
    gap: 2px;
    flex-shrink: 0;
    opacity: 0;
    transition: opacity 0.15s;
}

.notif-item:hover .notif-item-actions {
    opacity: 1;
}

.notif-action-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    color: #bbb;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    transition: background 0.15s, color 0.15s;
}

.notif-action-btn:hover {
    background: #eee;
    color: var(--dark-grey-color);
}

.notif-action-btn.dismiss:hover {
    background: #fff0f0;
    color: var(--danger);
}

/* ================================================
   Skeleton — fade-in when real content replaces it
   ================================================ */
.skeleton-fade-in {
    animation: skeleton-fade-in 0.3s ease forwards;
}

@keyframes skeleton-fade-in {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0);   }
}

/* Prevent pointer events on skeleton cards */
.document-status-card--skeleton {
    pointer-events: none;
    user-select: none;
}

/* Notification skeleton spacing */
.notif-item-skeleton {
    padding: 0.85rem 1.4rem;
    gap: 0.75rem;
}

/* ================================================
   Animation Keyframes
   ================================================ */

@keyframes fade-in-up {
    from {
        opacity: 0;
        transform: translateY(18px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fade-in-down {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes scale-in {
    from {
        opacity: 0;
        transform: scale(0.94);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes pop-in {
    0%   { opacity: 0; transform: scale(0.84); }
    65%  { transform: scale(1.05); }
    100% { opacity: 1; transform: scale(1); }
}

@keyframes slide-in-right {
    from {
        opacity: 0;
        transform: translateX(22px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slide-in-left {
    from {
        opacity: 0;
        transform: translateX(-22px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes badge-pop {
    0%   { transform: scale(0.4); opacity: 0; }
    65%  { transform: scale(1.3); }
    100% { transform: scale(1);   opacity: 1; }
}

@keyframes register-card-in {
    from {
        opacity: 0;
        transform: translateY(12px) scaleY(0.96);
        transform-origin: top center;
    }
    to {
        opacity: 1;
        transform: translateY(0) scaleY(1);
    }
}

@keyframes progress-bar-fill {
    from { width: 0 !important; }
}

@keyframes file-chip-in {
    from {
        opacity: 0;
        transform: translateX(-8px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

@keyframes section-icon-bounce {
    0%   { transform: translateY(0); }
    40%  { transform: translateY(-10px); }
    65%  { transform: translateY(-4px); }
    80%  { transform: translateY(-7px); }
    100% { transform: translateY(0); }
}

/* ================================================
   Section Transitions
   ================================================ */
#auth-section,
#dashboard-section,
#upload-section,
#status-section {
    animation: none;
}

#auth-section:not(.hidden) {
    animation: fade-in-up 0.42s cubic-bezier(0.22, 1, 0.36, 1) both;
}

#dashboard-section:not(.hidden) {
    animation: fade-in-up 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
}

#upload-section:not(.hidden) {
    animation: slide-in-right 0.38s cubic-bezier(0.22, 1, 0.36, 1) both;
}

#status-section:not(.hidden) {
    animation: slide-in-right 0.38s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* Back navigation variant */
#dashboard-section.nav-back:not(.hidden) {
    animation: slide-in-left 0.36s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* ================================================
   Auth Card — section icon bounce on load
   ================================================ */
#auth-section:not(.hidden) .section-icon {
    animation: section-icon-bounce 0.72s cubic-bezier(0.22, 1, 0.36, 1) 0.22s both;
}

#auth-section:not(.hidden) .main-card.center {
    animation: scale-in 0.44s cubic-bezier(0.22, 1, 0.36, 1) 0.05s both;
}

/* ================================================
   Register Card — slide in when shown
   ================================================ */
#register-card:not(.hidden) {
    animation: register-card-in 0.35s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* ================================================
   Dashboard Card Stagger
   ================================================ */
#dashboard-section:not(.hidden) .user-info-card {
    animation: fade-in-up 0.36s cubic-bezier(0.22, 1, 0.36, 1) 0.06s both;
}

#dashboard-section:not(.hidden) .main-card:not(.user-info-card) {
    animation: fade-in-up 0.36s cubic-bezier(0.22, 1, 0.36, 1) 0.14s both;
}

/* ================================================
   Ticket Cards Stagger
   ================================================ */
.schedule-list-gap .ticket-card:nth-child(1) {
    animation: fade-in-up 0.34s cubic-bezier(0.22, 1, 0.36, 1) 0.2s both;
}

.schedule-list-gap .ticket-card:nth-child(2) {
    animation: fade-in-up 0.34s cubic-bezier(0.22, 1, 0.36, 1) 0.28s both;
}

.schedule-list-gap .ticket-card:nth-child(3) {
    animation: fade-in-up 0.34s cubic-bezier(0.22, 1, 0.36, 1) 0.36s both;
}

.ticket-card {
    transition:
        box-shadow    0.22s ease,
        transform     0.22s ease,
        border-color  0.22s ease;
}

.ticket-card:hover {
    transform: translateY(-3px);
}

/* ================================================
   Upload Section — card and form rows
   ================================================ */
#upload-section:not(.hidden) .main-card {
    animation: fade-in-up 0.36s cubic-bezier(0.22, 1, 0.36, 1) 0.08s both;
}

#upload-section:not(.hidden) .section-back-row {
    animation: fade-in-down 0.3s ease 0.04s both;
}

/* File chip entrance */
#selected-file-chip-wrap:not(.hidden),
#revision-selected-file-chip-wrap:not(.hidden) {
    animation: file-chip-in 0.28s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* PDF preview fade in */
#pdf-preview-wrap:not(.hidden) {
    animation: fade-in-up 0.3s ease both;
}

/* ================================================
   Status Section
   ================================================ */
#status-section:not(.hidden) .main-card {
    animation: fade-in-up 0.36s cubic-bezier(0.22, 1, 0.36, 1) 0.08s both;
}

#status-section:not(.hidden) .section-back-row {
    animation: fade-in-down 0.3s ease 0.04s both;
}

/* Document status card hover */
.document-status-card {
    transition:
        box-shadow   0.2s ease,
        transform    0.2s ease,
        border-color 0.2s ease;
}

.document-status-card:hover {
    transform: translateY(-2px);
}

/* Progress bar animated fill — applied to modal */
#modal-progress-fill {
    animation: progress-bar-fill 0.8s cubic-bezier(0.22, 1, 0.36, 1) 0.3s both;
}

/* ================================================
   Document Status Card Entrance (JS-driven stagger)
   ================================================ */
.doc-card-animate {
    animation: fade-in-up 0.32s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* ================================================
   Modal Animations
   ================================================ */
.modal.show {
    animation: fade-in 0.22s ease both;
}

.modal.show .modal-card,
.modal.show .modal-card-lg {
    animation: pop-in 0.38s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* Modal sections stagger */
.modal.show .modal-section:nth-child(1) {
    animation: fade-in-up 0.28s ease 0.07s both;
}

.modal.show .modal-section:nth-child(2) {
    animation: fade-in-up 0.28s ease 0.13s both;
}

.modal.show .modal-section:nth-child(3) {
    animation: fade-in-up 0.28s ease 0.19s both;
}

.modal.show .modal-section:nth-child(4) {
    animation: fade-in-up 0.28s ease 0.24s both;
}

.modal.show .modal-actions {
    animation: fade-in-up 0.28s ease 0.22s both;
}

/* ================================================
   Passcode Dots Pop on Fill
   ================================================ */
.passcode-dot.filled {
    animation: pop-in 0.2s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

/* ================================================
   Notification Badge Pop
   ================================================ */
.notif-badge:not(.hidden) {
    animation: badge-pop 0.38s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.notif-badge.badge-updated {
    animation: badge-pop 0.38s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

/* ================================================
   User Info Card — avatar hover
   ================================================ */
.user-avatar {
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.user-info-card:hover .user-avatar {
    transform: scale(1.1) rotate(-5deg);
}

/* ================================================
   Empty State Entrance
   ================================================ */
.empty-state:not(.hidden) {
    animation: scale-in 0.36s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.empty-state:not(.hidden) .empty-icon {
    animation: fade-in-up 0.32s ease 0.1s both;
}

.empty-state:not(.hidden) h3 {
    animation: fade-in-up 0.32s ease 0.17s both;
}

.empty-state:not(.hidden) p {
    animation: fade-in-up 0.32s ease 0.23s both;
}

/* ================================================
   Status Message Appear
   ================================================ */
.status-message:not(:empty) {
    animation: fade-in-down 0.2s ease both;
}

/* ================================================
   Notification Drawer Item Entrance (JS-driven)
   ================================================ */
.notif-item-enter {
    animation: slide-in-right 0.26s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* ================================================
   Submit Button — pulse while loading
   ================================================ */
.btn-primary:not(:disabled):active,
.btn-success:not(:disabled):active,
.btn-warning:not(:disabled):active,
.btn-danger:not(:disabled):active {
    transform: scale(0.97);
}

/* ================================================
   Reduced Motion
   ================================================ */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration:        0.01ms !important;
        animation-iteration-count: 1      !important;
        transition-duration:       0.01ms !important;
    }
}