:root {
    /* Цветовая палитра */
    --sidebar-bg: #0044cc;
    --blue-primary: #0055ff;
    --blue-secondary: #00c6ff;
    --pink-primary: #ff007a;
    --pink-secondary: #ff416c;
    --purple-primary: #8a2be2;
    --purple-secondary: #4b0082;
    --yellow-primary: #f7971e;
    --yellow-secondary: #ffd200;
    --text-dark: #1a1a2e;
    --text-light: #666;
    --white: #ffffff;
    
    /* Сетка */
    --sidebar-width: 18%;
    --main-width: 82%;
    --footer-height: 8vh;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
    user-select: none; /* Запрет выделения текста на киоске */
    touch-action: manipulation;
}

html, body {
    height: 100vh;
    width: 100vw;
    overflow: hidden;
    font-family: 'Segoe UI', Arial, sans-serif;
    background-image: url('/corner/templates/img/background2.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* ОСНОВНАЯ СЕТКА ТЕРМИНАЛА */
.kiosk-layout {
    display: grid;
    grid-template-columns: var(--sidebar-width) var(--main-width);
    height: 100vh;
    width: 100vw;
}

/* ЛЕВАЯ ПАНЕЛЬ НАВИГАЦИИ */
.kiosk-sidebar {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1.5vh 0;
    position: relative;
    background: transparent;
    z-index: 10;
}

.nav-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    height: 70vh;
    justify-content: flex-start;
    padding-top: 2vh;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 75%;
    margin-bottom: 1.2vh;
    cursor: pointer;
    transition: all 0.25s ease;
    padding: 2.5vh 1.8vh;
    border-radius: 1.5vh;
}

.nav-item:hover, .nav-item.active {
    background: rgba(255, 255, 255, 0.15);
    transform: scale(1.03);
}

.nav-icon {
    width: 7vh;
    height: 7vh;
    margin-bottom: 0.7vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    image-rendering: pixelated;
}

.nav-label {
    color: var(--white);
    font-size: 1vh;
    font-weight: 800;
    text-align: center;
    text-transform: uppercase;
    line-height: 1.2;
    letter-spacing: 0.05vh;
}

/* ОСНОВНАЯ ОБЛАСТЬ КОНТЕНТА */
.main-area {
    display: flex;
    flex-direction: column;
    height: 100vh;
    position: relative;
}

/* ШАПКА КОНТЕНТА */
.content-header {
    padding: 1vh 2.5vh 1vh 2.5vh;
    flex-shrink: 0;
    background-image: url('/corner/templates/img/main-background2.png');
    background-size: cover;
    background-position: top;
    z-index: 5;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1vh;
}

.ministry-block {
    display: flex;
    align-items: center;
    gap: 1vh;
}

.ministry-logo {
    width: 5vh;
    height: 5vh;
    object-fit: contain;
}

.ministry-text {
    font-size: 1.3vh;
    color: var(--text-dark);
    font-weight: 600;
    line-height: 1.3;
}

.avatar-block {
    display: flex;
    align-items: center;
}

.avatar-container {
    position: relative;
    display: flex;
    align-items: center;
    gap: 1.5vh;
    min-width: 20vw;
}

.avatar-photo {
    width: 5vh;
    height: 5vh;
    border-radius: 50%;
    object-fit: cover;
    border: 0.3vh solid var(--white);
    box-shadow: 0 0.2vh 0.8vh rgba(0,0,0,0.15);
}

.avatar-label {
    background: var(--yellow-primary);
    padding: 0.6vh 1.2vh;
    border-radius: 0.8vh;
    font-size: 0.7vh;
    font-weight: 700;
    color: var(--text-dark);
    line-height: 1.3;
    box-shadow: 0 0.2vh 0.6vh rgba(0,0,0,0.15);
    text-align: center;
    min-width: 20vw;
}

.main-title-block {
    margin-top: 1vh;
}

.main-title {
    font-size: 4.2vh;
    font-weight: 900;
    color: var(--blue-primary);
    line-height: 1.1;
    margin: 0;
    letter-spacing: -0.1vh;
}

.subtitle {
    font-size: 2vh;
    font-weight: 700;
    color: var(--pink-primary);
    margin-top: 0.5vh;
    letter-spacing: 0.05vh;
}

/* СКРОЛЛИРУЕМЫЙ КОНТЕНТ */
main.kiosk-content {
    flex: 1;
    overflow-y: auto;
    padding: 1.5vh 2.5vh;
    scrollbar-width: none;
    -ms-overflow-style: none;
    background-image: url('/corner/templates/img/main-background.png');
    background-size: cover;
    background-position: center;
    border-radius: 0 0 0 25px;
}

main.kiosk-content::-webkit-scrollbar {
    display: none;
}

/* ФУТЕР (НИЖНЯЯ ПАНЕЛЬ) */
.kiosk-footer {
    height: var(--footer-height);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    padding: 0 2.5vh;
    background: transparent;
    z-index: 5;
}

.footer-content {
    display: flex;
    align-items: center;
    gap: 1.5vh;
    width: 100%;
}

.qr-block {
    width: 6vh;
    height: 6vh;
    border-radius: 0.8vh;
    padding: 0.4vh;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0.2vh 0.8vh rgba(0,0,0,0.1);
    margin-left: -1.5vw;
}

.qr-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    margin-top: 0vh;
}

.footer-text-block {
    flex: 1;
    margin-left: 1vh;
}

.footer-text {
    font-size: 1vh;
    font-weight: 650;
    color: #defeff;
    line-height: 1.3;
    margin-bottom: 0.4vh;
}

.footer-link {
    font-size: 1.3vh;
    font-weight: 900;
    color: #8bcdfc;
    letter-spacing: 0.03vh;
}

.footer-decor {
    display: flex;
    gap: 1vh;
    align-items: flex-end;
}

.decor-item {
    height: 5vh;
    object-fit: contain;
    image-rendering: pixelated;
}

/* ============================================
   ВИРТУАЛЬНАЯ КЛАВИАТУРА (Глобальные стили)
   ============================================ */
.virtual-keyboard {
    background: white;
    border-top: 2px solid var(--pink-primary);
    border-radius: 1.5vh 1.5vh 0 0;
    padding: 0.8vh 1vh 1vh;
    display: none;
    flex-direction: column;
    gap: 0.6vh;
    box-shadow: 0 -0.3vh 1.5vh rgba(0,0,0,0.1);
    flex-shrink: 0;
    user-select: none;
    z-index: 100;
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
}

.virtual-keyboard.active {
    display: flex;
}

.keyboard-row {
    display: flex;
    justify-content: center;
    gap: 0.4vh;
    width: 100%;
    flex-wrap: wrap;
}

.key {
    background: linear-gradient(135deg, #f8f9ff, #e8eeff);
    border: 1px solid #c5d1ed;
    border-radius: 0.7vh;
    color: var(--text-dark);
    font-size: 1.4vh;
    font-weight: 600;
    padding: 1vh 1.2vh;
    min-width: 3.5vh;
    height: 4.2vh;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: all 0.1s ease;
    box-shadow: 0 0.2vh 0.5vh rgba(0,0,0,0.08);
}

.key:active, .key.pressed {
    background: linear-gradient(135deg, var(--pink-primary), var(--pink-secondary));
    color: white;
    transform: translateY(0.15vh);
    box-shadow: 0 0.1vh 0.3vh rgba(0,0,0,0.1);
}

.key.function {
    background: linear-gradient(135deg, #e8eeff, #d4e0ff);
    color: var(--blue-primary);
}

.key.enter {
    background: linear-gradient(135deg, var(--blue-primary), var(--blue-secondary));
    color: white;
}

.key.backspace {
    background: linear-gradient(135deg, #ffe0e0, #ffcdd2);
    color: #c62828;
}

.key.shift {
    background: linear-gradient(135deg, #e8d5ff, #d4b4fe);
    color: var(--purple-primary);
}

.key.shift.active {
    background: linear-gradient(135deg, var(--purple-primary), var(--purple-secondary));
    color: white;
    box-shadow: 0 0 0.8vh rgba(138, 43, 226, 0.4);
}

.key.lang {
    background: linear-gradient(135deg, #fff3cd, #ffe08a);
    color: var(--yellow-primary);
}

.key.layout-toggle {
    background: linear-gradient(135deg, #e0f7fa, #80deea);
    color: #00838f;
}

.keyboard-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 0.4vh;
    margin-bottom: 0.5vh;
}

.keyboard-close {
    background: none;
    border: none;
    color: var(--pink-primary);
    font-size: 2.2vh;
    cursor: pointer;
    padding: 0.4vh;
    border-radius: 0.7vh;
}

.keyboard-status span.active {
    color: var(--pink-primary);
    font-weight: 700;
}

/* ============================================
   МОДАЛЬНОЕ ОКНО ТАЙМЕРА БЕЗДЕЙСТВИЯ
   ============================================ */
.idle-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
}

.idle-modal {
    background: white;
    padding: 4vh;
    border-radius: 3vh;
    text-align: center;
    box-shadow: 0 1vh 3vh rgba(0,0,0,0.3);
    max-width: 60vh;
    animation: fadeIn 0.3s ease;
}

.idle-modal h2 {
    font-size: 3vh;
    color: var(--blue-primary);
    margin-bottom: 2vh;
}

.idle-modal p {
    font-size: 2vh;
    color: var(--text-dark);
    margin-bottom: 4vh;
}

.idle-modal-buttons {
    display: flex;
    gap: 2vh;
    justify-content: center;
}

.idle-btn {
    padding: 1.5vh 4vh;
    border-radius: 1.5vh;
    font-size: 2vh;
    font-weight: 700;
    cursor: pointer;
    border: none;
    transition: transform 0.2s;
}

.idle-btn.yes {
    background: var(--blue-primary);
    color: white;
}

.idle-btn.no {
    background: var(--text-light);
    color: white;
}

.idle-btn:active {
    transform: scale(0.95);
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

/* Общие элементы для страниц */
.btn {
    border: none;
    border-radius: 1.6vh;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
}
.btn:active { transform: scale(0.98); }

.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 1vh;
    padding: 1.8vh 3.5vh;
    background: var(--blue-primary);
    color: white;
    border-radius: 1.2vh;
    font-size: 1.7vh;
    font-weight: 700;
    cursor: pointer;
    margin-top: 2vh;
    transition: all 0.3s ease;
}