body, html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: #7851A9;
    font-family: Arial, sans-serif;
}

.container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

/* Фон */
.background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 1s ease;
}

.frosted-glass {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    backdrop-filter: blur(5px);
    background-color: rgba(120, 81, 169, 0.1);
    z-index: 10;
}

/* Загрузчик */
.loader-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 100;
    transition: opacity 1s ease;
    background-color: #7851A9;
}

.heart {
    width: 102px;
    height: 102px;
    position: relative;
    margin-bottom: 20px;
    animation: heartbeat 1.2s infinite ease-in-out;
}

.heart-img {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 0 10px rgba(92, 1, 1, 0.7));
}

.loader-container {
    width: 150px;
    height: 10px;
    background-color: #360101;
    border-radius: 5px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 0 5px rgba(92, 1, 1, 0.5);
}

.loader-bar {
    height: 100%;
    width: 0%;
    background-color: #FFAAFF;
    position: absolute;
    border-radius: 5px;
    animation: loading 3s linear forwards;
    box-shadow: 0 0 8px rgba(92, 1, 1, 0.8);
}

@keyframes heartbeat {
    0% { transform: scale(1); }
    15% { transform: scale(1.12); }
    30% { transform: scale(1); }
    45% { transform: scale(1.09); }
    60% { transform: scale(1); }
}

@keyframes loading {
    0% { width: 0%; }
    100% { width: 100%; }
}

/* Текстовый бокс */
.message-box {
    position: relative;
    background-color: rgba(120, 81, 169, 0.1);
    border: 2px solid #FFAAFF;
    border-radius: 10px;
    padding: 20px;
    max-width: 80%;
    width: auto;
    min-width: 250px;
    max-height: 50vh; 
    overflow-y: auto;  
    box-shadow: 0 0 15px rgba(120, 81, 169, 0.3);
    margin-bottom: 30px;
    z-index: 20;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.message-box p {
    color: #FFAAFF;
    font-size: 18px; 
    line-height: 1.5;
    margin: 0;
    text-align: center;
    text-shadow: 0 0 8px rgba(120, 81, 169, 0.3);
}

.message-box.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Кнопки */
.button-container {
    display: flex;
    justify-content: center;
    gap: 20px;
    z-index: 20;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.button-container.visible {
    opacity: 1;
    transform: translateY(0);
}

.fancy-button {
    display: inline-block;
    padding: 15px 30px;
    font-size: 18px;
    font-weight: bold;
    color: #FFAAFF;
    background-color: rgba(120, 81, 169, 0.1);
    border: 2px solid #FFAAFF;
    border-radius: 8px;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 2px;
    transition: all 0.3s ease;
    box-shadow: 0 0 10px rgba(120, 81, 169, 0.3);
    position: relative;
    overflow: hidden;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    -webkit-touch-callout: none;
    outline: none;
}

.fancy-button:hover {
    background-color: #FFAAFF;
    color: rgba(255, 255, 255, 0.9);
    box-shadow: 0 0 20px rgba(120, 81, 169, 0.5);
    transform: translateY(-2px);
}

.fancy-button:active {
    transform: translateY(1px);
}

/* Слайды */
.slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
    z-index: 20;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.8s ease;
}

.slide.active {
    opacity: 1;
    pointer-events: auto;
}

/* Обратный отсчет */
.countdown {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 30;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
}

.countdown.active {
    opacity: 1;
    pointer-events: auto;
}

/*отображает обратный отсчёт */
.countdown-number {
    color: #FFAAFF;
    font-size: 120px;
    font-weight: bold;
    text-shadow: 0 0 20px rgba(120, 81, 169, 0.7);
    transition: opacity 0.3s ease-in-out, transform 0.3s ease-in-out;
}

/* Изображение (Общие стили) */
.img-container {
    margin-bottom: 20px;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease, transform 0.8s ease;
    width: auto; 
    max-width: 90%; 
    margin-left: auto;
    margin-right: auto;
}

.img-container.visible {
    opacity: 1;
    transform: translateY(0);
}

.img-container img {
    display: block;
    max-width: 100%; 
    max-height: 300px; 
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 10px;
    box-shadow: 0 0 15px rgba(120, 81, 169, 0.6);
}

/* === START: Specific styles for slide-8-yes img and layout === */
#slide-8-yes .img-container {
    margin-bottom: 20px; 
    width: auto; 
    max-width: 90vw; 
}

#slide-8-yes .img-container img {
    max-height: 60vh; 
}

#slide-8-yes .message-box {
    margin-top: 0; 
    max-height: 25vh; 
}
/* === END: Specific styles for slide-8-yes img and layout === */

/* Адаптивность */
@media (max-width: 768px) {
    .message-box {
        padding: 15px;
        max-width: 90%;
        min-width: 200px;
    }
    
    .countdown-number {
        font-size: 80px;
    }
    
    .img-container img { 
        max-height: 250px;
    }
     #slide-8-yes .img-container img { 
        max-height: 55vh;
    }

    .date-form {
        padding: 0 15px;
    }
    
    .date-input-wrapper {
        width: 100%;
        max-width: none;
    }
    
    .date-input-visual {
        padding: 15px 20px;
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .message-box p {
        font-size: 16px;
    }
    
    .countdown-number {
        font-size: 60px;
    }
    
    .img-container img { 
        max-height: 200px;
    }
     #slide-8-yes .img-container img { 
        max-height: 50vh;
    }
    #slide-8-yes .message-box {
         max-height: 30vh;
    }
    
    .button-container {
        flex-direction: column;
        gap: 15px;
    }

    .date-form {
        padding: 0 15px;
    }
    
    .date-input-wrapper {
        width: 100%;
        max-width: none;
    }
    
    .date-input-visual {
        padding: 15px 20px;
        font-size: 16px;
    }
}

.date-form {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    width: 100%;
    padding: 0 20px;
    box-sizing: border-box;
}

.date-input-wrapper {
    position: relative;
    width: 100%;
    max-width: 300px;
    min-height: 54px;
    margin: 0 auto;
}

/* Полное скрытие нативного input */
.date-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 2; /* Поверх визуального элемента */
}

/* Визуальное представление кнопки */
.date-input-visual {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 15px 30px;
    font-size: 18px;
    font-weight: bold;
    color: #FFAAFF;
    background-color: rgba(120, 81, 169, 0.1);
    border: 2px solid #FFAAFF;
    border-radius: 8px;
    text-transform: uppercase;
    letter-spacing: 2px;
    box-shadow: 0 0 10px rgba(120, 81, 169, 0.3);
    transition: all 0.3s ease;
    min-height: 100%;
    box-sizing: border-box;
    position: relative;
    z-index: 1;
}

/* Состояния как у fancy-button */
.date-input:hover + .date-input-visual,
.date-input:focus + .date-input-visual {
    background-color: #FFAAFF;
    color: rgba(255, 255, 255, 0.9);
    box-shadow: 0 0 20px rgba(120, 81, 169, 0.5);
    transform: translateY(-2px);
}

.date-input:active + .date-input-visual {
    transform: translateY(1px);
}

/* Псевдоэлемент для текста */
.date-input-visual::before {
    content: "ДД.ММ.ГГГГ";
}

.date-input:valid + .date-input-visual::before {
    content: attr(data-date);
}