@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;800&display=swap');

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

body {
    font-family: 'Nunito', sans-serif;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    overflow-y: auto;
    padding: 20px 0;
}

.container {
    width: 100%;
    max-width: 520px;
    padding: 20px;
    position: relative;
    z-index: 1;
}

/* Прогресс-бар */
.progress-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.progress-bar {
    flex: 1;
    height: 8px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    width: 16.6%;
    background: linear-gradient(90deg, #ffd700, #ff6b6b);
    border-radius: 10px;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.progress-text {
    color: rgba(255, 255, 255, 0.8);
    font-weight: 700;
    font-size: 14px;
    white-space: nowrap;
}

/* Карточка опроса */
.survey-card {
    background: rgba(30, 20, 60, 0.92);
    border-radius: 24px;
    padding: 32px 28px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    min-height: 300px;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

/* Шаги */
.step {
    display: none;
    animation: fadeSlideIn 0.4s ease;
}

.step.active {
    display: block;
}

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

.step-icon {
    font-size: 48px;
    text-align: center;
    margin-bottom: 12px;
    animation: bounce 0.6s ease;
}

@keyframes bounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

.step h2 {
    text-align: center;
    color: #ffffff;
    font-size: 24px;
    font-weight: 800;
    margin-bottom: 6px;
}

.step-desc {
    text-align: center;
    color: rgba(255, 255, 255, 0.6);
    font-size: 15px;
    margin-bottom: 24px;
}

/* Инпуты */
input[type="text"],
textarea {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 14px;
    font-family: 'Nunito', sans-serif;
    font-size: 16px;
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
    transition: border-color 0.3s, box-shadow 0.3s;
    outline: none;
    resize: none;
}

input[type="text"]:focus,
textarea:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.35);
}

input::placeholder,
textarea::placeholder {
    color: rgba(255, 255, 255, 0.45);
}

.hidden {
    display: none !important;
}

/* Кнопки возраста */
.age-selector {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.age-btn {
    padding: 14px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.08);
    font-family: 'Nunito', sans-serif;
    font-size: 18px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.85);
    cursor: pointer;
    transition: all 0.2s;
}

.age-btn:hover {
    border-color: #667eea;
    color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

.age-btn.selected {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border-color: transparent;
    transform: scale(1.05);
}

/* Сетка вариантов */
.options-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.options-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.option-btn {
    padding: 14px 12px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.08);
    font-family: 'Nunito', sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.85);
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.option-btn.wide {
    font-size: 15px;
}

.option-btn:hover {
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

.option-btn.selected {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border-color: transparent;
    transform: scale(1.03);
}

/* Слайдер лет */
.years-display {
    text-align: center;
    margin-bottom: 10px;
}

.years-big {
    font-size: 52px;
    font-weight: 800;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
}

.years-label {
    display: block;
    font-size: 18px;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 600;
    margin-top: 4px;
}

.slider-wrapper {
    padding: 0 8px;
}

input[type="range"] {
    width: 100%;
    height: 8px;
    -webkit-appearance: none;
    appearance: none;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 10px;
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 28px;
    height: 28px;
    background: white;
    border: 3px solid #667eea;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s;
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.15);
}

.slider-labels {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.45);
    margin-top: 8px;
}

/* Факт */
.fun-fact {
    margin-top: 10px;
    padding: 10px 14px;
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    border-radius: 12px;
    font-size: 13px;
    color: #92400e;
    text-align: center;
    min-height: 38px;
    transition: all 0.3s;
}

/* Результаты */
.result-card {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 20px;
    margin: 16px 0;
}

.result-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.result-item:last-child {
    border-bottom: none;
}

.result-emoji {
    font-size: 24px;
    flex-shrink: 0;
}

.result-info {
    flex: 1;
}

.result-label {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.result-value {
    font-size: 16px;
    color: #ffffff;
    font-weight: 700;
}

.restart-btn {
    display: block;
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    border-radius: 14px;
    font-family: 'Nunito', sans-serif;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    margin-top: 8px;
}

.restart-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

/* ====== ПОЗДРАВЛЕНИЕ ====== */
.congrats-header {
    text-align: center;
    margin-bottom: 16px;
    animation: congratsPop 0.6s ease;
}

@keyframes congratsPop {
    0% { opacity: 0; transform: scale(0.5); }
    60% { transform: scale(1.1); }
    100% { opacity: 1; transform: scale(1); }
}

.congrats-emoji {
    font-size: 40px;
    animation: congratsBounce 1s ease-in-out infinite;
}

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

.congrats-title {
    font-size: 26px;
    font-weight: 800;
    color: #ffd700;
    margin: 6px 0 2px;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
}

.congrats-text {
    font-size: 15px;
    color: rgba(255, 255, 255, 0.7);
}

/* ====== ГРАМОТА ====== */
.diploma {
    animation: diplomaAppear 0.8s ease;
}

@keyframes diplomaAppear {
    from { opacity: 0; transform: scale(0.8) rotate(-2deg); }
    to { opacity: 1; transform: scale(1) rotate(0); }
}

.diploma-border {
    background: linear-gradient(135deg, #ffd700, #f5a623, #ffd700, #e8a317);
    border-radius: 16px;
    padding: 4px;
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.3), inset 0 0 20px rgba(255, 215, 0, 0.1);
}

.diploma-inner {
    background: linear-gradient(180deg, #1a1040 0%, #0f0a2e 50%, #1a1040 100%);
    border-radius: 13px;
    padding: 28px 22px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.diploma-inner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(ellipse at 20% 20%, rgba(255, 215, 0, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(102, 126, 234, 0.06) 0%, transparent 50%);
    pointer-events: none;
}

.diploma-stars {
    color: #ffd700;
    font-size: 16px;
    letter-spacing: 12px;
    margin: 6px 0;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.diploma-subtitle {
    font-size: 13px;
    font-weight: 700;
    color: rgba(255, 215, 0, 0.8);
    letter-spacing: 4px;
    margin-top: 10px;
    text-transform: uppercase;
}

.diploma-name {
    font-size: 30px;
    font-weight: 800;
    color: #ffd700;
    margin: 10px 0;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
    line-height: 1.2;
    word-break: break-word;
}

.diploma-divider {
    width: 60%;
    height: 1px;
    margin: 12px auto;
    background: linear-gradient(90deg, transparent, #ffd700, transparent);
}

.diploma-body {
    font-size: 15px;
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.6;
    margin-bottom: 16px;
}

.diploma-body strong {
    color: #ffd700;
}

.diploma-details {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-bottom: 16px;
}

.diploma-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 215, 0, 0.25);
}

.diploma-badge .badge-icon {
    font-size: 15px;
}

.diploma-quote {
    font-size: 12px;
    font-style: italic;
    color: rgba(255, 255, 255, 0.4);
    margin-bottom: 14px;
    padding: 0 10px;
    line-height: 1.5;
}

.diploma-compliment {
    margin: 10px 0;
    padding: 10px 14px;
    background: rgba(255, 215, 0, 0.08);
    border: 1px solid rgba(255, 215, 0, 0.2);
    border-radius: 10px;
    font-size: 14px;
    color: rgba(255, 215, 0, 0.9);
    line-height: 1.5;
    text-align: center;
}

.diploma-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 8px;
    padding: 0 8px;
}

.diploma-date {
    font-size: 12px;
    color: rgba(255, 215, 0, 0.6);
}

.diploma-seal {
    font-size: 32px;
    animation: sealPulse 2s ease-in-out infinite;
}

@keyframes sealPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1) rotate(5deg); }
}

/* Навигация */
.nav-buttons {
    display: flex;
    justify-content: space-between;
    margin-top: 16px;
    gap: 12px;
}

.btn {
    padding: 14px 28px;
    border: none;
    border-radius: 14px;
    font-family: 'Nunito', sans-serif;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-back {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    flex: 1;
}

.btn-back:hover {
    background: rgba(255, 255, 255, 0.3);
}

.btn-next {
    background: white;
    color: #667eea;
    flex: 1;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.btn-next:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none !important;
}

/* Конфетти */
#confettiCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 100;
}

/* Фоновые круги */
body::before,
body::after {
    content: '';
    position: fixed;
    border-radius: 50%;
    z-index: 0;
}

body::before {
    width: 300px;
    height: 300px;
    background: rgba(255, 255, 255, 0.08);
    top: -100px;
    right: -80px;
}

body::after {
    width: 400px;
    height: 400px;
    background: rgba(255, 255, 255, 0.05);
    bottom: -150px;
    left: -120px;
}

/* Адаптив */
@media (max-width: 480px) {
    .survey-card {
        padding: 28px 20px;
    }

    .step h2 {
        font-size: 20px;
    }

    .options-grid {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .option-btn {
        padding: 12px 8px;
        font-size: 13px;
    }

    .years-big {
        font-size: 52px;
    }
}
