body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #dbeaff; /* Обновленный светло-голубой фон */
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    overflow: hidden;
    touch-action: none; /* Запрет стандартного скролла */
}

.screen {
    display: none;
    width: 100%;
    max-width: 420px;
    height: 100%;
    max-height: 900px;
    background-color: #dbeaff; /* Обновленный светло-голубой фон */
    position: relative;
    flex-direction: column;
    overflow: hidden;
    transition: transform 0.4s cubic-bezier(0.1, 1, 0.2, 1), border-radius 0.4s;
}

.screen.active {
    display: flex;
}

/* Эффект отдаления экрана при вызове шторки */
.screen.scaled {
    transform: scale(0.92) translateY(-15px);
    border-radius: 20px;
}

/* ============ ПИН-КОД ============ */
#pin-screen { padding: 40px 20px; box-sizing: border-box; }
.pin-header { text-align: center; font-size: 18px; color: #1e5c99; margin-top: 40px; margin-bottom: 40px; }
.pin-display { display: flex; justify-content: center; gap: 20px; margin-bottom: 60px; }
.dot { width: 16px; height: 16px; border: 2px solid #1e5c99; border-radius: 50%; transition: 0.1s; }
.dot.filled { background-color: #1e5c99; }

.keyboard { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; padding: 0 30px; }
.keyboard button {
    background: white; border: none; font-size: 28px; font-weight: 500;
    color: #1e5c99; width: 75px; height: 75px; border-radius: 50%;
    margin: 0 auto; cursor: pointer; box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}
.keyboard button:active { background-color: #c7dff3; transform: scale(0.95); }
.keyboard .empty { background: none; box-shadow: none; }
.keyboard .backspace { background: #1e5c99; color: white; display: flex; align-items: center; justify-content: center; }
.keyboard .backspace svg { width: 32px; height: 32px; }

.pin-footer { margin-top: auto; text-align: center; font-size: 14px; color: #555; }
.pin-footer a { color: #1e5c99; text-decoration: none; display: block; margin-top: 10px; }


/* ============ ВЕРХНЯЯ НАВИГАЦИЯ ============ */
.top-nav {
    display: flex;
    align-items: center;
    padding: 60px 20px 20px 20px; /* Отступ сверху под статус-бар */
    background: transparent;
    z-index: 10;
}
.back-icon {
    width: 28px;
    height: 28px;
    color: #1c1c1e;
    cursor: pointer;
}
.nav-title {
    font-size: 18px;
    font-weight: 500;
    color: #1c1c1e;
    margin-left: 8px;
}


/* ============ ID КАРТА (Анимация колоды) ============ */
.card-area-wrapper { flex: 1; display: flex; flex-direction: column; align-items: center; padding-top: 10px; }

.deck-container {
    position: relative;
    width: 320px;
    height: 340px; /* Подогнано под пропорции ID-карты */
    perspective: 1000px;
}

.card {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
    overflow: hidden;
    border: none;
    transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.6s, z-index 0.6s;
    will-change: transform;
}

/* Стили для вставленных изображений */
.card img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Заполняет карточку целиком без искажений */
    object-position: center; /* Центрирует фото */
    -webkit-user-drag: none; /* Чинит свайп, убирая перетаскивание браузера */
    user-select: none;
    pointer-events: none;
}

/* Заглушка, если нет картинки */
.image-placeholder {
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    color: #999; font-size: 14px; text-align: center; padding: 20px;
    box-sizing: border-box; background: #fdfdfd;
}

/* Состояния карт (Передняя и задняя) */
.card.active-card {
    transform: translateX(0) scale(1) translateY(0);
    z-index: 2; opacity: 1;
}

.card:not(.active-card) {
    transform: translateX(0) scale(0.92) translateY(18px);
    z-index: 1; opacity: 0.7;
}

/* Анимационные классы */
.card.anim-left { transform: translateX(-110%) scale(0.9) rotate(-5deg); z-index: 3; }
.card.anim-right { transform: translateX(110%) scale(0.9) rotate(5deg); z-index: 3; }


/* ============ ПАГИНАЦИЯ (Точки) ============ */
.pagination {
    display: flex;
    gap: 8px;
    margin-top: 30px;
    justify-content: center;
}
.dot-indicator {
    width: 8px;
    height: 8px;
    background-color: #02c39a;
    border-radius: 4px;
    transition: 0.3s;
}
.dot-indicator.active {
    width: 20px; /* Полоска вместо точки */
}


/* ============ НИЖНЯЯ ПАНЕЛЬ С QR ============ */
.bottom-pull-area {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 85px;
    background: #ffffff;
    border-top-left-radius: 24px;
    border-top-right-radius: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    padding-bottom: 25px;
    box-sizing: border-box;
    cursor: pointer;
    z-index: 5;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.02);
}

.qr-circle-btn {
    position: absolute;
    top: -35px; /* Кнопка выступает за пределы белого фона */
    width: 70px;
    height: 70px;
    background: #1a5bc0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.qr-circle-btn img {
    width: 44px;
    height: 44px;
    object-fit: contain;
}

.pull-text {
    font-size: 15px;
    color: #111;
    font-weight: 400;
}


/* ============ ШТОРКА (БОЛЬШОЙ QR) И ЗАТЕМНЕНИЕ ============ */
.overlay {
    position: absolute; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.4); opacity: 0; pointer-events: none;
    transition: opacity 0.4s ease; z-index: 10;
}
.overlay.visible { opacity: 1; pointer-events: all; }

.bottom-sheet {
    position: absolute; bottom: -100%; left: 0; width: 100%;
    background: white; border-top-left-radius: 25px; border-top-right-radius: 25px;
    padding: 20px; box-sizing: border-box;
    transition: bottom 0.4s cubic-bezier(0.1, 1, 0.2, 1);
    z-index: 20; text-align: center; box-shadow: 0 -5px 20px rgba(0,0,0,0.1);
}
.bottom-sheet.open { bottom: 0; }

.sheet-indicator { width: 40px; height: 5px; background: #ddd; border-radius: 3px; margin: 0 auto 20px auto; }
.qr-large {
    width: 160px; height: 160px; border: 2px solid #eef5fb;
    border-radius: 10px; margin: 0 auto 15px auto; display: flex;
    align-items: center; justify-content: center; padding: 10px;
}
.timer-text { font-size: 11px; color: #666; margin-bottom: 20px; line-height: 1.4; }
.timer-text span { color: #1e5c99; font-weight: bold; font-size: 13px; }

.sheet-content h2 { font-size: 16px; margin: 0 0 5px 0; color: #111; }
.sheet-content p { font-size: 12px; color: #666; margin-bottom: 20px; }

.credentials { display: flex; gap: 15px; text-align: left; background: #f8fbff; padding: 15px; border-radius: 12px; border: 1px solid #e2edf8; }
.cred-box { flex: 1; }
.cred-label { display: block; font-size: 11px; color: #888; margin-bottom: 3px; }
.cred-val { font-size: 14px; font-weight: bold; color: #111; }