/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #1a1a1a;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 40px;
    color: white;
}

.title {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 700;
    margin-bottom: 16px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.subtitle {
    font-size: clamp(1rem, 2.5vw, 1.25rem);
    font-weight: 400;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
}

/* Main content */
.main {
    flex: 1;
    display: grid;
    gap: 40px;
    grid-template-columns: 1fr;
    align-items: start;
}

@media (min-width: 768px) {
    .main {
        grid-template-columns: 1fr 1fr;
        gap: 60px;
    }
}

/* Registration card */
.registration-card {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    backdrop-filter: blur(10px);
}

.card-title {
    font-size: 1.75rem;
    font-weight: 600;
    margin-bottom: 32px;
    color: #1a1a1a;
    text-align: center;
}

/* Form styles */
.registration-form {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-label {
    font-weight: 500;
    color: #374151;
    font-size: 0.9rem;
}

.form-input,
.form-select {
    padding: 16px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s ease;
    background: white;
}

.form-input:focus,
.form-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-input::placeholder {
    color: #9ca3af;
}

/* Button styles */
.btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 16px 32px;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-icon {
    font-size: 1.2rem;
    transition: transform 0.3s ease;
}

.btn:hover .btn-icon {
    transform: translateX(4px);
}

/* Info section */
.info-section {
    color: white;
}

.info-section h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 24px;
    text-align: center;
}

.features {
    display: grid;
    gap: 24px;
}

.feature {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 24px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: transform 0.3s ease;
}

.feature:hover {
    transform: translateY(-4px);
}

.feature-icon {
    font-size: 2.5rem;
    margin-bottom: 16px;
}

.feature h4 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.feature p {
    opacity: 0.9;
    font-size: 0.95rem;
}

/* Test page styles */
.test-container {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    max-width: 800px;
    margin: 0 auto;
}

.test-header {
    margin-bottom: 32px;
}

.test-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 16px;
}

.block-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.block-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: #667eea;
}



.question-counter {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.counter-text {
    font-size: 1rem;
    font-weight: 500;
    color: #374151;
}

.answered-text {
    font-size: 0.9rem;
    color: #6b7280;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    transition: width 0.3s ease;
}

.question-container {
    margin-bottom: 40px;
}

.question-text {
    font-size: 1.25rem;
    font-weight: 500;
    margin-bottom: 24px;
    line-height: 1.5;
}

.answer-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.answer-option {
    display: flex;
    align-items: center;
    padding: 16px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
    position: relative;
}

.answer-option:hover {
    border-color: #667eea;
    background: #f8fafc;
}

.answer-option.selected {
    border-color: #667eea;
    background: #f0f4ff;
}

.answer-option.selected::before {
    content: '';
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    background: #667eea;
    border-radius: 50%;
    border: 3px solid white;
    box-shadow: 0 0 0 2px #667eea;
}

.answer-option input[type="radio"] {
    margin-right: 12px;
    transform: scale(1.2);
    opacity: 0;
    position: absolute;
    pointer-events: none;
}

.answer-option label {
    cursor: pointer;
    font-weight: 500;
    flex: 1;
    user-select: none;
}

.navigation-buttons {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-top: 32px;
}

.btn-secondary {
    background: #f3f4f6;
    color: #374151;
    border: 2px solid #e5e7eb;
}

.btn-secondary:hover {
    background: #e5e7eb;
    transform: translateY(-2px);
}

/* Results page - Print optimized */
.results-container {
    background: white;
    padding: 2rem;
    max-width: 210mm; /* A4 width */
    margin: 0 auto;
    position: relative;
    font-size: 12pt;
    line-height: 1.4;
}

@media print {
    .results-container {
        box-shadow: none;
        border-radius: 0;
        padding: 1rem;
        max-width: none;
        margin: 0;
    }
    
    body {
        background: white !important;
    }
    
    .btn {
        display: none !important;
    }
}

.results-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
}

.results-container h1 {
    text-align: center;
    color: #1a1a1a;
    margin-bottom: 0.5rem;
    font-size: 2.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.results-container .subtitle {
    text-align: center;
    color: #666;
    margin-bottom: 3rem;
    font-size: 1.2rem;
    font-weight: 500;
}

.result-section {
    margin-bottom: 2rem;
    padding: 1.5rem;
    border: 1px solid #e2e8f0;
    position: relative;
    page-break-inside: avoid;
}

@media print {
    .result-section {
        margin-bottom: 1.5rem;
        padding: 1rem;
        border: 1px solid #ccc;
        page-break-inside: avoid;
    }
}

.result-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
}

.result-title {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: #1a1a1a;
    border-bottom: 2px solid #667eea;
    padding-bottom: 0.5rem;
}

@media print {
    .result-title {
        font-size: 1.2rem;
        margin-bottom: 1rem;
        border-bottom: 1px solid #000;
    }
}

.result-content {
    line-height: 1.5;
    color: #333;
}

.result-content p {
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: #f8f9fa;
    border-left: 3px solid #667eea;
}

@media print {
    .result-content p {
        margin-bottom: 0.75rem;
        padding: 0.5rem;
        background: #f9f9f9;
        border-left: 2px solid #000;
        page-break-inside: avoid;
    }
}

.result-content strong {
    color: #1a1a1a;
    font-weight: 700;
    display: inline-block;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.result-content ul {
    margin: 1.5rem 0;
    padding-left: 0;
    list-style: none;
}

.result-content li {
    margin-bottom: 0.75rem;
    padding: 0.75rem;
    background: #f8f9fa;
    border-left: 3px solid #667eea;
    position: relative;
}

.result-content li::before {
    content: '•';
    color: #667eea;
    font-weight: bold;
    font-size: 1.2rem;
    position: absolute;
    left: 0.5rem;
    top: 0.6rem;
}

/* Стили для плана недели */
.weekly-plan {
    background: #f8f9fa;
    border: 1px solid #e2e8f0;
    padding: 1rem;
    margin: 1rem 0;
}

.weekly-plan h4 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 1rem;
    border-bottom: 1px solid #667eea;
    padding-bottom: 0.5rem;
}

.plan-day {
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: white;
    border-left: 3px solid #667eea;
}

.plan-day:last-child {
    margin-bottom: 0;
}

.day-header {
    font-weight: 600;
    color: #667eea;
    margin-bottom: 0.5rem;
}

.day-content {
    color: #333;
    line-height: 1.4;
}

@media print {
    .result-content li {
        margin-bottom: 0.5rem;
        padding: 0.5rem;
        background: #f9f9f9;
        border-left: 2px solid #000;
        page-break-inside: avoid;
    }
    
    .weekly-plan {
        background: #f9f9f9;
        border: 1px solid #ccc;
        padding: 0.75rem;
        margin: 0.75rem 0;
    }
    
    .plan-day {
        padding: 0.5rem;
        background: white;
        border-left: 2px solid #000;
        margin-bottom: 0.75rem;
    }
}

.mbti-type {
    font-size: 3rem;
    font-weight: 800;
    color: #667eea;
    text-align: center;
    margin: 2rem 0;
    padding: 2rem;
    background: linear-gradient(135deg, #f8f9ff 0%, #e8ecff 100%);
    border-radius: 16px;
    border: 3px solid #e8ecff;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.1);
    position: relative;
    overflow: hidden;
}

.mbti-type::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    animation: shine 2s infinite;
}

@keyframes shine {
    0% { left: -100%; }
    100% { left: 100%; }
}

.riasec-chart {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin: 1.5rem 0;
}

.riasec-item {
    text-align: center;
    padding: 1rem;
    background: #f8f9fa;
    border: 1px solid #e2e8f0;
    min-height: 80px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.riasec-score {
    font-size: 1.5rem;
    font-weight: 700;
    color: #667eea;
    margin-bottom: 0.5rem;
}

.riasec-label {
    font-size: 0.9rem;
    color: #555;
    font-weight: 500;
    word-wrap: break-word;
    max-width: 100%;
}

@media print {
    .riasec-chart {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.5rem;
        margin: 1rem 0;
    }
    
    .riasec-item {
        padding: 0.5rem;
        min-height: 60px;
        border: 1px solid #ccc;
    }
    
    .riasec-score {
        font-size: 1.2rem;
        margin-bottom: 0.25rem;
    }
    
    .riasec-label {
        font-size: 0.8rem;
    }
}

/* Responsive design */
@media (max-width: 768px) {
    .container {
        padding: 16px;
    }
    
    .registration-card,
    .test-container {
        padding: 24px;
    }
    
    .results-container {
        padding: 1.5rem;
        margin: 1rem;
    }
    
    .results-container h1 {
        font-size: 2rem;
    }
    
    .result-section {
        padding: 1.5rem;
        margin-bottom: 1.5rem;
    }
    
    .mbti-type {
        font-size: 2rem;
        padding: 1.5rem;
    }
    
    .riasec-chart {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .result-content p {
        padding: 1rem;
    }
    
    .result-content li {
        padding: 0.75rem 1rem;
    }
    
    .test-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .question-counter {
        align-items: flex-start;
    }
    
    .navigation-buttons {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
    
    .features {
        grid-template-columns: 1fr;
    }
    
    .answer-option {
        padding: 12px;
    }
    
    .answer-option.selected::before {
        right: 12px;
        width: 16px;
        height: 16px;
    }
}

@media (max-width: 480px) {
    .title {
        font-size: 2rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .card-title {
        font-size: 1.5rem;
    }
    
    .question-text {
        font-size: 1.1rem;
    }
}

/* Loading animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Success/error messages */
.message {
    padding: 16px;
    border-radius: 12px;
    margin-bottom: 24px;
    font-weight: 500;
}

.message.success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.message.error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}
