@font-face {
    font-family: 'CeraPro';
    src: url('{% static "fonts/CeraPro-Regular.otf" %}') format('otf');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'CeraPro';
    src: url('{% static "fonts/CeraPro-Bold.otf" %}') format('otf');
    font-weight: bold;
    font-style: normal;
}

*, *::before, *::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'CeraPro', Arial, sans-serif;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    min-height: 100dvh; /* динамическая высота для мобильных браузеров */
    background-color: #0f0403;
    background-image: radial-gradient(60% 15% at center 102%, #7a3a14 0%, #0f0403 100%);
    color: white;
    overflow-x: hidden;
    -webkit-text-size-adjust: 100%;
}

.logo {
    width: 100%;
    max-width: 1080px;
    text-align: center;
    margin-bottom: 20px;
    padding: 0 16px;
}

.logo-img {
    width: 100%;
    height: auto;
}

.logo-up {
    width: 100%;
    text-align: center;
}

.container {
    width: 100%;
    max-width: 1080px;
    text-align: center;
    margin-top: 5vh;
    margin-bottom: 15vh;
    padding: 0;
}

.overlay-section {
    position: relative;
    width: 100%;
    margin-bottom: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: transform 0.3s ease;
}

/* Размытое фоновое фото — абсолютное */
.overlay-section img.bg-blur {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 1;
    filter: brightness(100%);
    z-index: 1;
}

/* Чёткое фото — в потоке, задаёт высоту секции */
.overlay-section img.main-photo {
    position: relative;
    width: 100%;
    height: auto;
    object-fit: contain;
    z-index: 2;
}

/* Стиль для первой кнопки */
.vote-button.red-button {
    background: none;
    border: none;
    color: #ffffff;
    font-size: 48px;
    font-weight: bold;
    text-transform: uppercase;
    cursor: pointer;
    z-index: 3;
    transition: transform 0.3s ease;
    background: linear-gradient(45deg, rgba(255,255,255,1) 0%, rgba(105,105,105,1) 48%, rgba(105,105,105,1) 55%, rgba(255,255,255,1) 100%);
    background-clip: border-box;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Стиль для второй кнопки */
.vote-button.dark-button {
    background: none;
    border: none;
    color: #ffffff;
    font-size: 48px;
    font-weight: bold;
    text-transform: uppercase;
    cursor: pointer;
    z-index: 3;
    transition: transform 0.3s ease;
    background: linear-gradient(45deg, rgba(255,0,50,1) 0%, rgba(162,37,37,1) 48%, rgba(157,29,29,1) 68%, rgba(255,0,50,1) 100%);
    background-clip: border-box;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Hover-эффекты только для устройств с мышью */
@media (hover: hover) and (pointer: fine) {
    .overlay-section:hover .vote-button {
        transform: scale(1.2);
    }

    .overlay-section:hover {
        transform: scale(1.05);
    }
}

/* Эффект нажатия для тач-устройств */
.overlay-section:active {
    transform: scale(0.97);
}

.footer {
    width: 100%;
    max-width: 1080px;
    text-align: center;
    margin-top: 5px;
    padding: 0 16px;
}

.footer-img-poll {
    width: 100%;
    height: auto;
}

.logo-img-poll,
.logo-img-index,
.logo-img-thank {
    width: 100%;
    height: auto;
}

.text-center {
    text-align: center;
    padding: 0 16px;
}

.text-center h1 {
    font-size: clamp(18px, 4vw, 32px);
    line-height: 1.3;
}

/* ========== ДЕСКТОП (768px+) ========== */
@media (min-width: 768px) {
    body {
        justify-content: initial;
    }

    .logo-up {
        max-width: 65%;
        margin-top: 0;
        text-align: center;
    }

    .logo-img-index {
        max-width: 65%;
        transform: scale(1);
        margin-left: auto;
        margin-right: auto;
    }
}

/* ========== ПЛАНШЕТЫ И МОБИЛЬНЫЕ (до 768px) ========== */
@media (max-width: 768px) {
    .vote-button {
        font-size: 7vw;
    }

    .container {
        margin-top: 2vh;
        margin-bottom: 8vh;
    }

    .logo-img-poll {
        max-width: 65%;
    }

    .logo-img-index,
    .logo-img-thank {
        max-width: 100%;
        margin-left: auto;
        margin-right: auto;
    }

    .footer-img-poll {
        max-width: 75%;
    }
}

/* ========== МОБИЛЬНЫЕ ТЕЛЕФОНЫ (до 480px, портретная ориентация) ========== */
@media (max-width: 480px) {
    body {
        justify-content: flex-start;
    }

    .vote-button {
        font-size: 6vw;
    }

    .container {
        margin-top: 0;
        margin-bottom: 4vh;
    }

    .overlay-section {
        /* Убираем десктопные отступы — фото на всю ширину */
        margin-bottom: 0;
    }

    .logo-up {
        max-width: 100%;
        margin-top: 0;
        padding: 0;
    }

    .logo-img-poll {
        max-width: 60%;
    }

    .logo-img-index,
    .logo-img-thank {
        max-width: 100%;
        margin-left: auto;
        margin-right: auto;
    }

    .footer-img-poll {
        max-width: 65%;
    }

    .footer {
        padding: 0 8px;
    }
}

/* ========== СОВСЕМ МАЛЕНЬКИЕ ЭКРАНЫ (до 360px) ========== */
@media (max-width: 360px) {
    .vote-button {
        font-size: 5.5vw;
    }

    .text-center h1 {
        font-size: 16px;
        padding: 0 8px;
    }
}

/* ========== ПОРТРЕТНАЯ ОРИЕНТАЦИЯ НА ТЕЛЕФОНАХ ========== */
@media (max-width: 480px) and (orientation: portrait) {
    .container {
        margin-top: 0;
        margin-bottom: 2vh;
    }

    /* Фото кандидатов занимают всю ширину без отступов */
    .overlay-section img.main-photo {
        width: 100%;
    }

    .thank-header {
        max-width: 100%;
    }
}
