* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    overflow-x: hidden;
    min-height: 100vh;
}

/* Фонові хвилі */
.background-waves {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('fon.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: -1;
    overflow: hidden;
}

.background-waves::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Трохи світліше, щоб краще читався візерунок fon.jpg */
    background: linear-gradient(135deg, rgba(0, 20, 50, 0.84) 0%, rgba(0, 40, 100, 0.82) 25%, rgba(15, 45, 120, 0.8) 50%, rgba(10, 50, 95, 0.82) 75%, rgba(5, 30, 75, 0.84) 100%);
    z-index: 1;
}

.background-waves::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(ellipse at 20% 30%, rgba(120, 190, 255, 0.22) 0%, transparent 55%),
        radial-gradient(ellipse at 80% 70%, rgba(90, 150, 235, 0.18) 0%, transparent 55%),
        linear-gradient(45deg, transparent 30%, rgba(120, 190, 255, 0.12) 50%, transparent 70%);
    animation: waveMove 20s ease-in-out infinite;
    z-index: 2;
}


@keyframes waveMove {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-20px) scale(1.05); }
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Екрани */
.screen {
    display: none;
    min-height: 100vh;
    padding: 20px;
    position: relative;
}

.screen.active {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* Екран 1: Початковий екран */
.screen-1 {
    text-align: left;
    padding: 20px;
    justify-content: flex-start;
    min-height: 100vh;
    max-height: 100vh;
    overflow: hidden;
}

.screen-1 .content {
    max-width: 100%;
    width: 100%;
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    height: calc(100vh - 40px);
    max-height: calc(100vh - 40px);
    justify-content: space-between;
    padding: 0 10px 20px 10px;
    box-sizing: border-box;
    overflow: hidden;
}

.screen-1 .emoji {
    font-size: 45px;
    margin-bottom: 12px;
    animation: wave 4s ease-in-out infinite;
    flex-shrink: 0;
}

@keyframes wave {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-20deg); }
    75% { transform: rotate(20deg); }
}

.screen-1 .main-title {
    font-size: 28px;
    font-weight: 900;
    color: #FFFFFF;
    line-height: 1.2;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: -0.5px;
    flex-shrink: 0;
}

.screen-1 .description {
    font-family: 'Montserrat', sans-serif;
    font-weight: 300;
    font-style: normal;
    font-size: 20px;
    line-height: 102%;
    letter-spacing: -0.02em;
    color: #E0F2F7;
    margin-bottom: 15px;
    max-width: 100%;
    flex-shrink: 1;
    overflow: hidden;
}

.screen-1 .arrow-guide {
    width: 180px;
    height: auto;
    margin: 8px 0 15px;
    flex-shrink: 1;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    min-height: 0;
}

.screen-1 .arrow-image {
    width: 100%;
    height: auto;
    max-width: 275px;
    opacity: 0.8;
}

.screen-1 .content-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.screen-1 .btn-start {
    width: calc(100% - 40px);
    max-width: 300px;
    padding: 16px 30px;
    background: #FFFFFF;
    color: #000000;
    border: none;
    border-radius: 15px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    flex-shrink: 0;
    margin-top: auto;
    margin-left: auto;
    margin-right: auto;
    align-self: center;
    box-sizing: border-box;
    min-height: 50px;
}

.screen-1 .btn-start:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.screen-1 .btn-start:active {
    transform: translateY(0);
}

/* Квіз картки */
.screen-quiz {
    padding: 20px;
}

.quiz-card {
    background: #FFFFFF;
    border-radius: 24px;
    width: 100%;
    max-width: 500px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    position: relative;
    z-index: 1;
}

.quiz-header {
    background: linear-gradient(90deg, #5F7DFE 0%, #B065F6 100%);
    padding: 30px 25px;
    text-align: center;
    border-radius: 24px 24px 0 0;
}

.quiz-header .progress {
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
    margin-bottom: 15px;
    font-weight: 500;
}

.quiz-header .question {
    color: #FFFFFF;
    font-size: 22px;
    font-weight: 700;
    line-height: 1.3;
    margin: 0;
}

.quiz-content {
    padding: 30px 25px;
}

.option {
    display: flex;
    align-items: center;
    padding: 18px 20px;
    margin-bottom: 15px;
    background: #FFFFFF;
    border: 1px solid #E0E0E0;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 16px;
    color: #333333;
}

.option:hover {
    border-color: #5F7DFE;
    background: #F5F7FF;
}

.option.selected {
    background: #E9F0FE;
    border-color: #5F7DFE;
}

.radio-btn {
    margin-right: 15px;
    flex-shrink: 0;
}

.quiz-navigation {
    display: flex;
    gap: 12px;
    padding: 20px 25px 25px;
}

.btn-back {
    flex: 1;
    padding: 16px;
    background: #E9F0FE;
    color: #333333;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-back:hover {
    background: #D0E0FE;
}

.btn-next {
    flex: 1.2;
    padding: 16px;
    background: linear-gradient(90deg, #5F7DFE 0%, #B065F6 100%);
    color: #FFFFFF;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-next:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(95, 125, 254, 0.4);
}

/* Форма */
.screen-form {
    padding: 20px;
}

.form-card {
    background: #FFFFFF;
    border-radius: 24px;
    width: 100%;
    max-width: 500px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    position: relative;
    z-index: 1;
}

.form-header {
    background: linear-gradient(90deg, #4A8CFF 0%, #A64AFF 100%);
    padding: 35px 25px;
    text-align: center;
    border-radius: 24px 24px 0 0;
}

.form-header h2 {
    color: #FFFFFF;
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 12px;
}

.form-header p {
    color: #FFFFFF;
    font-size: 14px;
    line-height: 1.5;
    opacity: 0.95;
}

.form-content {
    padding: 30px 25px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    color: #333333;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 10px;
}

.form-group input {
    width: 100%;
    padding: 16px;
    border: 1px solid #D3D3D3;
    border-radius: 12px;
    font-size: 16px;
    transition: all 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: #4A8CFF;
    box-shadow: 0 0 0 3px rgba(74, 140, 255, 0.1);
}

.phone-group {
    display: flex;
    gap: 10px;
}

.phone-code {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 16px;
    background: #F8F8F8;
    border: 1px solid #D3D3D3;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    color: #333333;
    min-width: 100px;
}

.phone-code .flag-img {
    width: 24px;
    height: 24px;
    object-fit: cover;
    border-radius: 50%;
    flex-shrink: 0;
}

.phone-group input {
    flex: 1;
}

.form-navigation {
    display: flex;
    gap: 12px;
    padding: 20px 25px 25px;
}

.btn-submit {
    flex: 1.2;
    padding: 16px;
    background: #4A8CFF;
    color: #FFFFFF;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-submit:hover {
    background: #3A7CFF;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(74, 140, 255, 0.4);
}

/* Екран успіху */
.screen-success {
    text-align: center;
    padding: 40px 20px;
}

.success-content {
    max-width: 600px;
    width: 100%;
    position: relative;
    z-index: 1;
}

.success-icon {
    margin-bottom: 30px;
    animation: scaleIn 0.5s ease-out;
}

@keyframes scaleIn {
    from {
        transform: scale(0);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.checkmark-box {
    display: inline-block;
    animation: bounce 0.6s ease-out;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.success-title {
    font-size: 32px;
    font-weight: 900;
    color: #FFFFFF;
    text-transform: uppercase;
    margin-bottom: 20px;
    line-height: 1.2;
}

.success-message {
    font-size: 16px;
    color: #FFFFFF;
    line-height: 1.6;
    margin-bottom: 40px;
    max-width: 90%;
    margin-left: auto;
    margin-right: auto;
}

.hourglass-container {
    margin: 40px 0;
    display: flex;
    justify-content: center;
    align-items: center;
}

.hourglass-image {
    max-width: 200px;
    width: 100%;
    height: auto;
    animation: tilt 3s ease-in-out infinite;
}

@keyframes tilt {
    0%, 100% { transform: rotate(-15deg); }
    50% { transform: rotate(-10deg); }
}

.success-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: #FFFFFF;
    font-size: 14px;
    margin-top: 40px;
}

.success-footer svg {
    flex-shrink: 0;
}

/* Мобільні пристрої - дуже маленькі екрани */
@media (max-width: 360px) {
    .screen-1 {
        padding: 15px;
    }

    .screen-1 .content {
        padding: 0 5px 15px 5px;
    }

    .screen-1 .emoji {
        font-size: 40px;
        margin-bottom: 10px;
    }

    .screen-1 .main-title {
        font-size: 24px;
        margin-bottom: 10px;
    }

    .screen-1 .description {
        font-family: 'Montserrat', sans-serif;
        font-weight: 300;
        font-size: 16px;
        line-height: 102%;
        letter-spacing: -0.02em;
        margin-bottom: 12px;
    }

    .screen-1 .arrow-guide {
        width: 150px;
        margin: 6px 0 15px;
    }

    .screen-1 .btn-start {
        width: calc(100% - 20px);
        padding: 14px 25px;
        font-size: 16px;
    }
}

/* Адаптивність для десктопу */
@media (min-width: 768px) {
    .screen-1 {
        padding: 30px 50px;
        max-height: 100vh;
        overflow: hidden;
    }

    .screen-1 .content {
        max-width: 700px;
        margin: 0 auto;
        height: calc(100vh - 60px);
        max-height: calc(100vh - 60px);
        padding: 0 10px 20px 10px;
        overflow: hidden;
    }

    .screen-1 .emoji {
        font-size: 60px;
        margin-bottom: 15px;
        animation: wave 4s ease-in-out infinite;
    }

    .screen-1 .main-title {
        font-size: 42px;
        margin-bottom: 15px;
        line-height: 1.1;
    }

    .screen-1 .description {
        font-family: 'Montserrat', sans-serif;
        font-weight: 300;
        font-size: 22px;
        line-height: 102%;
        letter-spacing: -0.02em;
        max-width: 600px;
        margin-bottom: 20px;
    }

    .screen-1 .arrow-guide {
        width: 220px;
        margin: 10px 0 20px;
    }

    .screen-1 .arrow-image {
        max-width: 250px;
    }

    .screen-1 .btn-start {
        max-width: 320px;
        padding: 16px 40px;
        font-size: 18px;
        align-self: center;
        width: 100%;
    }

    .quiz-card,
    .form-card {
        max-width: 600px;
    }

    .quiz-header {
        padding: 40px 35px;
    }

    .quiz-header .question {
        font-size: 26px;
    }

    .quiz-content {
        padding: 40px 35px;
    }

    .option {
        padding: 20px 25px;
        font-size: 18px;
    }

    .form-header {
        padding: 40px 35px;
    }

    .form-header h2 {
        font-size: 24px;
    }

    .form-header p {
        font-size: 16px;
    }

    .form-content {
        padding: 40px 35px;
    }

    .success-title {
        font-size: 42px;
    }

    .success-message {
        font-size: 18px;
        max-width: 500px;
    }

    .hourglass-image {
        max-width: 250px;
    }
}

@media (min-width: 1024px) {
    .screen-1 {
        padding: 40px 60px;
    }

    .screen-1 .content {
        height: calc(100vh - 80px);
        max-height: calc(100vh - 80px);
    }

    .screen-1 .emoji {
        font-size: 65px;
        margin-bottom: 20px;
    }

    .screen-1 .main-title {
        font-size: 48px;
        margin-bottom: 20px;
    }

    .screen-1 .description {
        font-family: 'Montserrat', sans-serif;
        font-weight: 300;
        font-size: 22px;
        line-height: 102%;
        letter-spacing: -0.02em;
        margin-bottom: 25px;
    }

    .screen-1 .arrow-guide {
        margin: 15px 0 25px;
    }

    .quiz-card,
    .form-card {
        max-width: 700px;
    }

    .quiz-header .question {
        font-size: 28px;
    }

    .success-content {
        max-width: 800px;
    }

    .success-title {
        font-size: 48px;
    }

    .hourglass-image {
        max-width: 300px;
    }
}

/* Плавні переходи між екранами */
.screen {
    animation: fadeIn 0.5s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}