* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --gold: #ffd166;
    --gold-bright: #ffdf8e;
    --gold-deep: #c99a2e;
    --gold-muted: #b9974e;   /* приглушённый золотой для шапки формы и кнопки */
}

html, body {
    min-height: 100%;
    overflow: auto;
}

body {
    font-family: 'Segoe UI', 'Arial', sans-serif;
    background: #0a1120;
    color: #e6ecff;
    position: relative;
    -webkit-font-smoothing: antialiased;
}

/* ---- Глубокий синий космический фон ---- */
.nebula {
    position: fixed;
    inset: 0;
    z-index: 0;
    background:
        radial-gradient(circle at 30% 25%, rgba(60, 84, 148, 0.22), transparent 52%),
        radial-gradient(circle at 76% 16%, rgba(74, 76, 112, 0.12), transparent 46%),
        radial-gradient(circle at 16% 80%, rgba(46, 78, 130, 0.14), transparent 52%),
        radial-gradient(circle at 86% 72%, rgba(104, 104, 124, 0.09), transparent 46%),
        linear-gradient(165deg, #10192d 0%, #0f1a30 40%, #0a1122 72%, #070d19 100%);
}

#stars {
    position: fixed;
    inset: 0;
    z-index: 1;
    display: block;
}

/* ---- Контент (в потоке: надпись -> форма -> подвал) ---- */
.content {
    position: relative;
    z-index: 3;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.hero {
    position: relative;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 15vh;
}

/* ---- Заголовок ---- */
.title {
    position: relative;
    left: auto;
    top: auto;
    transform: none;
    z-index: 3;
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 0.12em;
    opacity: 0;
    pointer-events: none;
    font-family: 'Cormorant Garamond', 'Georgia', 'Times New Roman', serif;
    text-align: center;
    white-space: nowrap;
}

.title.visible {
    opacity: 1;
    transition: opacity 1.2s ease;
}

.title .letter {
    position: relative;
    display: inline-block;
    font-size: clamp(2.6rem, 9vw, 7rem);
    font-weight: 700;
    letter-spacing: 0.04em;
}

.title .letter.space {
    width: 0.6em;
}

.title .letter .letter-text {
    color: transparent;
    text-shadow: none;
    display: inline-block;
    will-change: transform, opacity;
    opacity: 0;
    transition: opacity 1.1s ease;
}

.title .letter .letter-text.revealed {
    opacity: 1;
    color: var(--gold);
    background: linear-gradient(180deg, var(--gold-bright), var(--gold) 55%, var(--gold-deep));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 18px rgba(255, 209, 102, 0.65),
                 0 0 45px rgba(255, 209, 102, 0.35),
                 0 6px 22px rgba(0, 0, 0, 0.7);
    animation: floatY 6s ease-in-out infinite;
}

/* ---- Подзаголовок под надписью ---- */
.subtitle {
    position: relative;
    left: auto;
    top: auto;
    transform: none;
    z-index: 3;
    opacity: 0;
    pointer-events: none;
    font-family: 'Cormorant Garamond', 'Georgia', 'Times New Roman', serif;
    text-align: center;
    white-space: nowrap;
    margin-top: 0.35em;
}

.subtitle.visible {
    opacity: 1;
    transition: opacity 1.2s ease;
}

.subtitle .sub-letter {
    display: inline-block;
    font-size: clamp(1rem, 3.4vw, 1.7rem);
    font-weight: 500;
    letter-spacing: 0.12em;
}

.subtitle .sub-letter.space {
    width: 0.45em;
}

.subtitle .sub-letter .sub-letter-text {
    opacity: 0;
    color: var(--gold);
    background: linear-gradient(180deg, var(--gold-bright), var(--gold) 55%, var(--gold-deep));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 6px rgba(255, 209, 102, 0.16), 0 0 16px rgba(255, 209, 102, 0.08);
    transition: opacity 0.9s ease;
}

.subtitle .sub-letter .sub-letter-text.revealed {
    opacity: 0.5;
}

#snow {
    position: fixed;
    inset: 0;
    z-index: 2;
    display: block;
    pointer-events: none;
}

@keyframes floatY {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-9px); }
}

/* ---- Форма ---- */
.form-container {
    position: relative;
    left: auto;
    bottom: auto;
    transform: translateY(30px);
    z-index: 3;
    width: min(760px, 96vw);
    opacity: 0;
    margin: 34px 0 40px;
    pointer-events: none;
}

.form-container.visible {
    opacity: 1;
    transform: translateY(0);
    transition: transform 1.1s cubic-bezier(.22,.9,.28,1), opacity 1.1s ease;
    pointer-events: auto;
}

.book-form {
    background: rgba(24, 28, 40, 0.86);
    border: 1px solid rgba(255, 209, 102, 0.28);
    border-radius: 20px;
    backdrop-filter: blur(10px);
    padding: 23px 28px 25px;
    box-shadow: 0 -10px 60px rgba(0, 0, 0, 0.6), 0 0 40px rgba(30, 60, 160, 0.35);
    font-family: 'Cormorant Garamond', 'Georgia', 'Times New Roman', serif;
}

.form-title {
    color: var(--gold-muted);
    font-family: inherit;
    font-weight: 600;
    letter-spacing: 0.18em;
    font-size: 1.27rem;
    text-align: center;
    text-transform: uppercase;
    margin-bottom: 18px;
    text-shadow: 0 0 16px rgba(185, 151, 78, 0.35);
}

.fields-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 18px;
}

.fields-row .field {
    margin-bottom: 16px;
}

.field label {
    display: block;
    font-size: 0.83rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(210, 225, 255, 0.6);
    margin-bottom: 7px;
    font-family: inherit;
}

.field input[type="text"],
.field input[type="email"],
.field input[type="date"] {
    width: 100%;
    padding: 13px 15px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(22, 26, 43, 0.7);
    color: #eaf1ff;
    font-size: 1.1rem;
    outline: none;
    font-family: inherit;
    transition: border-color .3s, box-shadow .3s;
}

.field input:focus {
    border-color: rgba(255, 209, 102, 0.7);
    box-shadow: 0 0 0 3px rgba(255, 209, 102, 0.12);
}

.field input::placeholder {
    color: rgba(200, 215, 250, 0.35);
}

.checkbox {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    cursor: pointer;
}

.checkbox input {
    appearance: none;
    -webkit-appearance: none;
    width: 17px;
    height: 17px;
    margin-top: 1px;
    flex-shrink: 0;
    cursor: pointer;
    background: rgba(22, 26, 43, 0.7);   /* как поля формы */
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 5px;
    position: relative;
    display: inline-block;
}
.checkbox input:checked {
    background: var(--gold-muted);
    border-color: var(--gold);
}
.checkbox input:checked::after {
    content: '';
    position: absolute;
    left: 4px;
    top: 0;
    width: 5px;
    height: 9px;
    border: solid #1a1200;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.checkbox span {
    font-size: 0.83rem;
    line-height: 1.45;
    color: rgba(200, 215, 250, 0.7);
    font-family: inherit;
}

.consent-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 20px;
    align-items: center;
}

.submit-btn {
    width: auto;
    white-space: nowrap;
    padding: 15px 28px;
    margin: 0;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    font-size: 1.15rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    color: #1a1200;
    font-family: inherit;
    background: var(--gold-muted);
    box-shadow: 0 8px 26px rgba(185, 151, 78, 0.28);
    transition: transform .2s, box-shadow .2s, opacity .2s;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(185, 151, 78, 0.45);
}

.submit-btn:disabled {
    opacity: 0.6;
    cursor: default;
    transform: none;
}

.form-note {
    margin-top: 12px;
    font-size: 0.92rem;
    text-align: center;
    color: var(--gold-muted);
    min-height: 1em;
}

/* ---- Подвал ---- */
.site-footer {
    position: relative;
    z-index: 3;
    opacity: 0;
    transition: opacity 1.4s ease;
    width: 100%;
    padding: 22px 24px 36px;
    text-align: center;
    font-family: 'Cormorant Garamond', 'Georgia', 'Times New Roman', serif;
    color: rgba(210, 225, 255, 0.5);
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 18px;
    margin-bottom: 16px;
}

.footer-link {
    color: rgba(217, 181, 102, 0.75);
    text-decoration: none;
    font-size: 0.98rem;
    letter-spacing: 0.02em;
}

.footer-link:hover {
    text-decoration: underline;
}

.footer-legal {
    font-size: 0.86rem;
    line-height: 1.6;
    max-width: 880px;
    margin: 0 auto 14px;
    color: rgba(210, 225, 255, 0.45);
}

.site-footer.visible {
    opacity: 1;
}

.footer-copy {
    font-size: 0.9rem;
    color: rgba(210, 225, 255, 0.55);
}

@media (max-width: 820px) {
    /* Мобильная версия: страница прокручивается по вертикали,
       элементы строятся друг под другом, ничего не перекрывается
       и всё остаётся читаемым на любом экране. */
    html, body {
        overflow: auto;
    }
    html {
        height: auto;
    }
    body {
        display: block;
    }

    .hero {
        min-height: auto;
        padding-top: 0;
    }

    .title {
        position: relative;
        top: auto;
        left: auto;
        transform: none;
        width: 100%;
        margin: 0 auto;
        padding: 64px 14px 0;
        white-space: normal;
        flex-wrap: wrap;
        row-gap: 0.05em;
    }
    .title .letter {
        font-size: clamp(2.1rem, 9.5vw, 3.2rem);
    }
    .title .letter.space {
        width: 0.5em;
    }

    .subtitle {
        position: relative;
        top: auto;
        left: auto;
        transform: none;
        width: 100%;
        margin: 24px auto 0;
        padding: 0 16px;
        white-space: normal;
        line-height: 1.55;
    }
    .subtitle .sub-letter {
        font-size: clamp(1rem, 4vw, 1.35rem);
    }

    .form-container {
        position: relative;
        left: auto;
        bottom: auto;
        transform: translateY(70px);
        width: 100%;
        margin: 28px auto 0;
        padding: 0 14px 24px;
    }
    .form-container.visible {
        transform: translateY(0);
    }
    .book-form {
        border-radius: 18px;
        border-bottom: 1px solid rgba(255, 209, 102, 0.28);
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5), 0 0 30px rgba(30, 60, 160, 0.3);
    }

    .fields-row {
        grid-template-columns: 1fr;
        gap: 14px;
    }
    .consent-row {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    .submit-btn {
        width: 100%;
    }
}

/* ---- Страница результата (submit.php) ---- */
.result-body {
    display: flex;
    align-items: center;
    justify-content: center;
}

.result-wrap {
    position: relative;
    z-index: 4;
    width: min(520px, 92vw);
    background: rgba(8, 14, 42, 0.88);
    border: 1px solid rgba(255, 209, 102, 0.3);
    border-radius: 20px;
    padding: 40px 36px;
    text-align: center;
    box-shadow: 0 0 60px rgba(0, 0, 0, 0.6), 0 0 40px rgba(30, 60, 160, 0.35);
}

.result-title {
    color: var(--gold);
    font-family: 'Cormorant Garamond', 'Georgia', serif;
    font-weight: 400;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    font-size: 1.5rem;
    margin-bottom: 16px;
    text-shadow: 0 0 18px rgba(255, 209, 102, 0.5);
}

.result-text {
    font-size: 1rem;
    line-height: 1.6;
    color: rgba(226, 236, 255, 0.92);
}

.result-list {
    list-style: none;
    color: #ff8f7a;
    margin-bottom: 14px;
    font-size: 0.95rem;
}

.result-list li {
    padding: 4px 0;
}

.back-link {
    color: var(--gold);
    text-decoration: none;
    font-size: 0.9rem;
}

.back-link:hover {
    text-decoration: underline;
}
