/* Общие стили */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #4A90E2;
    --secondary-color: #50C878;
    --accent-color: #5B9BD5;
    --background-color: #E8F4F8;
    --card-background: rgba(255, 255, 255, 0.95);
    --text-color: #2C3E50;
    --text-light: #7F8C8D;
    --border-color: #BDC3C7;
    --success-color: #27AE60;
    --warning-color: #F39C12;
    --error-color: #E74C3C;
    --shadow: 0 8px 32px rgba(74, 144, 226, 0.15);
    --shadow-hover: 0 12px 48px rgba(74, 144, 226, 0.25);
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-secondary: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --gradient-success: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --gradient-background: linear-gradient(135deg, #667eea 0%, #764ba2 25%, #f093fb 50%, #4facfe 75%, #00f2fe 100%);
    --glass-bg: rgba(255, 255, 255, 0.25);
    --glass-border: rgba(255, 255, 255, 0.18);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #E8F4F8 0%, #D4EDDA 100%);
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    word-wrap: break-word;
    position: relative;
}

#app {
    min-height: 100vh;
    position: relative;
    z-index: 1;
    perspective: 1000px;
}

/* Экраны */
.screen {
    display: none !important;
    min-height: 100vh;
    padding: 15px;
    animation: screenFadeIn 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    box-sizing: border-box;
    overflow-x: hidden;
    position: relative;
}

.screen.active {
    display: block !important;
}

/* Экран входа */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
    position: relative;
    z-index: 1;
}

.login-card {
    width: 100%;
    max-width: 450px;
    background: var(--card-background);
    padding: 40px 30px;
    border-radius: 20px;
    box-shadow: var(--shadow-hover);
    position: relative;
    animation: fadeIn 0.5s ease;
}

.login-header {
    text-align: center;
    margin-bottom: 40px;
    position: relative;
    z-index: 1;
}

.login-header h1 {
    color: var(--primary-color);
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 12px;
}

.login-header p {
    color: var(--text-light);
    font-size: 16px;
}

.login-form {
    position: relative;
    z-index: 1;
}

.login-helper {
    margin-top: 15px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-light);
}

.login-helper-link {
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    color: var(--primary-color);
    font-weight: 600;
    cursor: pointer;
    text-decoration: underline;
}

.login-helper-link:hover {
    color: var(--accent-color);
}

.input-group {
    position: relative;
    margin-bottom: 25px;
}

.input-group label {
    display: block;
    color: var(--text-color);
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
    transition: all 0.3s ease;
}

.input-group input {
    width: 100%;
    padding: 15px 45px 15px 15px;
    background: var(--card-background);
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-size: 16px;
    color: var(--text-color);
    transition: all 0.3s ease;
    box-sizing: border-box;
    outline: none;
}

.input-group input::placeholder {
    color: var(--text-light);
}

.input-group input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

.input-group.focused label {
    color: var(--primary-color);
    transform: translateX(5px);
}

.input-icon {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 20px;
    pointer-events: none;
    transition: all 0.3s ease;
    margin-top: 12px;
}

.input-group input:focus + .input-icon {
    transform: translateY(-50%) scale(1.2) rotate(5deg);
}

.btn-login {
    width: 100%;
    padding: 18px;
    font-size: 18px;
    font-weight: 700;
    margin-top: 10px;
    position: relative;
    overflow: hidden;
}

.btn-login span {
    position: relative;
    z-index: 1;
}

.btn-loader {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-left: 10px;
    vertical-align: middle;
}

.error-message {
    background: rgba(231, 76, 60, 0.15);
    border: 2px solid rgba(231, 76, 60, 0.5);
    color: var(--error-color);
    padding: 15px;
    border-radius: 12px;
    margin-bottom: 20px;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    animation: errorShake 0.5s ease;
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.2);
}

@keyframes errorShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

.login-form.shake {
    animation: formShake 0.5s ease;
}

@keyframes formShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

@keyframes screenFadeIn {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95) rotateX(5deg);
        filter: blur(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1) rotateX(0deg);
        filter: blur(0);
    }
}

.container {
    max-width: 600px;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
    padding: 0 10px;
}

/* Загрузка */
#loading-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 5px solid rgba(255, 255, 255, 0.2);
    border-top-color: #667eea;
    border-right-color: #764ba2;
    border-bottom-color: #f093fb;
    border-left-color: #4facfe;
    border-radius: 50%;
    animation: spin3D 1s linear infinite;
    position: relative;
    box-shadow: 0 0 30px rgba(102, 126, 234, 0.5);
}

.loading-spinner::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 30px;
    height: 30px;
    border: 3px solid rgba(102, 126, 234, 0.3);
    border-top-color: #667eea;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    animation: spin3D 0.5s linear infinite reverse;
}

@keyframes spin3D {
    to { 
        transform: rotate(360deg) rotateY(15deg);
    }
}

/* Заголовки */
.header {
    text-align: center;
    margin-bottom: 30px;
    padding: 25px 20px;
    background: var(--card-background);
    border-radius: 15px;
    box-shadow: var(--shadow);
    box-sizing: border-box;
    transition: all 0.3s ease;
}

.header:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.header h1 {
    color: var(--primary-color);
    font-size: 28px;
    margin-bottom: 10px;
    font-weight: 700;
}

.subtitle {
    color: var(--text-light);
    font-size: 16px;
}

/* Секция пользователя - Личный кабинет */
.user-section {
    margin-bottom: 20px;
}

.user-profile-card {
    background: var(--card-background);
    border-radius: 15px;
    box-shadow: var(--shadow);
    overflow: hidden;
    box-sizing: border-box;
}

.user-profile-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-color) 100%);
    cursor: pointer;
    transition: all 0.3s ease;
}

.user-profile-header:hover {
    background: linear-gradient(135deg, var(--accent-color) 0%, var(--primary-color) 100%);
}

.user-profile-header h3 {
    color: white;
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.btn-icon {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.user-profile-content {
    padding: 20px;
    animation: slideDown 0.3s ease;
}

/* История результатов: используем обычную прокрутку страницы */
#results-list {
    padding-right: 4px;
}

.user-profile-content .results-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid var(--background-color);
}

.user-profile-content .results-section h4 {
    color: var(--primary-color);
    margin-bottom: 15px;
    font-size: 18px;
    font-weight: 600;
}

@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
    }
    to {
        opacity: 1;
        max-height: 500px;
    }
}

.user-greeting {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.user-greeting p {
    color: var(--text-color);
    font-weight: 600;
    font-size: 16px;
    margin: 0;
}

.user-status {
    color: var(--text-light);
    font-size: 14px;
    margin-bottom: 15px;
    text-align: center;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 14px;
}

.user-info-section {
    width: 100%;
}

.btn-group {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    flex-wrap: wrap;
}

/* Кнопки */
.btn {
    padding: 14px 28px;
    border: none;
    border-radius: 15px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    display: inline-block;
    text-align: center;
    position: relative;
    overflow: hidden;
    transform-style: preserve-3d;
    box-shadow: 
        0 4px 15px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--accent-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.btn-secondary {
    background: var(--secondary-color);
    color: white;
}

.btn-secondary:hover {
    background: #45B869;
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.btn-success {
    background: var(--success-color);
    color: white;
}

.btn-success:hover {
    background: #229954;
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.btn-back {
    background: rgba(74, 144, 226, 0.9);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: 12px;
    color: #ffffff;
    font-size: 18px;
    cursor: pointer;
    padding: 12px 18px;
    margin-bottom: 20px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 600;
    position: relative;
    overflow: hidden;
}

.btn-back::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-back:hover::before {
    width: 200px;
    height: 200px;
}

.btn-back:hover {
    color: #ffffff;
    background: rgba(52, 122, 201, 0.95);
    transform: translateX(-5px) scale(1.05);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

/* Сетка тестов */
.tests-section {
    margin-bottom: 30px;
}

.tests-section h2 {
    color: var(--text-color);
    margin-bottom: 20px;
    font-size: 24px;
}

.tests-grid {
    display: grid;
    gap: 15px;
}

.test-card {
    background: var(--card-background);
    padding: 20px;
    border-radius: 15px;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: all 0.3s ease;
    border-left: 4px solid var(--primary-color);
    box-sizing: border-box;
    word-wrap: break-word;
}

.test-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
}

.test-card h3 {
    color: var(--primary-color);
    margin-bottom: 10px;
    font-size: 20px;
    font-weight: 600;
}

.test-card p {
    color: var(--text-light);
    margin-bottom: 15px;
    font-size: 14px;
    line-height: 1.6;
}

.test-meta {
    display: flex;
    gap: 15px;
    font-size: 12px;
    color: var(--text-light);
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.test-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Экран теста */
.test-header {
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 25px;
    border-radius: 25px;
    margin-bottom: 25px;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.3);
    position: relative;
    overflow: hidden;
}

.test-header h2 {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 12px;
    font-size: 24px;
    font-weight: 700;
    position: relative;
    z-index: 1;
}

.test-header p {
    color: var(--text-light);
    font-size: 14px;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--background-color);
    border-radius: 10px;
    margin-bottom: 10px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    transition: width 0.3s ease;
    border-radius: 10px;
}

.progress-text {
    text-align: center;
    color: var(--text-color);
    font-size: 14px;
    margin-bottom: 20px;
    font-weight: 600;
}

@keyframes progressTextPulse {
    0%, 100% {
        opacity: 0.9;
    }
    50% {
        opacity: 1;
    }
}

.question-container {
    background: var(--card-background);
    padding: 25px;
    border-radius: 15px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}

.question {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 25px;
    line-height: 1.6;
}

.answers {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.answer-option {
    padding: 15px;
    background: var(--background-color);
    border: 2px solid transparent;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 16px;
    color: var(--text-color);
}

.answer-option:hover {
    background: #D4EDDA;
    border-color: var(--secondary-color);
}

.answer-option.selected {
    background: var(--secondary-color);
    color: white;
    border-color: var(--secondary-color);
}

.test-navigation {
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

.test-navigation .btn {
    flex: 1;
}

/* Экран результатов */
.results-header {
    background: var(--card-background);
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
}

.results-header h2 {
    color: var(--primary-color);
}

.results-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.result-card,
.recommendation-card {
    background: var(--card-background);
    padding: 25px;
    border-radius: 15px;
    box-shadow: var(--shadow);
}

.result-card h3,
.recommendation-card h3 {
    color: var(--primary-color);
    margin-bottom: 15px;
    font-size: 20px;
    font-weight: 600;
}

.result-item {
    margin-bottom: 15px;
    padding: 18px;
    background: rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.4);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.result-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.result-item:hover::before {
    left: 100%;
}

.result-item:hover {
    transform: translateX(5px);
    background: rgba(255, 255, 255, 0.4);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.2);
}

.result-item strong {
    color: var(--text-color);
    display: block;
    margin-bottom: 8px;
    font-weight: 700;
    font-size: 15px;
}

.result-item span {
    color: var(--text-light);
    font-size: 16px;
    font-weight: 600;
}

.recommendation-text {
    line-height: 1.8;
    color: var(--text-color);
    font-size: 16px;
}

/* Стили для форматированных рекомендаций в карточке результатов */
.recommendation-card .recommendation-text-formatted {
    color: var(--text-color);
    font-size: 15px;
    line-height: 1.8;
}

.recommendation-card .recommendation-text-formatted .recommendation-paragraph {
    margin-bottom: 15px;
    line-height: 1.8;
}

.recommendation-card .recommendation-text-formatted .recommendation-section {
    margin: 20px 0;
    padding: 15px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 10px;
    border-left: 4px solid var(--secondary-color);
    font-weight: 600;
    color: var(--text-color);
    font-size: 16px;
}

.recommendation-card .recommendation-text-formatted .recommendation-item {
    margin: 15px 0;
    padding: 15px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 8px;
}

.recommendation-card .recommendation-text-formatted .recommendation-item-title {
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 10px;
    font-size: 16px;
}

.recommendation-card .recommendation-text-formatted .recommendation-list {
    margin: 15px 0;
    padding-left: 25px;
    list-style-type: disc;
}

.recommendation-card .recommendation-text-formatted .recommendation-list li {
    margin-bottom: 10px;
    line-height: 1.7;
}

.recommendation-card .recommendation-text-formatted strong,
.recommendation-card .recommendation-text-formatted .recommendation-bold {
    color: var(--text-color);
    font-weight: 700;
    font-size: 16px;
}

/* Результаты на главном экране */
.results-section {
    margin-top: 30px;
}

.results-section h2 {
    color: var(--text-color);
    margin-bottom: 20px;
    font-size: 24px;
}

.result-summary {
    background: var(--card-background);
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 10px;
    box-shadow: var(--shadow);
    border-left: 4px solid var(--secondary-color);
}

.result-summary h4 {
    color: var(--primary-color);
    margin-bottom: 5px;
}

.result-summary p {
    color: var(--text-light);
    font-size: 14px;
}

/* Сообщение об отсутствии результатов */
.no-results-message {
    background: var(--card-background);
    padding: 40px 20px;
    border-radius: 15px;
    text-align: center;
    box-shadow: var(--shadow);
    border: 2px dashed var(--border-color);
}

.no-results-message p {
    color: var(--text-color);
    font-size: 18px;
    margin-bottom: 10px;
}

.no-results-hint {
    color: var(--text-light) !important;
    font-size: 14px !important;
    font-style: italic;
}

/* Детальные карточки результатов */
.result-card-detailed {
    background: var(--card-background);
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 15px;
    box-shadow: var(--shadow);
    border-left: 4px solid var(--primary-color);
    transition: all 0.3s ease;
    box-sizing: border-box;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.result-card-detailed:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--background-color);
}

.result-header h4 {
    color: var(--primary-color);
    margin: 0;
    font-size: 20px;
}

.result-date {
    color: var(--text-light);
    font-size: 14px;
}

.result-metrics {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.metric-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: var(--background-color);
    border-radius: 10px;
    transition: all 0.3s ease;
}

.metric-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 0.5s;
}

.metric-item:hover::before {
    left: 100%;
}

.metric-item:hover {
    background: #D4EDDA;
    transform: translateX(3px);
}

.metric-item.metric-highlight {
    background: linear-gradient(135deg, #E8F4F8 0%, #D4EDDA 100%);
    border: 2px solid var(--primary-color);
}

.metrics-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.metric-label {
    color: var(--text-color);
    font-weight: 600;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.metric-value {
    color: var(--primary-color);
    font-weight: 700;
    font-size: 16px;
}

.metric-details {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.metric-value.metric-total {
    font-size: 20px;
    color: var(--primary-color);
}

.metric-details {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.metric-level {
    font-size: 12px;
    font-weight: 600;
    text-transform: capitalize;
}

.progress-bar-mini {
    width: 100%;
    height: 6px;
    background: var(--background-color);
    border-radius: 10px;
    margin-top: 8px;
    overflow: hidden;
}

.progress-fill-mini {
    height: 100%;
    border-radius: 10px;
    transition: width 0.3s ease;
}

.result-recommendation-preview {
    margin-bottom: 15px;
    padding: 15px;
    background: var(--background-color);
    border-radius: 10px;
}

.result-recommendation-preview strong {
    color: var(--primary-color);
    display: block;
    margin-bottom: 8px;
}

.result-recommendation-preview p {
    color: var(--text-color);
    font-size: 14px;
    line-height: 1.6;
    margin: 0;
}

/* Полная карточка рекомендации */
.result-recommendation-full-card {
    margin-bottom: 20px;
    padding: 20px;
    background: linear-gradient(135deg, #E8F4F8 0%, #D4EDDA 100%);
    border-radius: 12px;
    border-left: 4px solid var(--secondary-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    box-sizing: border-box;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.recommendation-header {
    margin-bottom: 12px;
}

.recommendation-header strong {
    color: var(--primary-color);
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.recommendation-text-full {
    color: var(--text-color);
    font-size: 15px;
    line-height: 1.8;
    margin: 0;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.recommendation-text-modal {
    color: var(--text-color);
    font-size: 15px;
    line-height: 1.8;
    margin: 0;
}

.recommendation-text-modal-formatted {
    color: var(--text-color);
    font-size: 15px;
    line-height: 1.8;
    margin: 0;
}

.recommendation-text-modal-formatted .recommendation-paragraph {
    margin-bottom: 12px;
    line-height: 1.7;
}

.recommendation-text-modal-formatted .recommendation-section {
    margin: 15px 0;
    padding: 12px;
    background: var(--background-color);
    border-radius: 8px;
    border-left: 3px solid var(--secondary-color);
    font-weight: 600;
    color: var(--primary-color);
}

.recommendation-text-modal-formatted .recommendation-item {
    margin: 12px 0;
    padding: 10px;
    background: var(--background-color);
    border-radius: 6px;
}

.recommendation-text-modal-formatted .recommendation-item-title {
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 6px;
    font-size: 15px;
}

.recommendation-text-modal-formatted .recommendation-list {
    margin: 10px 0;
    padding-left: 20px;
    list-style-type: disc;
}

.recommendation-text-modal-formatted .recommendation-list li {
    margin-bottom: 8px;
    line-height: 1.6;
}

.recommendation-text-modal-formatted strong,
.recommendation-text-modal-formatted .recommendation-bold {
    color: var(--text-color);
    font-weight: 700;
    font-size: 15px;
}

/* Форматированный текст рекомендаций */
.recommendation-text-formatted {
    color: var(--text-color);
    font-size: 14px;
    line-height: 1.7;
    margin: 0;
}

.recommendation-text-formatted .recommendation-paragraph {
    margin-bottom: 12px;
    line-height: 1.7;
}

.recommendation-text-formatted .recommendation-section {
    margin: 15px 0;
    padding: 12px;
    background: var(--background-color);
    border-radius: 8px;
    border-left: 3px solid var(--secondary-color);
    font-weight: 600;
    color: var(--primary-color);
}

.recommendation-text-formatted .recommendation-item {
    margin: 12px 0;
    padding: 10px;
    background: var(--background-color);
    border-radius: 6px;
}

.recommendation-text-formatted .recommendation-item-title {
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 6px;
    font-size: 15px;
}

.recommendation-text-formatted .recommendation-list {
    margin: 10px 0;
    padding-left: 20px;
    list-style-type: disc;
}

.recommendation-text-formatted .recommendation-list li {
    margin-bottom: 8px;
    line-height: 1.6;
    color: var(--text-color);
}

.recommendation-text-formatted strong,
.recommendation-text-formatted .recommendation-bold {
    color: var(--text-color);
    font-weight: 700;
    font-size: 15px;
}

.recommendation-more {
    margin-top: 10px;
    font-style: italic;
    color: var(--text-light);
    font-size: 12px;
}

.recommendation-empty {
    color: var(--text-light);
    font-style: italic;
}

.btn-view-details {
    width: 100%;
    margin-top: 10px;
}

/* Модальное окно для детальных результатов */
.result-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    animation: modalFadeIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        backdrop-filter: blur(0px);
    }
    to {
        opacity: 1;
        backdrop-filter: blur(10px);
    }
}

.modal-content {
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border-radius: 30px;
    max-width: 90%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.3);
    animation: modalSlideUp 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

@keyframes modalSlideUp {
    from {
        transform: translateY(100px) rotateX(15deg) scale(0.8);
        opacity: 0;
        filter: blur(20px);
    }
    to {
        transform: translateY(0) rotateX(0deg) scale(1);
        opacity: 1;
        filter: blur(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

.modal-header h2 {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0;
    font-size: 24px;
    font-weight: 800;
}

.modal-close {
    display: none;
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
    max-height: calc(90vh - 120px);
}

.result-details h3 {
    color: var(--primary-color);
    margin-bottom: 10px;
}

.result-date-full {
    color: var(--text-light);
    margin-bottom: 20px;
    font-size: 14px;
}

.result-scores {
    margin-bottom: 20px;
}

.result-scores h4 {
    color: var(--text-color);
    margin-bottom: 10px;
}

.result-scores-detailed {
    margin-bottom: 25px;
}

.result-scores-detailed h4 {
    color: var(--primary-color);
    margin-bottom: 20px;
    font-size: 20px;
}

/* Детальная сетка результатов */
.detailed-results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.detailed-result-card {
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 25px;
    border-radius: 20px;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-left: 5px solid transparent;
    display: flex;
    align-items: flex-start;
    gap: 18px;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    transform-style: preserve-3d;
}

.detailed-result-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    opacity: 0;
    transition: opacity 0.4s;
    pointer-events: none;
}

.detailed-result-card:hover::after {
    opacity: 1;
}

.detailed-result-card:hover {
    transform: translateY(-8px) rotateX(5deg) scale(1.03);
    box-shadow: 
        0 20px 60px rgba(102, 126, 234, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    border-left-color: #667eea;
}

.detailed-result-card.highlight-card {
    background: linear-gradient(135deg, #E8F4F8 0%, #D4EDDA 100%);
    border-left-color: var(--primary-color);
}

.detailed-card-icon {
    font-size: 40px;
    flex-shrink: 0;
    animation: iconFloat 3s ease-in-out infinite;
    filter: drop-shadow(0 4px 8px rgba(102, 126, 234, 0.3));
}

@keyframes iconFloat {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    50% {
        transform: translateY(-5px) rotate(5deg);
    }
}

.detailed-card-content {
    flex: 1;
}

.detailed-card-label {
    color: var(--text-light);
    font-size: 13px;
    margin-bottom: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.detailed-card-value {
    color: var(--primary-color);
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 5px;
}

@keyframes valuePulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.detailed-card-level {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
    text-transform: capitalize;
}

.detailed-card-description {
    color: var(--text-light);
    font-size: 13px;
    line-height: 1.5;
    margin-top: 5px;
}

.detailed-card-percentage {
    color: var(--text-light);
    font-size: 12px;
    margin-top: 5px;
    font-weight: 600;
}

.detailed-progress-bar {
    width: 100%;
    height: 8px;
    background: var(--background-color);
    border-radius: 10px;
    margin: 10px 0;
    overflow: hidden;
}

.detailed-progress-fill {
    height: 100%;
    border-radius: 10px;
    transition: width 0.5s ease;
}

.result-details-header {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--background-color);
}

.result-details-header h3 {
    color: var(--primary-color);
    margin-bottom: 8px;
    font-size: 24px;
}

.result-date-full {
    color: var(--text-light);
    font-size: 14px;
    margin: 0;
}

.result-recommendation-full {
    margin-top: 20px;
}

.result-recommendation-full h4 {
    color: var(--text-color);
    margin-bottom: 10px;
}

.result-recommendation-full-modal {
    margin-top: 30px;
    padding: 20px;
    background: linear-gradient(135deg, #E8F4F8 0%, #D4EDDA 100%);
    border-radius: 15px;
    border-left: 5px solid var(--secondary-color);
}

.result-recommendation-full-modal h4 {
    color: var(--primary-color);
    margin-bottom: 15px;
    font-size: 18px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.recommendation-text-modal {
    color: var(--text-color);
    font-size: 15px;
    line-height: 1.8;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.recommendation-text-modal-formatted {
    color: var(--text-color);
    font-size: 15px;
    line-height: 1.8;
}

.recommendation-text-modal-formatted .recommendation-paragraph {
    margin-bottom: 15px;
    line-height: 1.8;
}

.recommendation-text-modal-formatted .recommendation-section {
    margin: 15px 0;
    padding: 12px;
    background: var(--background-color);
    border-radius: 8px;
    border-left: 3px solid var(--secondary-color);
    font-weight: 600;
    color: var(--primary-color);
}

.recommendation-text-modal-formatted .recommendation-item {
    margin: 12px 0;
    padding: 10px;
    background: var(--background-color);
    border-radius: 6px;
}

.recommendation-text-modal-formatted .recommendation-item-title {
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 6px;
    font-size: 15px;
}

.recommendation-text-modal-formatted .recommendation-list {
    margin: 10px 0;
    padding-left: 20px;
    list-style-type: disc;
}

.recommendation-text-modal-formatted .recommendation-list li {
    margin-bottom: 8px;
    line-height: 1.6;
    color: var(--text-color);
}

.recommendation-text-modal-formatted strong,
.recommendation-text-modal-formatted .recommendation-bold {
    color: var(--text-color);
    font-weight: 700;
    font-size: 16px;
}

.modal-footer {
    padding: 20px;
    border-top: 2px solid var(--background-color);
    text-align: right;
}

@media (max-width: 600px) {
    .detailed-results-grid {
        grid-template-columns: 1fr;
    }
    
    .detailed-result-card {
        flex-direction: column;
        text-align: center;
    }
    
    .detailed-card-icon {
        margin: 0 auto;
    }
}

/* Адаптивность */
@media (max-width: 600px) {
    .container {
        padding: 10px;
    }

    .header h1 {
        font-size: 24px;
    }

    .test-card h3 {
        font-size: 18px;
    }

    .question {
        font-size: 16px;
    }

    .btn-group {
        flex-direction: column;
    }

    .btn-group .btn {
        width: 100%;
    }
    
    /* Улучшения для узких экранов */
    .result-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .result-header h4 {
        font-size: 18px;
    }
    
    .result-date {
        font-size: 12px;
    }
    
    .metrics-row {
        grid-template-columns: 1fr;
    }
    
    .metric-item {
        padding: 10px;
    }
    
    .metric-label {
        font-size: 13px;
    }
    
    .metric-value {
        font-size: 14px;
    }
    
    .metric-value.metric-total {
        font-size: 18px;
    }
    
    .result-recommendation-full-card {
        padding: 15px;
    }
    
    .recommendation-text-formatted {
        font-size: 13px;
    }
    
    .recommendation-text-formatted .recommendation-paragraph {
        font-size: 13px;
    }
    
    .recommendation-text-formatted .recommendation-section {
        padding: 10px;
        font-size: 14px;
    }
    
    .recommendation-text-formatted .recommendation-item {
        padding: 10px;
    }
    
    .recommendation-text-formatted .recommendation-item-title {
        font-size: 14px;
    }
    
    .detailed-results-grid {
        grid-template-columns: 1fr;
    }
    
    .detailed-result-card {
        padding: 15px;
    }
    
    .detailed-card-value {
        font-size: 24px;
    }
    
    .modal-content {
        max-width: 95%;
        max-height: 95vh;
        margin: 10px;
    }
    
    .modal-body {
        padding: 15px;
    }
}

/* Дополнительные улучшения для очень узких экранов */
@media (max-width: 400px) {
    .container {
        padding: 8px;
    }
    
    .header {
        padding: 15px;
    }
    
    .header h1 {
        font-size: 20px;
    }
    
    .subtitle {
        font-size: 14px;
    }
    
    .test-card {
        padding: 15px;
    }
    
    .test-card h3 {
        font-size: 16px;
    }
    
    .question-container {
        padding: 15px;
    }
    
    .question {
        font-size: 15px;
    }
    
    .answer-option {
        padding: 12px;
        font-size: 14px;
    }
    
    .result-card-detailed {
        padding: 15px;
    }
    
    .result-header h4 {
        font-size: 16px;
    }
    
    .metric-item {
        padding: 8px;
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .metric-details {
        align-items: flex-start;
    }
    
    .recommendation-text-formatted {
        font-size: 12px;
    }
    
    .recommendation-text-formatted .recommendation-paragraph {
        font-size: 12px;
        margin-bottom: 10px;
    }
    
    .recommendation-text-formatted .recommendation-section {
        padding: 8px;
        font-size: 13px;
    }
    
    .recommendation-text-formatted .recommendation-item {
        padding: 8px;
    }
    
    .recommendation-text-formatted .recommendation-item-title {
        font-size: 13px;
    }
    
    .recommendation-text-formatted strong,
    .recommendation-text-formatted .recommendation-bold {
        font-size: 13px;
    }
    
    .btn {
        padding: 10px 16px;
        font-size: 14px;
    }
    
    .btn-view-details {
        font-size: 13px;
        padding: 10px;
    }
    
    /* Новые элементы для узких экранов */
    .login-choice-section h3 {
        font-size: 16px;
    }
    
    .btn-large {
        padding: 15px;
        font-size: 14px;
        min-height: 70px;
    }
    
    .btn-icon {
        font-size: 20px;
    }
    
    .btn-hint {
        font-size: 11px;
    }
    
    .instruction-section,
    .gender-section,
    .warning-section {
        padding: 15px;
    }
    
    .instruction-section h3,
    .gender-section h3 {
        font-size: 18px;
    }
    
    .instruction-text {
        font-size: 14px;
    }
    
    .gender-buttons {
        flex-direction: column;
    }
    
    .btn-gender {
        max-width: 100%;
        width: 100%;
    }
    
    .warning-item {
        padding: 10px;
        flex-direction: column;
        gap: 10px;
    }
    
    .warning-bar {
        width: 100%;
        min-height: 3px;
    }
    
    .test-prepare-content {
        padding: 15px;
    }
}

/* Анимации */
.fade-in {
    animation: fadeIn 0.3s ease-in;
}

/* Утилиты */
.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

.mt-20 {
    margin-top: 20px;
}

.mb-20 {
    margin-bottom: 20px;
}

/* Новый экран входа с выбором */
.login-choice-section {
    margin-top: 20px;
}

.login-choice-section h3 {
    color: var(--text-color);
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
    text-align: center;
}

.login-options {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.btn-telegram {
    background: linear-gradient(135deg, #0088cc 0%, #0066aa 100%);
    color: white;
    border: none;
    padding: 20px;
    border-radius: 15px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(0, 136, 204, 0.3);
}

.btn-telegram:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 136, 204, 0.4);
}

.btn-large {
    padding: 20px;
    font-size: 16px;
    min-height: 80px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-icon {
    font-size: 24px;
    margin-bottom: 5px;
}

.btn-hint {
    font-size: 12px;
    opacity: 0.8;
    font-weight: 400;
    margin: 0;
}

.form-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.form-header h3 {
    color: var(--text-color);
    font-size: 20px;
    font-weight: 600;
    margin: 0;
}

.btn-back-small {
    background: transparent;
    border: none;
    color: var(--primary-color);
    font-size: 16px;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 5px;
    transition: all 0.3s ease;
}

.btn-back-small:hover {
    background: rgba(74, 144, 226, 0.1);
}

/* Экран подготовки к тесту */
.test-prepare-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

.instruction-section {
    background: var(--card-background);
    padding: 25px;
    border-radius: 15px;
    margin-bottom: 25px;
    box-shadow: var(--shadow);
}

.instruction-section h3 {
    color: var(--primary-color);
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.instruction-text {
    color: var(--text-color);
    font-size: 16px;
    line-height: 1.8;
}

.instruction-text p {
    margin-bottom: 12px;
}

.instruction-text p:last-child {
    margin-bottom: 0;
}

.instruction-text strong {
    color: var(--primary-color);
    font-weight: 600;
}

/* Выбор пола */
.gender-section {
    background: var(--card-background);
    padding: 25px;
    border-radius: 15px;
    margin-bottom: 25px;
    box-shadow: var(--shadow);
}

.gender-section h3 {
    color: var(--primary-color);
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.gender-hint {
    color: var(--text-light);
    font-size: 14px;
    margin-bottom: 20px;
}

.gender-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.btn-gender {
    flex: 1;
    max-width: 200px;
    padding: 20px;
    background: var(--card-background);
    border: 3px solid var(--border-color);
    border-radius: 15px;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.btn-gender:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(74, 144, 226, 0.2);
}

.btn-gender.selected {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border-color: var(--primary-color);
    color: white;
    box-shadow: 0 4px 15px rgba(74, 144, 226, 0.3);
}

/* Предупреждения */
.warning-section {
    background: var(--card-background);
    padding: 25px;
    border-radius: 15px;
    margin-bottom: 25px;
    box-shadow: var(--shadow);
}

.warning-item {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    margin-bottom: 15px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 10px;
}

.warning-item:last-child {
    margin-bottom: 0;
}

.warning-bar {
    width: 5px;
    min-height: 40px;
    border-radius: 3px;
    flex-shrink: 0;
}

.warning-bar-red {
    background: var(--error-color);
}

.warning-bar-blue {
    background: var(--primary-color);
}

.warning-bar-green {
    background: var(--success-color);
}

.warning-item p {
    color: var(--text-color);
    font-size: 14px;
    line-height: 1.6;
    margin: 0;
    flex: 1;
}

.warning-item strong {
    color: var(--text-color);
    font-weight: 600;
}

/* Секция начала теста */
.test-start-section {
    text-align: center;
    margin-top: 30px;
}

.btn-large:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.btn-large:disabled:hover {
    transform: none;
    box-shadow: none;
}
