* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Montserrat', sans-serif;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
    transition: background-color 0.3s, color 0.3s;
}

/* Темная тема (по умолчанию) */
body.dark-theme {
    background-color: #C12E2F;
}

body.dark-theme .greeting,
body.dark-theme .message,
body.dark-theme .contact-link,
body.dark-theme .lang-btn {
    color: #ffffff;
}

body.dark-theme .theme-toggle {
    background-color: #ffffff;
}

body.dark-theme .theme-toggle::after {
    background-color: #C12E2F;
    right: 2px;
    left: auto;
}

/* Светлая тема */
body.light-theme {
    background-color: #ffffff;
}

body.light-theme .greeting,
body.light-theme .message,
body.light-theme .contact-link,
body.light-theme .lang-btn {
    color: #000000;
}

body.light-theme .theme-toggle {
    background-color: #E8E8E8;
}

body.light-theme .theme-toggle::after {
    background-color: #A3A3A3;
    left: 2px;
    right: auto;
}

/* Контейнер страницы */
.page {
    position: relative;
    width: 1440px;
    min-height: 900px;
    margin: 0 auto;
}

/* Логотип */
.logo {
    position: absolute;
    top: 60px;
    left: 50%;
    transform: translateX(-50%);
    width: 143px;
    height: auto;
    z-index: 10;
}

/* Блок кнопок */
.top-right {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    z-index: 10;
}

.lang-switch {
    display: flex;
    gap: 10px;
}

.lang-btn {
    font-family: 'Montserrat', sans-serif;
    font-weight: 200;
    font-size: 20px;
    text-transform: uppercase;
    background: none;
    border: none;
    cursor: pointer;
    letter-spacing: 0.5px;
    transition: color 0.3s;
}

/* Переключатель темы */
.theme-toggle {
    width: 34px;
    height: 18px;
    border: none;
    border-radius: 18px;
    cursor: pointer;
    position: relative;
    transition: background-color 0.3s;
}

.theme-toggle::after {
    content: '';
    display: block;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    position: absolute;
    top: 2px;
    transition: left 0.3s, right 0.3s, background-color 0.3s;
}

/* Заголовок */
.greeting {
    position: absolute;
    top: 270px;
    left: 50%;
    transform: translateX(-50%);
    font-weight: 900;
    font-size: 70px;
    text-align: center;
    white-space: nowrap;
    z-index: 5;
}

/* Пояснительный текст */
.message {
    position: absolute;
    top: 395px;
    left: 50%;
    transform: translateX(-50%);
    width: 421px;
    font-weight: 400;
    font-size: 20px;
    line-height: 26px;
    text-align: center;
    margin: 0;
    z-index: 5;
}

/* Список контактов */
.contacts {
    position: absolute;
    top: 484px;
    left: 531px;
    width: 293px;
    display: flex;
    flex-direction: column;
    z-index: 5;
}

/* Каждая строка */
.contact-link {
    display: flex;
    align-items: center;
    min-height: 57px;
    height: auto;
    text-decoration: none;
    gap: 10px;
    padding: 5px 0;
    cursor: pointer;
}

/* Иконки */
.contact-link img {
    width: 24px;
    height: 24px;
    object-fit: contain;
    flex-shrink: 0;
}

/* Контейнер текста - теперь может переноситься */
.contact-text {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    font-size: 16px;
    white-space: normal;
    word-break: break-word;
    flex: 1;
}

/* Имя */
.contact-name {
    font-weight: 900;
    font-size: 24px;
    white-space: nowrap;
}

/* Метка */
.label {
    font-weight: 400;
    font-size: 16px;
    white-space: nowrap;
}

/* Данные */
.data {
    font-weight: 700;
    font-size: 16px;
    margin-left: 5px;
    white-space: nowrap;
}

/* Для телефона - специальная обработка */
.phone .label {
    white-space: nowrap;
}

.phone .data {
    margin-left: 0;
    white-space: nowrap;
}

.phone .label::after {
    content: ' ';
    white-space: pre;
}

/* Если строка телефона не помещается, позволяем перенос */
@media screen and (max-width: 360px) {
    .phone .data {
        white-space: normal;
        word-break: break-word;
        margin-left: 0;
        width: 100%;
    }
    
    .phone .contact-text {
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
    }
    
    .phone .label::after {
        content: '';
    }
}

/* ========== МОДАЛЬНОЕ ОКНО ДЛЯ QR-КОДОВ ========== */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: white;
    border-radius: 20px;
    padding: 25px;
    max-width: 350px;
    width: 90%;
    text-align: center;
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

body.dark-theme .modal-content {
    background-color: #2d2d2d;
    color: white;
}

body.light-theme .modal-content {
    background-color: white;
    color: black;
}

.close-modal {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: #aaa;
}

.close-modal:hover {
    color: #C12E2F;
}

#qrContainer {
    margin: 20px 0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
}

#qrContainer canvas, #qrContainer img {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
}

#qrSubtext {
    font-size: 14px;
    color: #666;
    margin-top: 10px;
}

body.dark-theme #qrSubtext {
    color: #aaa;
}

/* ========== АДАПТИВНОСТЬ ========== */

/* Для планшетов и маленьких ноутбуков */
@media screen and (max-width: 1440px) {
    .page {
        width: 100%;
        overflow-x: hidden;
    }
}

/* Для планшетов (горизонтальная ориентация) */
@media screen and (max-width: 1024px) {
    .greeting {
        font-size: 60px;
        top: 250px;
    }
    
    .message {
        top: 360px;
        width: 380px;
        font-size: 18px;
        line-height: 24px;
        left: 50%;
        transform: translateX(-50%);
    }
    
    .contacts {
        left: 50%;
        transform: translateX(-50%);
        width: 320px;
        top: 470px;
    }
}

/* Для планшетов (вертикальная ориентация) и больших телефонов */
@media screen and (max-width: 768px) {
    .greeting {
        font-size: 48px;
        top: 220px;
        white-space: normal;
        width: 90%;
        max-width: 600px;
    }
    
    .message {
        top: 320px;
        width: 90%;
        max-width: 421px;
        font-size: 18px;
        left: 50%;
        transform: translateX(-50%);
    }
    
    .contacts {
        top: 430px;
        width: 90%;
        max-width: 400px;
        left: 50%;
        transform: translateX(-50%);
    }
    
    .logo {
        width: 130px;
        height: auto;
        top: 40px;
    }
    
    .top-right {
        top: 15px;
        right: 15px;
        gap: 10px;
    }
    
    .lang-btn {
        font-size: 18px;
    }
    
    .contact-link {
        min-height: 50px;
    }
}

/* Для телефонов (iPhone 12 Pro и аналоги) */
@media screen and (max-width: 480px) {
    .greeting {
        font-size: 36px;
        top: 180px;
        width: 95%;
    }
    
    .message {
        top: 260px;
        font-size: 16px;
        line-height: 22px;
        width: 95%;
        max-width: 380px;
    }
    
    .contacts {
        top: 350px;
        width: 95%;
        max-width: 350px;
        left: 50%;
        transform: translateX(-50%);
    }
    
    .contact-link {
        min-height: 48px;
        gap: 8px;
    }
    
    .contact-link img {
        width: 22px;
        height: 22px;
    }
    
    .contact-name {
        font-size: 20px;
    }
    
    .contact-text {
        font-size: 14px;
    }
    
    .label, .data {
        font-size: 14px;
    }
    
    .data {
        white-space: normal;
        word-break: break-word;
    }
    
    .logo {
        width: 120px;
        height: auto;
        top: 30px;
    }
    
    .top-right {
        top: 10px;
        right: 10px;
        gap: 8px;
    }
    
    .lang-btn {
        font-size: 16px;
    }
}

/* Для маленьких телефонов */
@media screen and (max-width: 360px) {
    .greeting {
        font-size: 28px;
        top: 160px;
    }
    
    .message {
        top: 230px;
        font-size: 14px;
        line-height: 20px;
    }
    
    .contacts {
        top: 310px;
        width: 95%;
    }
    
    .contact-link {
        min-height: 44px;
    }
    
    .contact-link img {
        width: 20px;
        height: 20px;
    }
    
    .contact-name {
        font-size: 18px;
    }
    
    .label, .data {
        font-size: 12px;
    }
    
    .logo {
        width: 100px;
        top: 20px;
    }
    
    .lang-btn {
        font-size: 14px;
    }
}

/* Специально для iPhone 12 Pro и подобных */
@media screen and (min-width: 375px) and (max-width: 428px) and (min-height: 800px) {
    .greeting {
        top: 170px;
    }
    
    .message {
        top: 250px;
    }
    
    .contacts {
        top: 340px;
    }
}
