/* Общие стили для квиза */
.quiz-page {
    background: linear-gradient(135deg, #f5f7fa 0%, #ffffff 100%);
    min-height: 100vh;
}

.quiz-container {
    max-width: 800px;
    margin: 40px auto;
    padding: 20px;
    margin-top: 100px;
}

.quiz-step {
    display: none;
    animation: fadeIn 0.5s ease;
}

.quiz-step.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Приветствие */
.quiz-welcome {
    text-align: center;
    background: white;
    border-radius: 30px;
    padding: 40px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
}

.mascot-bubble {
    display: flex;
    align-items: center;
    gap: 30px;
    margin-bottom: 30px;
}

.bubble-text {
    background: #FDBD24;
    padding: 30px;
    border-radius: 30px 30px 30px 0;
    position: relative;
    color: #1e1e1e;
    font-size: 18px;
    line-height: 1.6;
    flex: 1;
}

.bubble-text p {
    margin: 10px 0;
}

.bubble-text-bold {
    font-weight: 900;
}

.mascot-image img {
    max-width: 200px;
    filter: drop-shadow(0 10px 20px rgba(0,0,0,0.2));
}

/* Форма */
.quiz-form-container {
    background: white;
    border-radius: 30px;
    padding: 40px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
}

.gift-box {
    background: linear-gradient(90deg, #1189BF 0%, #A5E3FF 100%);
    color: white;
    padding: 30px;
    border-radius: 20px;
    margin-bottom: 30px;
}

.gift-box h3 {
    font-size: 24px;
    margin-bottom: 20px;
}

.gift-box ul {
    list-style: none;
    padding: 0;
}

.gift-box li {
    font-size: 18px;
    margin: 15px 0;
    padding-left: 30px;
    position: relative;
}

.form-note {
    font-size: 16px;
    color: #666;
    margin-bottom: 30px;
    text-align: center;
}

.quiz-form .form-group {
    margin-bottom: 25px;
}

.quiz-form label {
    display: block;
    font-size: 18px;
    margin-bottom: 8px;
    color: #333;
}

.quiz-form input {
    width: 100%;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 15px;
    font-size: 16px;
    transition: all 0.3s;
}

/* Стили для поля выбора города */
.quiz-form select {
    width: 100%;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 15px;
    font-size: 16px;
    transition: all 0.3s;
    background-color: white;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%231189BF' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
    background-repeat: no-repeat;
    background-position: right 15px center;
    background-size: 16px;
}

.quiz-form select:focus {
    outline: none;
    border-color: #1189BF;
    box-shadow: 0 0 0 4px rgba(17,137,191,0.1);
}

.quiz-form select option {
    padding: 10px;
}

/* Стили для дополнительного поля "Другой город" */
#otherCityGroup {
    margin-top: -10px;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Адаптивность для мобильных */
@media (max-width: 768px) {
    .quiz-form select {
        padding: 12px;
        font-size: 15px;
    }
}

.quiz-form input:focus {
    outline: none;
    border-color: #1189BF;
    box-shadow: 0 0 0 4px rgba(17,137,191,0.1);
}

.form-checkbox {
    margin: 20px 0;
}

.form-checkbox input {
    width: auto;
    margin-right: 10px;
}

.privacy-note {
    color: #1189BF;
    font-size: 14px;
    text-align: center;
    margin: 20px 0;
}

/* Игра */
.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 30px;
    background: white;
    padding: 20px;
    border-radius: 20px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.05);
}

.game-title h2 {
    color: #1189BF;
    font-size: 24px;
    margin: 0;
}

.game-mascot {
    display: flex;
    align-items: center;
    gap: 15px;
    background: #FDBD24;
    padding: 10px 20px;
    border-radius: 50px;
}

.game-bubble {
    color: #1e1e1e;
    font-weight: 500;
}

.mascot-small {
    width: 50px;
    height: 50px;
}

.progress-bar {
    height: 10px;
    background: #e0e0e0;
    border-radius: 5px;
    margin-bottom: 30px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #FDBD24, #1189BF);
    transition: width 0.3s ease;
}

.question-card {
    background: white;
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.05);
}

.question-text {
    font-size: 22px;
    color: #333;
    margin-bottom: 30px;
    text-align: center;
}

.options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
}

.option-item {
    background: #f8f9fa;
    padding: 20px 10px;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
    font-size: 19px;
    border: 2px solid #e0e0e0;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

.option-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
    background: #FDBD24;
    color: white;
}

.option-item.selected {
    background: #1189BF;
    color: white;
    border-color: #FDBD24;
}

.option-english {
    font-weight: 700;
    letter-spacing: 0.5px;
    color: #000;
    background: rgba(17, 137, 191, 0.1);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.9em;
    margin-left: 8px;
    display: inline-block;
}

/* Стиль для выбранного варианта */
.option-item.selected .option-english {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

/* Адаптация для мобильных */
@media (max-width: 768px) {
    .option-item {
        flex-wrap: wrap;
    }
    
    .option-english {
        margin-left: 0;
        margin-top: 5px;
    }
}

.game-controls {
    display: flex;
    justify-content: space-between;
    gap: 15px;
}

.quiz-btn {
    background: #1189BF;
    color: white;
    border: none;
    padding: 15px 40px;
    font-size: 18px;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 600;
}

.quiz-btn:hover {
    background: #FDBD24;
    color: #1e1e1e;
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(253,189,36,0.3);
}

.final-button {
    background: #FDBD24;
}

.final-button:hover {
    background: #1189BF;
}

.quiz-btn-outline {
    background: transparent;
    border: 2px solid #1189BF;
    color: #1189BF;
}

.quiz-btn-outline:hover {
    background: #1189BF;
    color: white;
    transform: translateY(-2px);
}

/* Финал */
.final-container {
    background: white;
    border-radius: 30px;
    padding: 40px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
}

.final-mascot {
    display: flex;
    align-items: center;
    gap: 30px;
    margin-bottom: 40px;
}

.final-mascot img {
    max-width: 150px;
}

.final-bubble {
    background: #FDBD24;
    padding: 30px;
    border-radius: 30px;
    position: relative;
    flex: 1;
    text-align: center;
}

.final-bubble p:nth-child(1) {
    margin-bottom: 15px; /* Отступ после первого */
}

/* Убираем отступы у остальных */
.final-bubble p:nth-child(2) {
    margin-bottom: 0px; /* Маленький отступ перед третьим или 0 */
}

.final-bubble p:nth-child(3) {
    margin-top: 0;
    margin-bottom: 0;
}

.final-bubble p {
    font-size: 18px;
}

.final-achievement {
    text-align: center;
    margin: 30px 0;
    padding: 20px;
    background: linear-gradient(135deg, #1189BF, #A5E3FF);
    border-radius: 20px;
    color: white;
}

.final-achievement h3{
    color: white;
}
.final-achievement p{
    color: white;
}

.highlight {
    font-size: 42px;
    font-weight: 700;
    display: block;
    margin: 10px 0;
}

.star-icon {
    display: inline-block;
    width: 80px;
    height: 80px;
    background-image: url('/images/quize-star.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    margin-left: 8px;
    vertical-align: middle;
}

.final-phrase {
    font-size: 20px;
}

.parent-message {
    background: #f8f9fa;
    padding: 30px;
    border-radius: 20px;
}

.gift-final ul {
    list-style: none;
    padding: 0;
}

.gift-final li {
    margin: 15px 0;
    font-size: 16px;
}

.masterclass-info {
    background: #1189BF;
    color: white;
    padding: 20px;
    border-radius: 15px;
    margin: 20px 0;
}

.final-question {
    font-size: 20px;
    text-align: center;
    margin: 30px 0 20px;
}

.final-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
}

/* Адаптивность */
@media (max-width: 768px) {
    .mascot-bubble {
        flex-direction: column;
    }
    
    .bubble-text {
        order: 2;
    }
    
    .mascot-image {
        order: 1;
    }
    
    .game-header {
        flex-direction: column;
        text-align: center;
    }
    
    .options-grid {
        grid-template-columns: 1fr;
    }
    
    .final-mascot {
        flex-direction: column;
        text-align: center;
    }
    
    .final-buttons {
        flex-direction: column;
    }
    
    .quiz-btn {
        width: 100%;
    }
}

/* Стили для блока сертификата */
.certificate-download {
    background: linear-gradient(135deg, #1189BF 0%, #0a6c9c 100%);
    padding: 25px;
    border-radius: 15px;
    margin: 20px 0;
    text-align: center;
    box-shadow: 0 10px 20px rgba(17,137,191,0.3);
}

.certificate-download p {
    color: white;
    margin: 10px 0;
    font-size: 18px;
}

.certificate-link {
    display: inline-block;
    background: #FDBD24;
    color: #1e1e1e;
    padding: 15px 30px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 900;
    font-size: 20px;
    margin: 15px 0;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.certificate-link:hover {
    background: white;
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(253,189,36,0.4);
    border-color: #FDBD24;
}

.certificate-link i {
    margin-right: 10px;
    font-size: 24px;
    color: #d32f2f;
}

.masterclass-info {
    background-color: #A5E3FF;
    color: #000;
}

.certificate-note {
    font-size: 14px;
    opacity: 0.9;
    margin-top: 10px;
}

.download-again {
    text-align: center;
    margin-top: 15px;
}

.download-link-small {
    color: #1189BF;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.3s;
    display: inline-block;
    padding: 8px 15px;
    border-radius: 30px;
    background: #f0f8ff;
}

.download-link-small:hover {
    background: #1189BF;
    color: white;
}

.download-link-small i {
    margin-right: 5px;
}

/* Анимация для сертификата */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.certificate-link {
    animation: pulse 2s infinite;
}

.certificate-link:hover {
    animation: none;
}

/* Стили для модального окна успеха */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 10000; /* Очень высокий z-index */
    justify-content: center;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 24px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    position: relative;
    animation: modalAppear 0.3s ease;
    margin: auto;
}

.modal-success {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 20px;
    padding: 40px;
    max-width: 450px;
    margin: 20px;
    text-align: center;
    position: relative;
    animation: slideInUp 0.4s ease;
}

.modal-success-icon {
    font-size: 64px;
    margin-bottom: 20px;
    animation: bounce 1s ease;
}

.modal-success-title {
    color: #1189BF;
    font-size: 28px;
    margin-bottom: 15px;
}

.modal-success-text {
    color: #666;
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 25px;
}

.modal-success-details {
    background: #f0f8ff;
    padding: 20px;
    border-radius: 15px;
    margin: 20px 0;
    text-align: left;
    border-left: 4px solid #FDBD24;
}

.modal-success-details p {
    margin: 8px 0;
    color: #333;
}

.modal-success-btn {
    background: #1189BF;
    color: white;
    border: none;
    padding: 15px 40px;
    font-size: 18px;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 600;
    width: 100%;
}

.modal-success-btn:hover {
    background: #FDBD24;
    color: #1e1e1e;
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(253,189,36,0.3);
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

/* Кнопка закрытия крестик */
.modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    font-size: 32px;
    cursor: pointer;
    color: #999;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s;
    z-index: 10;
}

.modal-close:hover {
    background: #f0f0f0;
    color: #1189BF;
    transform: rotate(90deg);
}

/* Обновите позиционирование для модального контента */
.modal-content {
    position: relative;
}