*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    width: 100%;
    min-height: 100vh;
    font-family: 'PT Sans', 'Open Sans', system-ui, sans-serif;
}
.head-logo.head-text {
  letter-spacing: 1px;
  font-size: 1.8rem;
  line-height: 1;
  font-weight: 400;
  white-space: nowrap; 
  font-family: 'Open Sans',sans-serif;
  text-decoration: none;
  margin: 0;
  
}
/* Стиль для динамического подзаголовка в шапке */
#headerSubtitle {
    color: #000000 !important;
    font-family: 'Open Sans', sans-serif;
    font-size: inherit;
    font-weight: 400;
}
/* Кнопки в шапке — жирный белый текст, плавное затемнение фона при наведении */
.header-btn-primary {
    font-weight: 700 !important;          /* жирнее */
    letter-spacing: 0.3px;
    transition: background-color 0.2s ease, opacity 0.2s ease;
}

.header-btn-primary:hover {
    background-color: #044794 !important; /* чуть светлее, чем #00386e */
    color: #ffffff !important;            /* текст остаётся белым */
    opacity: 0.95;
}

/* Иконка домика внутри кнопки */
.lk-icon-svg {
    width: 18px;
    height: 18px;
    display: inline-block;
    vertical-align: middle;
    margin-right: 6px;
    fill: none;
    stroke: #ffffff;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}
@media (max-width: 800px) {
    .head-logo.head-text {
        display: none;
    }
}
@media (max-width: 1100px) {
    .head-logo.head-text.earlyhide {
        display: none;
    }
}
.accent {
    color: #00386e; /* Тёмно-синий */
}
.accent2 {
    color: #000000; 
}
.background-site {
    min-height: calc(100vh - 200px);
      padding: 60px 20px;
      background-image: linear-gradient(to bottom, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0)), url('images/4_traced.png');
      background-position: 50% 50%;
      background-repeat: no-repeat;
      background-size: cover;
}
.site-header {
    position: sticky;
    top: 0;
    z-index: 500;
    background: #ffffff;
    color: #000000 !important;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;           /* единый отступ */
    flex-wrap: nowrap;
    max-width: 1300px;
    margin: 0 auto;
    box-sizing: border-box;
    width: 100%;
    border-bottom: 2px dashed #d1d5db;
    min-height: 60px;          /* как в ЛК */
}
.header-left { display: flex; align-items: center; gap: 16px;line-height: 1; }
.header-right { display: flex; align-items: center; gap: 16px;line-height: 1; }
.logo { height: 48px; width: auto; display: block;padding-top: 10px 0px;
padding-bottom: 10px 10px;}

.profile-dropdown { position: relative; }

.user-avatar {
    cursor: pointer;
    background: #0659b8;
    color: #fff;
    width: 36px; height: 36px;
    border-radius: 50%;
    border: none;
    display: flex; align-items: center; justify-content: center;
    font-size: 14px; font-weight: 600;
    padding: 0;
    transition: opacity 0.15s;
}
.user-avatar:hover { opacity: 0.85; }

.dropdown-menu {
    position: absolute;
    top: 120%; right: 0;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    min-width: 150px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.2s ease;
    z-index: 1001;
    overflow: hidden;
}

.dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: block;
    padding: 10px 14px;
    width: 100%;
    color: #333;
    text-decoration: none;
    font-size: 14px;
    transition: background 0.15s;
    border: none;
    background: none;
    cursor: pointer;
}
.dropdown-item:hover { background: #f3f4f6; }
.dropdown-item.logout-link {
    color: #dc2626;
    border: none;
    background: none;
    cursor: pointer;
}
.dropdown-item.dropdown-item.logout-link:hover { background: #f3f4f6; }
.header-btn-primary {
    background-color: #00386e; 
    color: #ffffff;            
    border: none;
    padding: 10px 20px;       /* ИСПРАВЛЕНО: нормальные отступы */
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border-radius: 2px;       /* Чуть скруглили для красоты */
    transition: background-color 0.2s;
    white-space: nowrap;
    font-family: 'Open Sans',sans-serif; 
}

.header-btn-primary:hover {
    background-color: #044794; /* Темнее при наведении */
}

a {
    text-decoration: none;
}
.heading-text {
    font-size: 50px;
    font-weight: 500;
    display: inline-block;
    margin: 30px 0;
}
.heading-text2 {
    font-size: 30px;
    font-weight: 500;
    display: inline-block;
    margin: 20px 0;
}

.heading-text-hard {
    font-size: 30px;
    font-weight: 500;
    display: inline-block;
    margin: 20px 0;
    padding-bottom: 50px;
}
@media (min-width: 800px) {
    .heading-text {
        display: none;
    }
    
}
@media (min-width: 1100px) {
    
    .heading-text2 {
        display: none;
    }
}

.site-footer {
    background-color: rgb(0, 56, 110);
    color: #ffffff;
    text-align: center;
    padding: 28px 20px;
    font-family: 'PT Sans', 'Open Sans', system-ui, sans-serif;
    font-size: 14px;
    line-height: 1.6;
}
.site-footer p { margin: 0; }

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}
.site-footer { margin-top: auto; }

.privacy-box { text-align: left !important; max-width: 700px; padding: 40px; }
.privacy-box h1 { margin-bottom: 24px; }
.privacy-box h2 { margin-top: 24px; margin-bottom: 12px; font-size: 1.2rem; }
.privacy-box ul { margin-left: 20px; margin-bottom: 16px; }
.privacy-box p { margin-bottom: 12px; line-height: 1.6; }
.text-muted { font-size: 0.85rem; color: #6b7280; }

.privacy-box h2 {
    text-align: center;
    margin-bottom: 24px;
}

/* ===== МОДАЛЬНЫЕ ОКНА ===== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(3px);
}
.modal-content {
    background: #fff;
    max-width: 560px;
    width: 90%;
    padding: 28px;
    border-radius: 20px;
    position: relative;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 35px rgba(0,0,0,0.2);
    font-family: 'Open Sans', sans-serif;
    line-height: 1.5;
}
.modal-content h3 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #00386e;
    font-size: 1.6rem;
}
.modal-content p {
    margin-bottom: 12px;
    color: #1e293b;
}
.modal-close {
    position: absolute;
    top: 12px;
    right: 18px;
    font-size: 28px;
    font-weight: 300;
    cursor: pointer;
    color: #64748b;
    transition: color 0.2s;
}
.modal-close:hover {
    color: #00386e;
}

/* Разделители дат в чате */
.chat-date-separator {
    text-align: center;
    margin: 12px 0;
    position: relative;
    color: #94a3b8;
    font-size: 12px;
}
.chat-date-separator span {
    background: #f8fafc; /* Цвет фона должен совпадать с фоном списка сообщений */
    padding: 0 10px;
    position: relative;
    z-index: 1;
}
.chat-date-separator::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 10%;
    right: 10%;
    height: 1px;
    background: #e2e8f0;
    z-index: 0;
}

/* Системные плашки звонков */
.chat-call-banner {
    text-align: center;
    margin: 8px auto;
    padding: 6px 12px;
    background: #f1f5f9;
    border-radius: 12px;
    color: #64748b;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 80%;
    width: fit-content;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

/* ===== COOKIE БАННЕР ===== */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #1e293b;
    color: #fff;
    padding: 14px 20px;
    text-align: center;
    z-index: 10000;
    font-size: 14px;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 12px;
}
.cookie-banner a {
    color: #fff;
    text-decoration: underline;
}
.cookie-banner button {
    background: none;
    border: 1px solid #fff;
    color: #fff;
    padding: 6px 18px;
    border-radius: 40px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
}
.cookie-banner button:hover {
    background: #fff;
    color: #1e293b;
}

/* ===== Видеозвонки ===== */
.call-modal, .call-incoming-modal {
    user-select: none;
}
.call-modal video {
    background: #000;
    object-fit: cover;
}
.call-modal-header button {
    background: none;
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
    line-height: 1;
}
.call-controls button {
    transition: transform 0.1s;
}
.call-controls button:hover {
    transform: scale(1.05);
}

/* ===== ВИДЕОЗВОНКИ (CALL.JS) ===== */

.outgoing-view {
    justify-content: space-between;
}
.outgoing-status {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    font-size: 14px;
}
.call-active-container, .call-outgoing-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 640px; /* Увеличили в 2 раза */
    height: 480px; /* Увеличили в 2 раза */
    background: #1e293b;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
    z-index: 10001;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.call-active-container {
    min-width: 400px;
    min-height: 300px;
}

.call-video-wrapper {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: #000;
    overflow: hidden;
}

#callRemoteVideo {
    width: 100%;
    height: 100%;
    object-fit: contain; /* Десктоп: черные поля, без обрезки */
    background: #000;
}

.call-avatar-bg {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content:center;
    background:#1e293b;
}
.call-avatar-img { width: 150px; height: 150px; border-radius: 50%; object-fit: cover; }
.call-avatar-placeholder { width: 150px; height: 150px; border-radius: 50%; background: #334155; color: #fff; display: flex; align-items: center; justify-content: center; font-size: 48px; }

.call-local-pip {
    position: absolute;
    top: 45px; /* Сдвинули под плашку */
    right: 10px;
    width: 100px;
    height: 140px;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid #fff;
    z-index: 20;
    background: #000;
    cursor: grab;
}

#callLocalVideo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scaleX(-1);
}

.call-remote-mic-wrap {
    position: absolute;
    top: 45px; /* Сдвинули под плашку */
    left: 10px;
    background: rgba(0,0,0,0.5);
    padding: 4px;
    border-radius: 50%;
    z-index: 10;
}

.call-full-view {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    z-index: 15;
}

.call-header {
    padding: 8px 12px;
    background: rgba(15, 23, 42, 0.8);
    color: #fff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    cursor: grab;
    user-select: none;
}

.call-timer { color: #94a3b8; font-size: 12px; }

.call-controls {
    padding: 10px;
    background: rgba(15, 23, 42, 0.8);
    display: flex;
    justify-content: center;
    gap: 12px;
}

.call-ctrl-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: #334155;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.1s, background 0.2s;
}
.call-ctrl-btn:hover { transform: scale(1.05); }
.call-ctrl-btn.active-off { background: #ef4444; }
.call-ctrl-end { background: #ef4444; }
.call-ctrl-end:hover { background: #dc2626; }

/* Свернутый вид (мобилки) */
.call-minimized-view {
    display: none;
    background: #1e293b;
    border-radius: 16px;
    padding: 12px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    z-index: 30;
    cursor: grab;
}
.call-active-container.minimized .call-minimized-view { display: flex; }
.call-active-container.minimized .call-full-view,
.call-active-container.minimized .call-local-pip,
.call-active-container.minimized .call-video-wrapper { display: none !important; }

/* НОВОЕ: Сбрасываем десктопные минимальные размеры для свернутой модалки */
.call-active-container.minimized {
    min-width: 0 !important;
    min-height: 0 !important;
    overflow: hidden;
}

.call-min-info { display: flex; align-items: center; gap: 10px; }
.call-min-avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; background: #334155; display:flex; align-items:center; justify-content:center; flex-shrink: 0; line-height: 1; }
.call-min-text { display: flex; flex-direction: column; color: #fff; font-size: 14px; line-height: 1.2; }
.call-min-name { font-weight: 600; max-width: 150px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.call-timer { color: #94a3b8; font-size: 12px; }

.call-min-actions { display: flex; gap: 10px; width: 100%; justify-content: center; }
.call-min-btn {
    display: flex; align-items: center; justify-content: center; gap: 6px;
    background: #334155; color: #fff; border: none;
    padding: 6px 12px; border-radius: 20px; font-size: 12px; cursor: pointer;
}
.call-min-end { background: #ef4444; }

/* Ресайзеры (десктоп) */
.resizer { position: absolute; z-index: 40; }
.resizer-n { top: -3px; left: 0; right: 0; height: 6px; cursor: ns-resize; }
.resizer-s { bottom: -3px; left: 0; right: 0; height: 6px; cursor: ns-resize; }
.resizer-e { right: -3px; top: 0; bottom: 0; width: 6px; cursor: ew-resize; }
.resizer-w { left: -3px; top: 0; bottom: 0; width: 6px; cursor: ew-resize; }
.resizer-ne { top: -3px; right: -3px; width: 10px; height: 10px; cursor: nesw-resize; }
.resizer-nw { top: -3px; left: -3px; width: 10px; height: 10px; cursor: nwse-resize; }
.resizer-se { bottom: -3px; right: -3px; width: 10px; height: 10px; cursor: nwse-resize; }
.resizer-sw { bottom: -3px; left: -3px; width: 10px; height: 10px; cursor: nesw-resize; }

/* Входящий звонок */
.call-incoming-container {
    position: fixed;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    background: #1e293b;
    border-radius: 16px;
    padding: 24px;
    z-index: 10002;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
    cursor: grab;
}
.call-incoming-btn {
    width: 50px; height: 50px;
    border-radius: 50%; border: none;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: transform 0.1s;
}
.call-incoming-btn:hover { transform: scale(1.05); }
.call-accept { background: #22c55e; color: #fff; }
.call-reject { background: #ef4444; color: #fff; }

/* Тосты */
.call-toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: #1e293b;
    color: #fff;
    padding: 10px 20px;
    border-radius: 8px;
    z-index: 10003;
    font-size: 14px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    opacity: 0;
    transition: opacity 0.3s, transform 0.3s;
}
.call-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* МОБИЛЬНЫЙ РЕЖИМ */
@media (max-width: 768px) {
    .call-active-container:not(.minimized), .call-outgoing-container {
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: auto !important; /* ИСПРАВЛЕНО: было 100%, теперь не съезжает */
        height: 100dvh !important;
        min-width: 0 !important;
        min-height: 0 !important;
        border-radius: 0 !important;
    }
    .call-active-container.minimized {
        border-radius: 16px;
    }
    .call-local-pip {
        top: 60px;
        right: 15px;
        width: 100px;
        height: 140px;
    }
    #callRemoteVideo {
        object-fit: cover;
    }
    .call-controls {
        position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
        padding-bottom: max(15px, env(safe-area-inset-bottom));
    }
    .call-incoming-container {
        width: 90% !important;
        max-width: 320px;
        left: 50% !important;
        transform: translate(-50%, -50%) !important;
    }
}