/*!
 * eModal v1.0.0
 *
 * Copyright 2026 Spoob.ru
 */

.emodal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(0, 0, 0, 0);
    transition: background-color .2s ease;
    -webkit-tap-highlight-color: transparent;
    overscroll-behavior: contain;
}
.emodal.emodal--visible { background: rgba(0, 0, 0, .5); }

.emodal__dialog {
    background: #fff;
    border-radius: 12px;
    width: 100%;
    max-width: 480px;
    max-height: calc(100dvh - 32px);
    display: flex;
    flex-direction: column;
    transform: translateY(20px);
    opacity: 0;
    transition: transform .2s ease, opacity .2s ease;
    box-shadow: 0 20px 60px rgba(0,0,0,.25);
    will-change: transform, opacity;
}
.emodal.emodal--visible .emodal__dialog { transform: translateY(0); opacity: 1; }

.emodal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #eee;
    flex: 0 0 auto;
}
.emodal__title { margin: 0; font-size: 18px; }

.emodal__close {
    background: none;
    border: 0;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    padding: 4px 8px;
    color: #666;
}

.emodal__content {
    padding: 20px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    flex: 1 1 auto;
}

@media (max-width: 600px) {
    .emodal { padding: 0; align-items: flex-end; }
    .emodal__dialog {
        max-width: 100%;
        border-radius: 16px 16px 0 0;
        max-height: 90dvh;
    }
}

.emodal__lock {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px 0;
    border-top: 1px solid #eee;
    font-size: 14px;
    color: #666;
    transition: opacity .25s ease;
    justify-content: center;
}
.emodal__lock--done { opacity: 0; }

.emodal__lock-ring {
    --p: 0;               /* прогресс 0..1 */
    --size: 36px;
    width: var(--size);
    height: var(--size);
    border-radius: 50%;
    display: grid;
    place-items: center;
    background:
            conic-gradient(#3b82f6 calc(var(--p) * 360deg), #e5e7eb 0);
    position: relative;
}
.emodal__lock-ring::before {
    content: "";
    position: absolute;
    inset: 4px;
    border-radius: 50%;
    background: #fff;
}
.emodal__lock-num {
    position: relative;
    font-size: 13px;
    font-weight: 600;
    color: #111;
    font-variant-numeric: tabular-nums;
}

/* Заблокированная кнопка закрытия выглядит неактивной */
[data-emodal-close][disabled] {
    opacity: .4;
    cursor: not-allowed;
}