@font-face {
    font-family: 'Bedstead';
    src: url('bedstead-extracondensed.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'Bedstead Semicondensed';
    src: url('bedstead-semicondensed.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    overflow: hidden;
    min-height: calc(var(--vh, 1vh) * 100);
    height: calc(var(--vh, 1vh) * 100);
    background: #FF4545;
    padding: 20px;
    margin: 0;
}

/* Sky Background */
.sky-background {
    height: calc((var(--vh, 1vh) * 100) - 40px);
    min-height: calc((var(--vh, 1vh) * 100) - 40px);
    background: 
        url('sky-qw-back.png'),
        linear-gradient(180deg, #2E9DFF 0%, #8BC9FF 100%);
    background-size: cover, 100% 100%;
    background-position: center, center;
    background-repeat: no-repeat, no-repeat;
    position: relative;
    padding: 32px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    overflow: hidden;
    border-radius: 44px;
    background-color: rgba(255, 255, 255, 0.01);
    box-shadow: 0 3px 50px 3px #FFF inset;
    box-sizing: border-box;
}

.logo-wrapper {
    position: absolute;
    top: 28px;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: center;
    z-index: 6;
    pointer-events: none;
}

.logo {
    height: 56px;
    width: auto;
    pointer-events: auto;
}

/* Widgets Container */
.widgets-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2; /* Выше заголовка (z-index: 1), но ниже формы и ссылок (z-index: 5) */
    overflow: hidden;
}

/* Falling Widget */
.falling-widget {
    position: absolute;
    width: 120px;
    height: 120px;
    border-radius: 17px;
    object-fit: contain;
    pointer-events: none;
    /* box-shadow: -39.507px 54.612px 18.591px 0 rgba(0, 0, 0, 0.00), -25.563px 34.859px 17.429px 0 rgba(0, 0, 0, 0.02), -13.944px 19.753px 15.106px 0 rgba(0, 0, 0, 0.05), -5.81px 9.296px 10.458px 0 rgba(0, 0, 0, 0.09), -1.162px 2.324px 5.81px 0 rgba(0, 0, 0, 0.11); */
    will-change: transform;
}

/* Container with Red Border */
.container {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 1200px;
    height: 100%;
    margin: 0 auto;
}

.content-wrapper {
    background: transparent;
    border: none;
    border-radius: 20px;
    padding: 0 40px;
    position: relative;
    text-align: center;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
}

.content-wrapper > .title-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-bottom: calc(74px + 24px + 32px + 20px); /* высота формы (74px) + margin-bottom формы (24px) + высота ссылок (~32px) + отступы */
    pointer-events: none;
    z-index: 1;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Title Wrapper - центрирует заголовок между верхом и формой */

/* Title Image */
.title-image {
    max-width: 90%;
    height: auto;
    position: relative;
    z-index: 5;
    pointer-events: auto;
    display: block;
}

.title-picture {
    display: flex;
    justify-content: center;
    width: 100%;
    pointer-events: none;
}

/* Form Label */
.form-label {
    color: #668cae;
    font-family: 'Bedstead Semicondensed', sans-serif;
    font-size: 20px;
    font-style: normal;
    font-weight: 500;
    line-height:100%;
    letter-spacing: -0.6px;
    text-transform: uppercase;
    text-align: center;
    margin-bottom: 12px;
    position: relative;
    z-index: 5;
    width: 623px;
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
    box-sizing: border-box;
}

/* Email Form */
.email-form {
    /* margin-bottom: 20px; */
    position: relative;
    z-index: 5;
}

.form-group {
    display: flex;
    width: 623px;
    max-width: 100%;
    padding: 6px;
    align-items: flex-start;
    gap: 6px;
    border-radius: 48px;
    background: #FF4545;
    margin: 0 auto;
    margin-bottom: 24px;
}

#emailInput {
    display: flex;
    height: 74px;
    padding: 24px 24px 24px 20px;
    align-items: center;
    flex: 1 0 0;
    border-radius: 40px;
    background: #D7E0EA;
    box-shadow: 0 2px 2px 0 rgba(22, 22, 22, 0.20) inset;
    border: none;
    font-family: 'Bedstead Semicondensed', sans-serif;
    font-size: 20px;
    color: #333;
    outline: none;
    box-sizing: border-box;
    transition: all 0.3s ease;
}

#emailInput::placeholder {
    color: #ABBED3;
    font-family: 'Bedstead Semicondensed', sans-serif;
    font-size: 20px;
}

#emailInput:hover::placeholder {
    color: #93A5B8;
}

#emailInput:focus {
    outline: none;
}

#emailInput:focus::placeholder {
    color: #93A5B8;
}

.join-btn {
    display: flex;
    max-height: 74px;
    padding: 28px 32px;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border-radius: 40px;
    background: #0085FF;
    color: white;
    border: none;
    font-family: 'Bedstead Semicondensed', sans-serif;
    font-size: 20px;
    font-weight: normal;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.3s ease, color 0.3s ease;
    box-sizing: border-box;
}

.join-btn:hover {
    background: #ABFF00;
    color: #000;
}

.join-btn:active {
    background: #ABFF00;
    color: #000;
}

.join-btn.done {
    background: #EBFF00;
    color: #000;
}

.join-btn.done:hover {
    background: #EBFF00;
    color: #000;
}

.join-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.form-message {
    font-size: 0.9rem;
    min-height: 20px;
    margin-top: 15px;
    color: #333;
    display: none;
    font-family: 'Bedstead Semicondensed', sans-serif;
}

.form-message.success {
    color: #4caf50;
    display: block;
}

.form-message.error {
    color: #f44336;
    display: block;
}

/* Social Links */
.social-links {
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
    position: relative;
    z-index: 5;
    /* margin-bottom: 32px; */
}

.social-link {
    color: #668CAE;
    text-decoration: none;
    font-family: 'Bedstead Semicondensed', sans-serif;
    font-size: 1rem;
text-decoration: underline;
    font-weight: normal;
    transition: color 0.3s ease;
}

.social-link:hover {
    color: #668CAE;
    text-decoration: underline;
}

/* Mobile Responsive for Widgets */
@media (max-width: 768px) {
    .falling-widget {
        width: 60px;
        height: 60px;
    }
}

@media (max-width: 480px) {
    .falling-widget {
        width: 50px;
        height: 50px;
    }
}

/* Mobile Responsive */
@media (max-width: 1023px) {
    body {
        padding: 8px;
        overflow: hidden;
        height: calc(var(--vh, 1vh) * 100);
        min-height: calc(var(--vh, 1vh) * 100);
    }

    .sky-background {
        min-height: calc((var(--vh, 1vh) * 100) - 16px);
        height: auto;
        background-size: cover, 100% 100%;
        padding: 0;
        overflow: hidden;
    }

    .container {
        max-width: 100%;
        height: 100%;
        min-height: 100%;
    }

    .content-wrapper {
        padding: 10px 10px 28px 10px;
        min-height: calc((var(--vh, 1vh) * 100) - 16px);
        height: 100%;
        position: relative;
    }

    .content-wrapper > .title-wrapper {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: calc((var(--vh, 1vh) * 100) - 16px);
        display: flex;
        align-items: center;
        justify-content: center;
        padding-bottom: calc(74px + 24px + 20px + 20px); /* высота формы (74px) + margin-bottom формы (24px) + высота ссылок (~20px) + отступы */
        pointer-events: none;
        z-index: 1;
    }

    .title-image {
        max-width: 100%;
        width: 100%;
    }

    .form-group {
        width: 100%;
        margin: 0;
        box-sizing: border-box;
    }

    .email-form {
        width: 100%;
    }

    #emailInput {
        height: 74px;
    }

    .join-btn {
        height: 74px;
        max-height: 74px;
        font-size: 15px;
    }

    .social-links {
        margin-top: 20px;
    }

    .logo-wrapper {
        top: 20px;
    }

    .logo {
        height: 48px;
    }
}

@media (max-width: 768px) {
    .content-wrapper {
        padding: 40px 25px;
        border-width: 6px;
    }

    .pink-bubble {
        font-size: 3.5rem; /* ~56px */
        padding: 25px 30px;
        margin-bottom: 30px;
        letter-spacing: -1.5px;
        text-shadow: 
            -10px -10px 0 #FFBCD4,
            10px -10px 0 #FFBCD4,
            -10px 10px 0 #FFBCD4,
            10px 10px 0 #FFBCD4,
            -10px 0 0 #FFBCD4,
            10px 0 0 #FFBCD4,
            0 -10px 0 #FFBCD4,
            0 10px 0 #FFBCD4,
            -7px -7px 0 #FFBCD4,
            7px -7px 0 #FFBCD4,
            -7px 7px 0 #FFBCD4,
            7px 7px 0 #FFBCD4,
            -4px -4px 0 #FFBCD4,
            4px -4px 0 #FFBCD4,
            -4px 4px 0 #FFBCD4,
            4px 4px 0 #FFBCD4;
    }

    .form-group {
        width: 100%;
        max-width: 100%;
        padding: 5px;
        gap: 5px;
        border-radius: 40px;
    }

    #emailInput {
        height: 60px;
        padding: 20px 20px 20px 16px;
        border-radius: 35px;
        font-size: 0.9rem;
    }

    .join-btn {
        max-height: 60px;
        padding: 20px 24px;
        border-radius: 35px;
        font-size: 0.9rem;
    }

    .social-links {
        gap: 20px;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .sky-background {
        border-radius: 20px;
    }
    .content-wrapper {
        padding: 8px 8px 28px 8px;
        border-width: 5px;
        border-radius: 20px;
    }

    .pink-bubble {
        font-size: 2.5rem; /* ~40px */
        padding: 20px 25px;
        margin-bottom: 25px;
        letter-spacing: -1px;
        text-shadow: 
            -7px -7px 0 #FFBCD4,
            7px -7px 0 #FFBCD4,
            -7px 7px 0 #FFBCD4,
            7px 7px 0 #FFBCD4,
            -7px 0 0 #FFBCD4,
            7px 0 0 #FFBCD4,
            0 -7px 0 #FFBCD4,
            0 7px 0 #FFBCD4,
            -5px -5px 0 #FFBCD4,
            5px -5px 0 #FFBCD4,
            -5px 5px 0 #FFBCD4,
            5px 5px 0 #FFBCD4,
            -3px -3px 0 #FFBCD4,
            3px -3px 0 #FFBCD4,
            -3px 3px 0 #FFBCD4,
            3px 3px 0 #FFBCD4;
    }

    .form-group {
        width: 100%;
        padding: 6px;
        gap: 6px;
        border-radius: 80px;
    }

    #emailInput {
        height: 74px;
        padding: 22px 18px 18px 20px;
        border-radius: 80px;
        font-size: 1rem;
    }

    .join-btn {
        max-height: 74px;
        padding: 18px 28px;
        border-radius: 80px;
        font-size: 1rem;
    }

    .social-links {
        gap: 28px;
        font-size: 0.85rem;
    }

    .logo-wrapper {
        top: 16px;
    }

    .logo {
        height: 42px;
    }
}
