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

:root {
    --primary-color: #A8D5E2;
    --primary-dark: #8BC5D8;
    --secondary-color: #F5C2D1;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --bg-color: #f8fafc;
    --text-color: #1e293b;
    --text-light: #64748b;
    --primary-color-text: #64748b;
    --border-color: #e2e8f0;
    --card-bg: #ffffff;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
}

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

/* навигация */
.navbar {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: var(--text-color);
    padding: 1rem 0;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: nowrap;
}

.user-display {
    margin-left: auto;
    flex-shrink: 0;
    white-space: nowrap;
}

.user-name-display:hover {
    background-color: rgba(255, 255, 255, 0.3) !important;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    font-weight: bold;
    white-space: nowrap;
    flex-shrink: 0;
}

.logo img {
    height: 40px;
    width: auto;
    object-fit: contain;
    display: block;
}

.logo span {
    color: var(--text-color);
}

.logo-link {
    text-decoration: none;
    color: var(--text-color);
    cursor: pointer;
    transition: opacity 0.3s;
}

.logo-link:hover {
    opacity: 0.8;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 0.5rem;
    flex: 1;
    justify-content: center;
    flex-wrap: nowrap;
    min-width: 0;
}

.nav-menu li {
    white-space: nowrap;
}

.nav-link {
    color: var(--text-color);
    text-decoration: none;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    transition: background-color 0.3s;
    font-size: 0.95rem;
    white-space: nowrap;
}

.nav-link:hover,
.nav-link.active {
    background-color: rgba(255, 255, 255, 0.4);
}

/* херосима */
.hero {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: var(--text-color);
    padding: 4rem 0;
    text-align: center;
}

.hero-title {
    font-size: 3rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.hero-subtitle {
    font-size: 1.25rem;
    opacity: 0.9;
}

/* карточки в инфе */
.features {
    padding: 4rem 0;
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
    color: var(--text-color);
}

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

.feature-card {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
    text-align: center;
    transition: transform 0.3s, box-shadow 0.3s;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 80px;
}

.feature-icon img {
    width: 80px;
    height: 80px;
    object-fit: contain;
}

.feature-card h3 {
    margin-bottom: 1rem;
    color: var(--primary-color-text);
}

/* инфо */
.info-section {
    padding: 4rem 0;
    background: var(--card-bg);
}

.info-content {
    max-width: 800px;
    margin: 0 auto;
}

.info-list {
    margin-top: 1rem;
    padding-left: 2rem;
}

.info-list li {
    margin-bottom: 0.5rem;
    color: var(--text-light);
}

/* CTA Section */
.cta-section {
    padding: 4rem 0;
    text-align: center;
}

.cta-text {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    color: var(--text-light);
}

.cta-button {
    display: inline-block;
    background: var(--primary-color);
    color: var(--text-color);
    padding: 1rem 2rem;
    border-radius: 8px;
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 600;
    transition: background-color 0.3s, transform 0.3s;
}

.cta-button:hover {
    background: var(--primary-dark);
    transform: scale(1.05);
    color: var(--text-color);
}

/* стиль страничек */
.main-content {
    min-height: calc(100vh - 200px);
    padding: 2rem 0;
}

.page-title {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    text-align: center;
    color: var(--text-color);
}

.page-description {
    text-align: center;
    color: var(--text-light);
    margin-bottom: 2rem;
    font-size: 1.1rem;
}

/* диагностика */
.diagnostics-container {
    max-width: 900px;
    margin: 0 auto;
}

.test-info {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
}

.test-info h2 {
    margin-bottom: 1rem;
    color: var(--primary-color-text);
}

.instructions-list {
    padding-left: 2rem;
}

.instructions-list li {
    margin-bottom: 0.5rem;
    color: var(--text-light);
}

.test-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 12px;
    text-align: center;
    box-shadow: var(--shadow);
}

.stat-label {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary-color-text);
}

.test-controls {
    text-align: center;
    margin-bottom: 2rem;
}

.test-content-wrapper {
    display: flex;
    gap: 2rem;
    margin-bottom: 2rem;
    align-items: flex-start;
    flex-wrap: wrap;
}

.schulte-container {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
    position: relative;
    min-height: 400px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    overflow: visible;
    flex: 1;
    min-width: 400px;
}

.video-container {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
    position: relative;
    min-height: 400px;
    display: flex;
    justify-content: center;
    align-items: center;
    flex: 1;
    min-width: 400px;
}

.video-wrapper {
    position: relative;
    width: 100%;
    max-width: 1280px;
    aspect-ratio: 16 / 9;
    overflow: hidden;
}

.video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* Fallback for browsers that don't support aspect-ratio */
@supports not (aspect-ratio: 16 / 9) {
    .video-wrapper {
        padding-bottom: 56.25%; /* 16:9 aspect ratio */
        height: 0;
    }
}

.results-container {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
    margin-top: 2rem;
}

.results-list {
    margin-bottom: 1rem;
}

.final-result {
    text-align: center;
    padding: 1rem;
    background: var(--bg-color);
    border-radius: 8px;
    margin-bottom: 1rem;
}

/* кнопки */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    margin: 0.5rem;
}

.btn-primary {
    background: var(--primary-color);
    color: var(--text-color);
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: scale(1.05);
    color: var(--text-color);
}

.btn-secondary {
    background: var(--text-light);
    color: white;
}

.btn-secondary:hover {
    background: var(--text-color);
}

.btn-success {
    background: var(--success-color);
    color: white;
}

.btn-success:hover {
    background: #059669;
}

/* грид заданий */
.exercises-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.exercise-card {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: 100px 1fr 1fr 2fr;
    margin-top: 2rem;
    margin-bottom: 2rem;
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
    text-align: center;
    transition: transform 0.3s, box-shadow 0.3s;
}

.exercise-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.exercise-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100px;
}

.exercise-icon img {
    width: 100px;
    height: 100px;
    object-fit: contain;
}

.exercise-card h3 {
    margin-bottom: 0.5rem;
    color: var(--primary-color-text);
}

.exercise-desc {
    color: var(--text-light);
    margin-bottom: 1rem;
    min-height: 60px;
}

/* окно */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    overflow: auto;
}

.modal-content {
    background-color: var(--card-bg);
    margin: 5% auto;
    padding: 2rem;
    border-radius: 12px;
    width: 90%;
    max-width: 800px;
    box-shadow: var(--shadow-lg);
    position: relative;
}

.close-modal {
    position: absolute;
    right: 1rem;
    top: 1rem;
    font-size: 2rem;
    font-weight: bold;
    color: var(--text-light);
    cursor: pointer;
    transition: color 0.3s;
}

.close-modal:hover {
    color: var(--text-color);
}

/* контент заданий */
.exercise-content {
    padding: 1rem 0;
}

.exercise-stats {
    display: flex;
    justify-content: space-around;
    margin-bottom: 2rem;
    padding: 1rem;
    background: var(--bg-color);
    border-radius: 8px;
}

.exercise-area {
    min-height: 400px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--bg-color);
    border-radius: 8px;
    padding: 2rem;
}

/* вкладка с результатами */
.results-section {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.results-tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    border-bottom: 2px solid var(--border-color);
}

.tab-btn {
    padding: 1rem 2rem;
    border: none;
    background: none;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-light);
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.3s;
}

.tab-btn:hover,
.tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.chart-container {
    margin: 2rem 0;
    padding: 1rem;
    background: var(--bg-color);
    border-radius: 8px;
}

.results-table-container {
    overflow-x: auto;
    margin-top: 2rem;
}

.results-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--card-bg);
}

.results-table th,
.results-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.results-table th {
    background: var(--bg-color);
    font-weight: 600;
    color: var(--primary-color-text);
}

.results-table tr:hover {
    background: var(--bg-color);
}

.no-data {
    text-align: center;
    color: var(--text-light);
    padding: 2rem;
}

/* Сравнение */
.comparison-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.comparison-card {
    background: var(--bg-color);
    padding: 2rem;
    border-radius: 12px;
    text-align: center;
    box-shadow: var(--shadow);
}

.comparison-card.highlight {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: var(--text-color);
}

.comparison-card h3 {
    margin-bottom: 1rem;
}

.comparison-value {
    font-size: 3rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

/* Footer */
.footer {
    background: var(--text-color);
    color: white;
    text-align: center;
    padding: 2rem 0;
    margin-top: 4rem;
}

/* Responsive */
@media (max-width: 768px) {
    .nav-menu {
        flex-direction: column;
        gap: 0.5rem;
    }

    .hero-title {
        font-size: 2rem;
    }

    .page-title {
        font-size: 2rem;
    }

    .test-stats {
        grid-template-columns: 1fr;
    }

    .exercises-grid {
        grid-template-columns: 1fr;
    }

    .test-content-wrapper {
        flex-direction: column;
    }

    .schulte-container,
    .video-container {
        min-width: 100%;
        width: 100%;
    }
}

/* Окно входа */
.auth-modal {
    display: none;
    position: fixed;
    z-index: 3000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    align-items: center;
    justify-content: center;
}

.auth-modal-content {
    background-color: var(--card-bg);
    padding: 2rem;
    border-radius: 12px;
    max-width: 400px;
    width: 90%;
    box-shadow: var(--shadow-lg);
}

.auth-modal-content h2 {
    margin-bottom: 1rem;
    color: var(--primary-color-text);
}

.auth-modal-content p {
    margin-bottom: 1.5rem;
    color: var(--text-light);
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-color);
    font-weight: 600;
}

.form-group input {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Табличечка шульте */
.schulte-table {
    margin: 2rem auto;
}

.schulte-cell {
    user-select: none;
}

.schulte-cell:active {
    transform: scale(0.95) !important;
}

/* Фидбэк результаты */
.feedback-card {
    padding: 1.5rem;
    border-radius: 12px;
    margin: 2rem 0;
    text-align: center;
    border-left: 5px solid transparent;
    background: var(--card-bg);
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
}

.feedback-card h3 {
    margin-bottom: 0.5rem;
    font-size: 1.5rem;
}

.feedback-card p {
    color: var(--text-color);
    margin-bottom: 1rem;
}

.recommendation-box {
    margin-top: 1rem;
    font-style: italic;
    color: var(--text-light);
    background: rgba(0,0,0,0.03); /* Очень легкий серый фон */
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid rgba(0,0,0,0.05);
}

/* Success State (До 60 секунд) - Зеленый */
.feedback-card.success {
    border-left-color: var(--success-color);
    background: linear-gradient(to right, rgba(16, 185, 129, 0.08), var(--card-bg));
}
.feedback-card.success h3 {
    color: var(--success-color);
}

/* Warning State (Больше 60 секунд) - Желтый/Оранжевый */
.feedback-card.warning {
    border-left-color: var(--warning-color);
    background: linear-gradient(to right, rgba(245, 158, 11, 0.08), var(--card-bg));
}
.feedback-card.warning h3 {
    color: var(--warning-color);
}