/* Предотвращаем горизонтальную прокрутку */
html, body {
    overflow-x: hidden;
    max-width: 100vw;
}

* {
    box-sizing: border-box;
}


/* ===== СБРОС И БАЗОВЫЕ НАСТРОЙКИ ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    color: #333;
    line-height: 1.6;
    overflow-x: hidden;
    background-color: #FDFBF7;
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='103.92' viewBox='0 0 60 103.92' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M30 0 L60 17.32 L60 51.96 L30 69.28 L0 51.96 L0 17.32 Z' fill='none' stroke='%23D4AF37' stroke-width='1' opacity='0.15'/%3E%3C/svg%3E");
    background-size: 60px 104px;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 40px 20px;
    position: relative;
}

/* ===== HERO СЕКЦИЯ ===== */
.hero {
    text-align: center;
    padding: 60px 30px;
    background: #FFF;
    border: 1px solid #E0D5B8;
    border-radius: 4px;
    margin-bottom: 40px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
    position: relative;
}

.hero::before, .hero::after {
    content: "?";
    display: block;
    color: #D4AF37;
    font-size: 1.5em;
    margin: 10px 0;
}

.hero h1 {
    font-family: 'Georgia', serif;
    font-size: 3em;
    color: #222;
    margin-bottom: 10px;
    font-weight: 400;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.hero .ampersand {
    color: #D4AF37;
    font-family: 'Georgia', serif;
    font-style: italic;
}

.hero .date {
    font-size: 1.2em;
    color: #666;
    letter-spacing: 3px;
    margin-bottom: 30px;
    text-transform: uppercase;
}

.hero .main-photo {
    max-width: 200px;
    width: 100%;
    border-radius: 50%;
    border: 3px solid #D4AF37;
    margin: 20px auto;
    display: block;
    object-fit: cover;
}

/* ===== ОБРАТНЫЙ ОТСЧЁТ ===== */
.countdown {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 30px 0 0 0;
    flex-wrap: wrap;
}

.countdown-item {
    background: #FFF;
    color: #333;
    padding: 15px 20px;
    border-radius: 4px;
    min-width: 100px;
    text-align: center;
    border: 1px solid #D4AF37;
    box-shadow: none;
}

.countdown-item .number {
    font-size: 2.5em;
    font-weight: 300;
    display: block;
    line-height: 1;
    color: #D4AF37;
}

.countdown-item .label {
    font-size: 0.8em;
    text-transform: uppercase;
    margin-top: 5px;
    display: block;
    letter-spacing: 1px;
    color: #888;
}

/* ===== СЕКЦИИ ===== */
.section {
    background: #FFF;
    padding: 50px 40px;
    border-radius: 4px;
    margin-bottom: 30px;
    border: 1px solid #E0D5B8;
    position: relative;
}

.section h2 {
    font-family: 'Georgia', serif;
    color: #222;
    font-size: 2em;
    margin-bottom: 30px;
    text-align: center;
    font-weight: 400;
    border-bottom: 1px solid #D4AF37;
    padding-bottom: 15px;
    display: inline-block;
    width: 100%;
}

.welcome-text {
    text-align: center;
    font-size: 1.1em;
    line-height: 1.8;
    color: #555;
    max-width: 700px;
    margin: 0 auto;
}

/* ===== ПРОГРАММА ===== */
.program-item {
    margin-bottom: 30px;
    padding: 20px 0;
    border-bottom: 1px dashed #E0D5B8;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.program-item:last-child {
    border-bottom: none;
}

.program-item .time {
    color: #D4AF37;
    font-weight: bold;
    font-size: 1.1em;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.program-item .location {
    color: #333;
    font-size: 1.1em;
}

.program-item p {
    color: #666;
    font-style: italic;
    font-size: 0.95em;
}

/* ===== ДЕТАЛИ ===== */
.details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 30px;
}

.detail-card {
    background: #FDFBF7;
    padding: 30px;
    border-radius: 4px;
    text-align: center;
    border: 1px solid #E0D5B8;
}

.detail-card h3 {
    font-family: 'Georgia', serif;
    color: #222;
    margin-bottom: 15px;
    font-size: 1.4em;
    font-weight: normal;
}

.detail-card p {
    color: #555;
    line-height: 1.7;
    font-size: 0.95em;
}

/* ===== КНОПКА RSVP ===== */
.rsvp-button {
    display: block;
    width: 100%;
    max-width: 350px;
    margin: 40px auto;
    padding: 18px 40px;
    background: #FFF;
    color: #D4AF37;
    text-align: center;
    text-decoration: none;
    border-radius: 4px;
    font-size: 1.1em;
    text-transform: uppercase;
    letter-spacing: 2px;
    border: 2px solid #D4AF37;
    transition: all 0.3s;
    cursor: pointer;
}

.rsvp-button:hover {
    background: #D4AF37;
    color: #FFF;
}

/* ===== ФОРМА ЯНДЕКС ===== */
.yandex-form-container {
    background: #FFF;
    padding: 0; /* УБРАЛИ все отступы */
    border: 1px solid #E0D5B8;
    border-radius: 4px;
    margin-top: 30px;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

.iframe-wrapper {
    position: relative;
    width: 100%;
    overflow: hidden;
    border-radius: 0; /* Убрали скругление */
}

.responsive-iframe {
    width: 100%;
    height: 900px;
    border: none;
    display: block;
}

/* ===== ФУТЕР ===== */
.footer {
    text-align: center;
    padding: 40px 20px;
    color: #888;
    font-size: 0.9em;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.footer-photo {
    max-width: 150px;
    width: 100%;
    border-radius: 4px;
    border: 1px solid #D4AF37;
    margin: 20px auto;
    display: block;
    opacity: 0.8;
}

/* ===== ЛЕТАЮЩИЕ ПЧЁЛКИ ===== */
.bee {
    position: fixed;
    font-size: 2em;
    pointer-events: none;
    z-index: 1000;
    opacity: 0.6;
    animation: flyAround 25s linear infinite;
}

.bee-1 {
    top: 10%;
    left: -50px;
    animation-delay: 0s;
    animation-duration: 20s;
}

.bee-2 {
    top: 30%;
    left: -50px;
    animation-delay: 5s;
    animation-duration: 22s;
}

.bee-3 {
    top: 60%;
    left: -50px;
    animation-delay: 10s;
    animation-duration: 24s;
}

.bee-4 {
    top: 80%;
    left: -50px;
    animation-delay: 15s;
    animation-duration: 26s;
}

@keyframes flyAround {
    0% {
        transform: translateX(0) translateY(0) rotate(0deg);
    }
    25% {
        transform: translateX(25vw) translateY(-30px) rotate(5deg);
    }
    50% {
        transform: translateX(50vw) translateY(0) rotate(0deg);
    }
    75% {
        transform: translateX(75vw) translateY(30px) rotate(-5deg);
    }
    100% {
        transform: translateX(100vw) translateY(0) rotate(0deg);
    }
}

/* ===== АНИМИРОВАННЫЕ ВОПРОСИКИ ===== */
.question-mark {
    font-size: 2em;
    color: #D4AF37;
    display: block;
    text-align: center;
    margin: 20px 0;
    animation: bounce 2s ease-in-out infinite;
}

.question-mark.top {
    animation-delay: 0s;
}

.question-mark.bottom {
    animation-delay: 1s;
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    25% {
        transform: translateY(-10px) rotate(-5deg);
    }
    50% {
        transform: translateY(0) rotate(0deg);
    }
    75% {
        transform: translateY(-5px) rotate(5deg);
    }
}

/* ===== АДАПТИВНАЯ ФОРМА ===== */
.yandex-form-container {
    background: #FFF;
    padding: 15px;
    border: 1px solid #E0D5B8;
    border-radius: 4px;
    margin-top: 30px;
    overflow: hidden;
    width: 100%;
    max-width: 100%;
}

.iframe-wrapper {
    position: relative;
    width: 100%;
    overflow: hidden;
    border-radius: 8px;
}

.responsive-iframe {
    width: 100%;
    height: 900px;
    border: none;
    display: block;
    min-width: 100%;
}

/* ===== МОБИЛЬНАЯ АДАПТАЦИЯ ФОРМЫ ===== */
@media (max-width: 768px) {
    .yandex-form-container {
        padding: 0; /* НОЛЬ отступов */
        margin-left: -15px; /* Выносим за границы секции */
        margin-right: -15px;
        width: calc(100% + 30px); /* Расширяем на всю ширину */
        max-width: calc(100% + 30px);
        border-left: none;
        border-right: none;
        border-radius: 0;
    }
    
    .responsive-iframe {
        height: 1100px;
        width: 100%;
    }
}

@media (max-width: 480px) {
    .yandex-form-container {
        padding: 0;
        margin-left: -20px; /* ЕЩЁ больше выносим */
        margin-right: -20px;
        width: calc(100% + 40px);
        max-width: calc(100% + 40px);
    }
    
    .responsive-iframe {
        height: 1200px;
    }
}

/* ===== МОБИЛЬНАЯ АДАПТАЦИЯ ===== */
@media (max-width: 768px) {
    .container {
        padding: 20px 10px;
    }
    
    .hero {
        padding: 25px 15px;
    }
    
    .hero h1 {
        font-size: 1.8em;
        letter-spacing: 1px;
    }
    
    .hero .date {
        font-size: 1em;
        letter-spacing: 2px;
    }
    
    .hero .main-photo {
        max-width: 150px;
        margin: 15px auto;
    }
    
    .question-mark {
        font-size: 1.2em;
        margin: 10px 0;
    }
    
    .countdown {
        gap: 8px;
        margin: 20px 0;
    }
    
    .countdown-item {
        min-width: 65px;
        padding: 10px 5px;
        flex: 1 1 40%;
    }
    
    .countdown-item .number {
        font-size: 1.6em;
    }
    
    .countdown-item .label {
        font-size: 0.65em;
    }
    
    .section {
        padding: 20px 15px;
        margin-bottom: 15px;
    }
    
    .section h2 {
        font-size: 1.4em;
        margin-bottom: 20px;
        padding-bottom: 10px;
    }
    
    .welcome-text {
        font-size: 0.95em;
        line-height: 1.6;
    }
    
    .program-item {
        padding: 15px 0;
        margin-bottom: 15px;
        gap: 8px;
    }
    
    .program-item .time {
        font-size: 0.95em;
    }
    
    .program-item .location {
        font-size: 0.9em;
    }
    
    .program-item p {
        font-size: 0.9em;
    }
    
    .details-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .detail-card {
        padding: 15px;
    }
    
    .detail-card h3 {
        font-size: 1.1em;
        margin-bottom: 10px;
    }
    
    .detail-card p {
        font-size: 0.85em;
        line-height: 1.6;
    }
    
    .rsvp-button {
        font-size: 0.9em;
        padding: 12px 25px;
        width: 90%;
        margin: 25px auto;
    }
    
    .yandex-form-container {
        padding: 10px;
        margin-top: 20px;
    }
    
    .footer {
        padding: 25px 15px;
        font-size: 0.8em;
    }
    
    .footer-photo {
        max-width: 120px;
        margin: 15px auto;
    }
    
    .bee {
        display: none;
    }
    
    .iframe-wrapper {
        transform: scale(0.9);
        width: 111%;
    }
    
    .responsive-iframe {
        height: 1000px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 15px 8px;
    }
    
    .hero {
        padding: 20px 12px;
    }
    
    .hero h1 {
        font-size: 1.5em;
    }
    
    .hero .date {
        font-size: 0.9em;
    }
    
    .hero .main-photo {
        max-width: 120px;
    }
    
    .countdown-item {
        min-width: 60px;
        padding: 8px 4px;
    }
    
    .countdown-item .number {
        font-size: 1.4em;
    }
    
    .countdown-item .label {
        font-size: 0.6em;
    }
    
    .question-mark {
        font-size: 1em;
    }
    
    .section {
        padding: 15px 10px;
        margin-bottom: 12px;
    }
    
    .section h2 {
        font-size: 1.3em;
        margin-bottom: 15px;
    }
    
    .detail-card {
        padding: 12px;
    }
    
    .yandex-form-container {
        padding: 8px;
        margin-left: -15px;
        margin-right: -15px;
        width: calc(100% + 30px);
    }
    
    .iframe-wrapper {
        transform: scale(0.85);
        width: 117.6%;
    }
    
    .responsive-iframe {
        height: 1100px;
    }
}

@media (max-width: 375px) {
    .iframe-wrapper {
        transform: scale(0.8);
        width: 125%;
    }
    
    .responsive-iframe {
        height: 1200px;
    }
}

/* ===== ПОЛНОЭКРАННОЕ МОДАЛЬНОЕ ОКНО ДЛЯ ФОРМЫ ===== */
.form-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #FDFBF7;
    z-index: 9999;
    overflow: hidden;
}

.form-modal.active {
    display: block;
    animation: modalFadeIn 0.3s ease-out;
}

.form-modal-content {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* Кнопка закрытия */
.close-form-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 44px;
    height: 44px;
    background: #FFF;
    border: 2px solid #D4AF37;
    border-radius: 50%;
    font-size: 1.2em;
    color: #D4AF37;
    cursor: pointer;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}


.close-form-btn:hover {
    background: #D4AF37;
    color: #FFF;
    transform: rotate(90deg);
}

/* Заголовок модального окна */
.form-modal-header {
    background: #FFF;
    padding: 20px;
    text-align: center;
    border-bottom: 1px solid #E0D5B8;
    flex-shrink: 0;
}

.form-modal-header h2 {
    font-family: 'Georgia', serif;
    color: #222;
    font-size: 1.5em;
    margin-bottom: 5px;
    font-weight: 400;
}

.form-modal-header p {
    color: #666;
    font-size: 0.9em;
}

/* Тело с формой */
.form-modal-body {
    flex: 1;
    overflow: hidden;
    position: relative;
}

.full-screen-iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

/* Анимация появления */
@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Адаптация для мобильных */
@media (max-width: 768px) {
    .form-modal-header {
        padding: 15px;
    }
    
    .form-modal-header h2 {
        font-size: 1.2em;
    }
    
    .form-modal-header p {
        font-size: 0.8em;
    }
    
    .close-form-btn {
        top: 10px;
        right: 10px;
        width: 40px;
        height: 40px;
    }
}

/* ===== ПОЛНОЭКРАННОЕ МОДАЛЬНОЕ ОКНО ===== */
.form-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #FDFBF7;
    z-index: 9999;
    overflow: hidden; /* Запрещаем прокрутку самого модального окна */
}

.form-modal.active {
    display: block;
    animation: modalFadeIn 0.3s ease-out;
}

.form-modal-content {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.close-form-btn {
    position: fixed;
    top: 15px;
    right: 15px;
    width: 44px;
    height: 44px;
    background: #FFF;
    border: 2px solid #D4AF37;
    border-radius: 50%;
    font-size: 1.2em;
    color: #D4AF37;
    cursor: pointer;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.close-form-btn:hover {
    background: #D4AF37;
    color: #FFF;
}

.form-modal-header {
    background: #FFF;
    padding: 60px 20px 20px;
    text-align: center;
    border-bottom: 1px solid #E0D5B8;
}

.form-modal-header h2 {
    font-family: 'Georgia', serif;
    color: #222;
    font-size: 1.5em;
    margin-bottom: 5px;
}

.form-modal-header p {
    color: #666;
    font-size: 0.9em;
}

.form-modal-body {
    flex: 1;
    overflow-y: auto;
}

.full-screen-iframe {
    width: 100%;
    height: 100%;
    min-height: 100vh;
    border: none;
}

@media (max-width: 768px) {
    .form-modal-header {
        padding: 60px 15px 15px;
    }
    
    .form-modal-header h2 {
        font-size: 1.3em;
    }
    
    .close-form-btn {
        top: 10px;
        right: 10px;
        width: 40px;
        height: 40px;
    }
}



/* ===== ПОЛНОЭКРАННОЕ МОДАЛЬНОЕ ОКНО ===== */
.form-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #FDFBF7;
    z-index: 9999;
    overflow: hidden; /* Запрещаем прокрутку самого модального окна */
}

.form-modal.active {
    display: block;
    animation: modalFadeIn 0.3s ease-out;
}

.form-modal-content {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* Кнопка закрытия */
.close-form-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 44px;
    height: 44px;
    background: #FFF;
    border: 2px solid #D4AF37;
    border-radius: 50%;
    font-size: 1.2em;
    color: #D4AF37;
    cursor: pointer;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.close-form-btn:hover {
    background: #D4AF37;
    color: #FFF;
    transform: rotate(90deg);
}

/* Заголовок модального окна */
.form-modal-header {
    background: #FFF;
    padding: 70px 20px 20px; /* Больше отступ сверху для кнопки */
    text-align: center;
    border-bottom: 1px solid #E0D5B8;
    flex-shrink: 0; /* Не сжимается */
}

.form-modal-header h2 {
    font-family: 'Georgia', serif;
    color: #222;
    font-size: 1.5em;
    margin-bottom: 5px;
    font-weight: 400;
}

.form-modal-header p {
    color: #666;
    font-size: 0.9em;
}

/* Тело с формой - ПРОКРУТКА ЗДЕСЬ! */
.form-modal-body {
    flex: 1; /* Занимает всё оставшееся пространство */
    overflow-y: auto; /* ВКЛЮЧАЕМ ПРОКРУТКУ! */
    -webkit-overflow-scrolling: touch; /* Плавная прокрутка на iOS */
    position: relative;
}

.full-screen-iframe {
    width: 100%;
    height: 1200px; /* Достаточная высота для формы */
    min-height: 100vh;
    border: none;
    display: block;
}

/* Анимация появления */
@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Адаптация для мобильных */
@media (max-width: 768px) {
    .form-modal-header {
        padding: 65px 15px 15px;
    }
    
    .form-modal-header h2 {
        font-size: 1.3em;
    }
    
    .form-modal-header p {
        font-size: 0.8em;
    }
    
    .close-form-btn {
        top: 10px;
        right: 10px;
        width: 40px;
        height: 40px;
    }
    
    .full-screen-iframe {
        height: 1400px; /* Ещё больше высота для мобильных */
    }
}

@media (max-width: 480px) {
    .full-screen-iframe {
        height: 1600px; /* Максимальная высота для маленьких экранов */
    }
}