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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #1a1a1a;
    background: #f8fafc;
    overflow-x: hidden;
}

/* Mobile-first header */
.header {
    background: white;
    padding: 12px 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 20px;
    font-weight: 700;
    color: #2563eb;
    display: flex;
    align-items: center;
    gap: 6px;
}

.logo::before {
    content: '🧠';
    font-size: 24px;
}

.rating-badge {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: #666;
    background: #f1f5f9;
    padding: 4px 8px;
    border-radius: 12px;
}

.stars {
    color: #fbbf24;
    font-size: 14px;
}

/* Hero section - mobile first */
.hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 80px 0 60px 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="20" cy="20" r="1" fill="rgba(255,255,255,0.1)"/><circle cx="80" cy="80" r="1" fill="rgba(255,255,255,0.1)"/><circle cx="40" cy="60" r="1" fill="rgba(255,255,255,0.1)"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    opacity: 0.3;
}

.hero-content {
    position: relative;
    z-index: 2;
}

.hero h1 {
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 16px;
    line-height: 1.2;
}

.hero-highlight {
    background: linear-gradient(90deg, #fbbf24, #f59e0b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero p {
    font-size: 16px;
    margin-bottom: 32px;
    opacity: 0.9;
    line-height: 1.5;
}

.cta-button {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    border: none;
    padding: 16px 32px;
    font-size: 18px;
    font-weight: 700;
    border-radius: 12px;
    cursor: pointer;
    transition: transform 0.2s ease;
    box-shadow: 0 8px 24px rgba(16, 185, 129, 0.4);
    width: 100%;
    max-width: 300px;
    margin-bottom: 24px;
    display: block;
    margin-left: auto;
    margin-right: auto;
    animation: pulseGreenButton 1.8s ease-in-out infinite;
}

.cta-button:hover {
    animation-play-state: paused;
    transform: scale(1.03);
}

@keyframes pulseGreenButton {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 8px 24px rgba(16, 185, 129, 0.4);
    }
    50% {
        transform: scale(1.04);
        box-shadow: 0 12px 32px rgba(5, 150, 105, 0.6);
    }
}

.test-stats {
    display: flex;
    justify-content: center;
    gap: 24px;
    flex-wrap: wrap;
    margin-top: 24px;
}

.stat-item {
    text-align: center;
}

.stat-number {
    font-size: 24px;
    font-weight: 800;
    color: #fbbf24;
}

.stat-label {
    font-size: 12px;
    opacity: 0.8;
}

/* Features section */
.features {
    padding: 60px 0;
    background: white;
}

.section-header {
    text-align: center;
    margin-bottom: 48px;
}

.section-title {
    font-size: 24px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 12px;
}

.section-subtitle {
    font-size: 16px;
    color: #475569;
}

.features-grid {
    display: grid;
    gap: 24px;
    grid-template-columns: 1fr;
}

.feature-card {
    background: #f8fafc;
    padding: 24px;
    border-radius: 16px;
    border-left: 4px solid;
    transition: transform 0.3s ease;
    cursor: pointer;
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
}

.feature-card.critical { border-color: #ef4444; }
.feature-card.abstract { border-color: #8b5cf6; }
.feature-card.verbal { border-color: #f59e0b; }
.feature-card.numerical { border-color: #3b82f6; }
.feature-card.logical { border-color: #10b981; }

.feature-icon {
    font-size: 24px;
    margin-bottom: 8px;
}

.feature-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 6px;
    color: #1a1a1a;
}

.feature-description {
    font-size: 13px;
    color: #475569;
    line-height: 1.4;
}

/* Social proof section */
.social-proof {
    padding: 60px 0;
    background: #f1f5f9;
}

.reviews-grid {
    display: grid;
    gap: 20px;
    grid-template-columns: 1fr;
}

.review-card {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.review-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.reviewer-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 14px;
    overflow: hidden;
    position: relative;
}

.reviewer-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.reviewer-avatar .initials {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.reviewer-name {
    font-size: 14px;
    font-weight: 600;
    color: #1a1a1a;
}

.review-stars {
    color: #fbbf24;
    font-size: 14px;
    margin-bottom: 8px;
}

.review-text {
    font-size: 14px;
    color: #475569;
    line-height: 1.5;
}

/* Test interface styles */
.test-section {
    display: none;
    min-height: 100vh;
    background: #f8fafc;
    padding: 64px 0 20px 0;
}

.test-section.active {
    display: block;
}

.progress-container {
    margin-bottom: 14px;
}

.progress-header {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 10px;
    gap: 12px;
    flex-wrap: wrap;
}

.question-counter {
    font-size: 13px;
    color: #64748b;
    font-weight: 600;
    order: 2;
}

.category-badge {
    background: #3b82f6;
    color: white;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    order: 1;
    margin: 0 auto;
}

.progress-bar {
    width: 70%;
    height: 6px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
    margin: 0 auto;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6, #8b5cf6);
    transition: width 0.3s ease;
    border-radius: 4px;
}

.question-card {
    background: white;
    border-radius: 16px;
    padding: 22px 18px;
    margin: 0 auto;
    max-width: 600px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.08);
}

.question-text {
    font-size: 17px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 16px;
    line-height: 1.4;
    text-align: left;
}

.options-grid {
    display: grid;
    gap: 10px;
}

.option-button {
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    padding: 13px 16px;
    border-radius: 11px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 15px;
    text-align: left;
    color: #1a1a1a;
    font-weight: 500;
    line-height: 1.35;
}

.option-button:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.option-button.selected {
    background: #dbeafe;
    border-color: #3b82f6;
    color: #1e40af;
    font-weight: 600;
}

/* Popups */
.popup-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    z-index: 3000;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

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

.popup-content {
    background: white;
    border-radius: 16px;
    padding: 32px 24px;
    max-width: 400px;
    width: 100%;
    text-align: center;
    animation: popupSlideIn 0.4s ease-out;
    position: relative;
}

.close-popup {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #64748b;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.close-popup:hover {
    background: #f1f5f9;
    color: #1a1a1a;
}

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

.popup-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.popup-title {
    font-size: 20px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 12px;
    line-height: 1.3;
}

.popup-text {
    font-size: 14px;
    color: #64748b;
    margin-bottom: 24px;
    line-height: 1.5;
}

.popup-button {
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    animation: pulseButton 1.8s ease-in-out infinite;
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.4);
    transition: transform 0.2s ease;
}

.popup-button:hover {
    animation-play-state: paused;
    transform: scale(1.03);
}

@keyframes pulseButton {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 4px 16px rgba(59, 130, 246, 0.4);
    }
    50% {
        transform: scale(1.04);
        box-shadow: 0 8px 28px rgba(139, 92, 246, 0.6);
    }
}

/* Results animation */
.results-animation {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #f8fafc;
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.results-animation.active {
    display: flex;
}

.animation-card {
    background: white;
    border-radius: 16px;
    padding: 26px 20px;
    max-width: 400px;
    width: 100%;
    text-align: center;
    box-shadow: 0 6px 20px rgba(0,0,0,0.08);
}

.animation-title {
    font-size: 19px;
    font-weight: 700;
    margin-bottom: 6px;
    color: #1a1a1a;
}

.animation-text {
    font-size: 13px;
    color: #64748b;
    margin-bottom: 18px;
}

.features-checklist {
    display: grid;
    gap: 8px;
    margin-bottom: 14px;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: #f8fafc;
    border-radius: 10px;
    transition: all 0.3s ease;
    font-size: 14px;
}

.feature-item.completed {
    background: #dbeafe;
    color: #1e40af;
}

.feature-checkbox {
    width: 20px;
    height: 20px;
    border: 2px solid #cbd5e1;
    border-radius: 4px;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: white;
}

.feature-checkbox.checked {
    background: #10b981;
    border-color: #10b981;
}

.analyzing-text {
    color: #3b82f6;
    font-size: 14px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

@keyframes iqPulse {
    0%, 100% { 
        opacity: 0.75;
        transform: scale(1);
    }
    50% { 
        opacity: 1;
        transform: scale(1.08);
    }
}

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

@keyframes timerUrgent {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.75;
    }
}

@keyframes fillBar {
    from { width: 0%; }
}

/* Message animation */
.message-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #10b981;
    color: white;
    padding: 16px 20px;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(16, 185, 129, 0.3);
    z-index: 3000;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    transform: translateX(300px);
    opacity: 0;
    transition: all 0.4s ease;
}

.message-notification.show {
    transform: translateX(0);
    opacity: 1;
}

.message-notification.hide {
    transform: translateX(300px);
    opacity: 0;
}

.phone-form {
    display: none;
    background: white;
    border-radius: 16px;
    padding: 24px 20px;
    max-width: 400px;
    margin: 64px auto 20px auto;
    box-shadow: 0 6px 20px rgba(0,0,0,0.08);
    min-height: auto;
}

.phone-form.active {
    display: block;
}

.form-title {
    font-size: 20px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 8px;
    color: #1a1a1a;
}

.form-description {
    font-size: 14px;
    color: #64748b;
    text-align: center;
    margin-bottom: 18px;
    line-height: 1.45;
}

.phone-input {
    width: 100%;
    padding: 14px 16px;
    font-size: 16px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    margin-bottom: 14px;
    transition: border-color 0.3s ease;
}

.phone-input:focus {
    outline: none;
    border-color: #3b82f6;
}

.phone-input.error {
    border-color: #ef4444;
    background-color: #fef2f2;
}

.trust-indicators {
    background: #f8fafc;
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 16px;
}

.trust-item {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    color: #64748b;
    margin-bottom: 8px;
}

.trust-item:last-child {
    margin-bottom: 0;
}

.trust-icon {
    font-size: 16px;
}

/* Tablet styles */
@media (min-width: 640px) {
    .container {
        padding: 0 24px;
    }
    
    .hero h1 {
        font-size: 36px;
    }
    
    .hero p {
        font-size: 18px;
    }
    
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .reviews-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .test-stats {
        gap: 32px;
    }
    
    .question-card {
        padding: 40px 32px;
    }
    
    .question-text {
        font-size: 22px;
    }
}

/* Desktop styles */
@media (min-width: 1024px) {
    .container {
        padding: 0 32px;
    }
    
    .hero {
        padding: 120px 0 80px 0;
    }
    
    .hero h1 {
        font-size: 48px;
    }
    
    .hero p {
        font-size: 20px;
        max-width: 600px;
        margin-left: auto;
        margin-right: auto;
    }
    
    .cta-button {
        max-width: 280px;
        font-size: 20px;
        padding: 18px 36px;
    }
    
    .features-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .reviews-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .section-title {
        font-size: 32px;
    }
    
    .section-subtitle {
        font-size: 18px;
    }
    
    .question-card {
        max-width: 700px;
        padding: 48px 40px;
    }
    
    .question-text {
        font-size: 24px;
    }
    
    .popup-content {
        max-width: 500px;
        padding: 40px 32px;
    }
    
    .animation-card {
        max-width: 500px;
        padding: 40px 32px;
    }
    
    .phone-form {
        max-width: 500px;
        padding: 40px 32px;
    }
}
/* ===== Визуальные задания (inline SVG) ===== */
.question-visual {
    margin: 0 0 18px 0;
}

.q-figures {
    display: grid;
    gap: 8px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 12px;
}

.q-figures-row {
    grid-template-columns: repeat(4, 1fr);
    max-width: 340px;
    margin: 0 auto;
}

.q-figures-matrix {
    grid-template-columns: repeat(3, 1fr);
    max-width: 270px;
    margin: 0 auto;
}

.q-cell {
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    display: block;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}

.q-cell-unknown {
    background: #f1f5f9;
    border-style: dashed;
    border-color: #cbd5e1;
}

.options-grid.options-visual {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.option-button.option-visual {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    min-height: 92px;
}

.option-button.option-visual .q-cell {
    max-width: 68px;
    border: none;
    background: transparent;
}

@media (min-width: 768px) {
    .options-grid.options-visual {
        grid-template-columns: repeat(4, 1fr);
    }

    .q-figures-row {
        max-width: 420px;
    }

    .q-figures-matrix {
        max-width: 330px;
    }

    .option-button.option-visual .q-cell {
        max-width: 80px;
    }

    .option-button.option-visual .option-photo {
        max-width: 80px;
        max-height: 80px;
    }
}

/* ===== Задания из API (survey): клетки-картинки и карточки вариантов ===== */
.q-cell-photo {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
    overflow: hidden;
}

.q-cell-photo img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
}

.q-mark {
    font-size: 30px;
    font-weight: 700;
    color: #94a3b8;
}

.option-button.option-visual .option-photo {
    max-width: 68px;
    max-height: 68px;
    object-fit: contain;
    display: block;
}

/* Вопрос со свободным ответом (type: text) */
.survey-textarea {
    width: 100%;
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 11px;
    padding: 13px 16px;
    font: inherit;
    font-size: 15px;
    color: #1a1a1a;
    line-height: 1.35;
    resize: vertical;
}

/* Consent checkbox (join page) */
.consent {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin: 4px 0 16px 0;
    cursor: pointer;
    text-align: left;
}

.consent input {
    margin-top: 3px;
    flex-shrink: 0;
}

.consent span {
    font-size: 11px;
    color: #94a3b8;
    line-height: 1.45;
}
