/* ===== Базовые стили ===== */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --color-frame: #1a1a1a;
    --color-frame-inner: #2a2a2a;
    --color-screen-bg: #f0f0f0;
    --color-button-bg: #ffffff;
    --color-button-border: #e0e0e0;
    --color-button-shadow: rgba(0, 0, 0, 0.08);
    --color-text: #1a1a1a;
    --color-text-light: #666;
    --color-accent: #2c3e50;
    
    /* Пропорции экрана терминала 1080x1920 */
    --screen-ratio: 1.778; /* 1920/1080 */
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* ===== Обёртка терминала ===== */
.terminal-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

/* ===== Рамка терминала ===== */
.terminal-frame {
    background: var(--color-frame);
    border-radius: 30px;
    padding: 20px;
    box-shadow: 
        0 25px 80px rgba(0, 0, 0, 0.4),
        0 10px 30px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    position: relative;
}


/* ===== Экран терминала ===== */
.terminal-screen {
    background: var(--color-screen-bg);
    border-radius: 16px;
    width: 360px;
    height: calc(360px * var(--screen-ratio));
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* ===== Шапка терминала ===== */
.terminal-header {
    background: var(--color-accent);
    color: white;
    padding: 24px 20px;
    text-align: center;
}

.terminal-logo {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.terminal-logo-text {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.terminal-logo-badge {
    background: rgba(255, 255, 255, 0.2);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 4px;
}

.terminal-subtitle {
    font-size: 0.85rem;
    opacity: 0.8;
}

/* ===== Заголовок меню ===== */
.terminal-title {
    padding: 30px 20px 20px;
    text-align: center;
}

.terminal-title h1 {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--color-text);
}

/* ===== Меню с кнопками ===== */
.terminal-menu {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 0 24px;
    overflow-y: auto;
}

/* ===== Кнопка услуги ===== */
.terminal-button {
    background: var(--color-button-bg);
    border: 1px solid var(--color-button-border);
    border-radius: 12px;
    padding: 28px 20px;
    font-family: inherit;
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--color-text);
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px var(--color-button-shadow);
    min-height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1.3;
}

.terminal-button:hover {
    background: #fafafa;
    border-color: #d0d0d0;
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.terminal-button:active {
    transform: translateY(0);
    box-shadow: 0 1px 4px var(--color-button-shadow);
    background: #f5f5f5;
}

/* ===== Футер терминала ===== */
.terminal-footer {
    padding: 20px;
    text-align: center;
    background: rgba(0, 0, 0, 0.03);
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.terminal-footer p {
    font-size: 0.85rem;
    color: var(--color-text-light);
}

/* ===== Загрузка ===== */
.terminal-loading {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    color: var(--color-text-light);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--color-button-border);
    border-top-color: var(--color-accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ===== Ошибка ===== */
.terminal-error {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    color: var(--color-text-light);
    text-align: center;
    padding: 20px;
}

.terminal-retry {
    background: var(--color-accent);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 12px 24px;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.terminal-retry:hover {
    background: #34495e;
}

/* ===== Адаптивность ===== */
@media (max-height: 700px) {
    .terminal-screen {
        width: 300px;
        height: calc(300px * var(--screen-ratio));
    }
    
    .terminal-header {
        padding: 16px;
    }
    
    .terminal-logo-text {
        font-size: 1.2rem;
    }
    
    .terminal-title {
        padding: 20px 16px 12px;
    }
    
    .terminal-title h1 {
        font-size: 1.2rem;
    }
    
    .terminal-menu {
        gap: 12px;
        padding: 0 16px;
    }
    
    .terminal-button {
        padding: 20px 16px;
        font-size: 1rem;
        min-height: 70px;
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px;
    }
    
    .terminal-frame {
        padding: 12px;
        border-radius: 20px;
    }
    
    .terminal-screen {
        width: 100%;
        max-width: 320px;
        height: calc(320px * var(--screen-ratio));
        max-height: 90vh;
        border-radius: 12px;
    }
}

/* ===== Модальное окно талона ===== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal--visible {
    opacity: 1;
    visibility: visible;
}

.modal__backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.modal__content {
    position: relative;
    background: white;
    border-radius: 20px;
    padding: 40px 32px;
    text-align: center;
    max-width: 340px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: scale(0.9) translateY(20px);
    transition: transform 0.3s ease;
}

.modal--visible .modal__content {
    transform: scale(1) translateY(0);
}

.modal__header {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--color-text-light);
    margin-bottom: 16px;
}

.modal__number {
    font-size: 4rem;
    font-weight: 700;
    color: var(--color-accent);
    line-height: 1;
    margin-bottom: 16px;
    letter-spacing: 2px;
}

.modal__service {
    font-size: 1rem;
    color: var(--color-text);
    margin-bottom: 20px;
    padding: 0 10px;
    line-height: 1.4;
}

.modal__message {
    font-size: 0.95rem;
    color: var(--color-text-light);
    margin-bottom: 28px;
    padding: 12px;
    background: #f5f5f5;
    border-radius: 8px;
}

.modal__button {
    background: var(--color-accent);
    color: white;
    border: none;
    border-radius: 10px;
    padding: 16px 48px;
    font-family: inherit;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(44, 62, 80, 0.3);
}

.modal__button:hover {
    background: #34495e;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(44, 62, 80, 0.4);
}

.modal__button:active {
    transform: translateY(0);
}

