:root {
    color-scheme: light;
}

/* Сброс базовых стилей */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    height: 100%;
}

body {
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    font-family: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow: hidden;
    
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 24px;
    
    background-image: url('bg.webp');
    background-size: cover;
    background-position: left top;
    background-repeat: no-repeat;
}

/* Контейнер главных элементов */
.card-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    gap: 20px;
}

/* Кликабельная ссылка POLBEA */
.brand-link {
    text-decoration: none;
    outline: none;
    display: inline-block;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), background 0.25s ease, opacity 0.25s ease;
    cursor: pointer;
    
    padding: 16px 28px;
    border-radius: 20px;
    background: rgba(10, 30, 15, 0.22);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
}

.brand-link:hover {
    transform: scale(1.04);
    opacity: 0.98;
    background: rgba(10, 30, 15, 0.28);
}

.brand-link:active {
    transform: scale(0.98);
}

/* Заголовок POLBEA */
.brand-name {
    font-size: clamp(44px, 9vw, 90px);
    font-weight: 700;
    letter-spacing: 0.22em;
    text-indent: 0.22em;
    text-transform: uppercase;
    color: #FFFFFF;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5), 0 8px 24px rgba(0, 0, 0, 0.35);
    user-select: none;
}

/* Кнопка Live Chat */
.download-btn {
    font-family: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 0.08em;
    color: #FFFFFF;
    
    padding: 10px 24px;
    border-radius: 12px;
    background: rgba(10, 30, 15, 0.22);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
    cursor: pointer;
    outline: none;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), background 0.25s ease, opacity 0.25s ease;
}

.download-btn:hover {
    transform: scale(1.05);
    background: rgba(10, 30, 15, 0.32);
    border-color: rgba(255, 255, 255, 0.25);
}

.download-btn:active {
    transform: scale(0.96);
}

/* Модальное окно чата */
.chat-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

/* Окно чата */
.chat-content {
    background: #f4f6f4;
    border: 1px solid #d0dad2;
    border-radius: 20px;
    padding: 24px;
    width: 90%;
    max-width: 390px;
    position: relative;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    gap: 14px;
    color: #0f2b15;
}

/* Крестик закрытия */
.chat-close {
    position: absolute;
    top: 14px;
    right: 18px;
    font-size: 26px;
    color: #4a5d50;
    cursor: pointer;
    transition: color 0.2s;
}

.chat-close:hover {
    color: #0f2b15;
}

/* Заголовок Live Chat (увеличен до 22px) */
.chat-title {
    font-size: 22px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 2px;
    color: #0f2b15;
}

/* Контейнер сообщений */
.chat-messages {
    max-height: 200px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 4px;
}

/* Пузыри сообщений (размер увеличен до 16px) */
.chat-bubble {
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 16px;
    line-height: 1.35;
    max-width: 85%;
    word-break: break-word;
}

.chat-bubble.admin {
    background: #e2e8e3;
    color: #1a2e1e;
    border: 1px solid #cbd6cd;
    align-self: flex-start;
}

.chat-bubble.user {
    background: #1e4620;
    color: #ffffff;
    align-self: flex-end;
}

.chat-bubble.system {
    background: #fde8e8;
    color: #c53030;
    border: 1px solid #f8b4b4;
    align-self: center;
    font-size: 13px;
}

#chatForm {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    width: 100%;
}

/* Поля ввода (размер шрифта 16px против автозума iOS) */
.chat-input, .chat-textarea {
    width: 100%;
    background: #ffffff;
    border: 1.5px solid #bccac0;
    border-radius: 10px;
    padding: 11px 14px;
    color: #0f2b15;
    font-family: inherit;
    font-size: 16px;
    outline: none;
    transition: all 0.2s ease;
}

.chat-input:focus, .chat-textarea:focus {
    border-color: #1e4620;
    box-shadow: 0 0 0 3px rgba(30, 70, 32, 0.15);
}

.chat-input::placeholder, .chat-textarea::placeholder {
    color: #6b7f71;
}

.chat-textarea {
    resize: none;
    height: 75px;
}

/* Кнопка Send (строго по центру) */
.chat-submit-btn {
    width: auto;
    min-width: 130px;
    padding: 10px 24px;
    align-self: center;
    background: #23272a;
    color: #ffffff;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 0.03em;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    transition: transform 0.2s, background 0.2s;
}

.chat-submit-btn:hover {
    background: #000000;
    transform: translateY(-1px);
}

.chat-submit-btn:active {
    transform: translateY(0);
}

/* Круглая кнопка скачивания (строго в правом нижнем углу окна) */
.download-circle-btn {
    position: absolute;
    right: 18px;
    bottom: 18px;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #23272a;
    color: #ffffff;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s, background 0.2s;
    outline: none;
}

.download-circle-btn:hover {
    background: #000000;
    transform: scale(1.08);
}

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

.chat-status {
    font-size: 13px;
    text-align: center;
    color: #4a5d50;
}