/* style.css - Тёмная тема */
:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --primary-gradient-hover: linear-gradient(135deg, #5a67d8 0%, #6b46a0 100%);
    --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --dark-bg: var(--tg-theme-bg-color, #0a0a0f);
    --card-bg: rgba(18, 18, 27, 0.95);
    --border-glow: rgba(102, 126, 234, 0.3);
    --text-primary: var(--tg-theme-text-color, #ffffff);
    --text-secondary: var(--tg-theme-hint-color, #a0a0b0);
    --success-color: #10b981;
    --error-color: #ef4444;
    --warning-color: #f59e0b;
    --glow-effect: 0 0 20px rgba(102, 126, 234, 0.3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background: var(--tg-theme-bg-color, #0a0a0a);
    color: var(--tg-theme-text-color, #e0e0e0);
    line-height: 1.5;
}

.app-container {
    max-width: 600px;
    margin: 0 auto;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--tg-theme-bg-color, #121212);
}

.app-header {
    background: var(--tg-theme-header-bg-color, #1e1e1e);
    padding: 20px;
    border-bottom: 1px solid var(--tg-theme-hint-color, #333);
    position: sticky;
    top: 0;
    z-index: 10;
}

@media (max-width: 768px) {
	.app-header {
		margin-top: 50px;
	}
}



.logo h1 {
    font-size: 1.5rem;
    color: var(--tg-theme-text-color, #4fc3f7);
    text-align: center;
    text-shadow: 0 0 10px rgba(79, 195, 247, 0.3);
}

.progress-bar {
    height: 6px;
    background: var(--tg-theme-hint-color, #333);
    border-radius: 3px;
    margin-bottom: 10px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4fc3f7, #2979ff);
    transition: width 0.3s ease;
    box-shadow: 0 0 10px rgba(79, 195, 247, 0.5);
}

.step-indicator {
    text-align: center;
    color: var(--tg-theme-hint-color, #888);
    font-size: 0.9rem;
}

.app-content {
    flex: 1;
    padding: 20px;
}

.app-footer {
    padding: 20px;
    text-align: center;
    color: var(--tg-theme-hint-color, #666);
    font-size: 0.9rem;
    border-top: 1px solid var(--tg-theme-hint-color, #333);
    /*background: #1a1a1a;*/
}

/* Главная страница */
.welcome-card {
    background: var(--tg-theme-secondary-bg-color, #1e1e1e);
    border-radius: 20px;
    padding: 40px 20px;
    text-align: center;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
    border: 1px solid #333;
}

.welcome-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    filter: drop-shadow(0 0 10px rgba(79, 195, 247, 0.5));
}

.welcome-card h2 {
    font-size: 1.5rem;
    margin-bottom: 20px;
    color: var(--tg-theme-text-color, #fff);
}

.welcome-description {
    color: var(--tg-theme-hint-color, #aaa);
    margin-bottom: 30px;
    line-height: 1.6;
}

.primary-btn {
    background: linear-gradient(135deg, #4fc3f7, #2979ff);
    color: white;
    border: none;
    padding: 16px 32px;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 12px;
    cursor: pointer;
    width: 100%;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(41, 121, 255, 0.3);
}

.primary-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(41, 121, 255, 0.5);
}

.primary-btn:active:not(:disabled) {
    transform: translateY(0);
}

.primary-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: linear-gradient(135deg, #666, #444);
    box-shadow: none;
}

.secondary-btn {
    background: #121212;
    color: var(--tg-theme-text-color, #e0e0e0);
    border: 2px solid var(--tg-theme-hint-color, #444);
    padding: 16px 32px;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s;
}

.secondary-btn:hover:not(:disabled) {
    background: #333;
    border-color: #666;
}

.secondary-btn:active:not(:disabled) {
    transform: scale(0.98);
}

.secondary-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Статус регистрации */
.registration-status {
    margin: 20px 0;
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.registration-status.success {
    background: linear-gradient(135deg, #1b3b1b, #0d2b0d);
    color: #a5d6a5;
    border: 2px solid #2e7d32;
}

.registration-status.success strong {
    font-size: 1.2rem;
    display: block;
    margin-bottom: 10px;
    color: #81c784;
}

.registration-status.success small {
    display: block;
    margin-top: 10px;
    opacity: 0.8;
    font-size: 0.9rem;
    color: #a5d6a5;
}

.registration-status.error {
    background: linear-gradient(135deg, #4a1c1c, #2a1010);
    color: #ffb3b3;
    border: 2px solid #c62828;
}

.registration-status.warning {
    background: linear-gradient(135deg, #4a4010, #2a240a);
    color: #ffd966;
    border: 2px solid #b78c1a;
}

/* Форма опроса */
.survey-form {
    max-width: 100%;
}

.question {
    display: none;
    animation: fadeIn 0.5s ease;
}

.question.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.question-title {
    font-size: 1.2rem;
    margin-bottom: 15px;
    color: var(--tg-theme-text-color, #fff);
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.1);
}

.question-hint {
    color: var(--tg-theme-hint-color, #aaa);
    font-size: 0.9rem;
    margin-bottom: 20px;
    font-style: italic;
}

.form-group {
    margin-bottom: 20px;
}

.form-input {
    width: 100%;
    padding: 15px;
    font-size: 1rem;
    border: 2px solid var(--tg-theme-hint-color, #333);
    border-radius: 12px;
    background: var(--tg-theme-bg-color, #1e1e1e);
    color: var(--tg-theme-text-color, #fff);
    transition: all 0.3s;
}

.form-input:focus {
    outline: none;
    border-color: #4fc3f7;
    box-shadow: 0 0 15px rgba(79, 195, 247, 0.3);
    background: #252525;
}

.form-input::placeholder {
    color: #666;
}

.input-hint {
    color: var(--tg-theme-hint-color, #888);
    font-size: 0.85rem;
    margin-top: 5px;
}

/* Опции в виде карточек */
.options-grid {
    display: grid;
    gap: 10px;
    margin-bottom: 20px;
}

.option-card {
    display: flex;
    align-items: center;
    padding: 15px;
    background: var(--tg-theme-secondary-bg-color, #1a1a1a);
    border: 2px solid var(--tg-theme-hint-color, #333);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s;
}

.option-card:hover {
    border-color: #4fc3f7;
    background: #252525;
    transform: translateX(5px);
    box-shadow: 0 2px 10px rgba(79, 195, 247, 0.2);
}

.option-card input[type="radio"],
.option-card input[type="checkbox"] {
    margin-right: 15px;
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #4fc3f7;
}

.option-card input[type="radio"]:checked + .option-text,
.option-card input[type="checkbox"]:checked + .option-text {
    color: #4fc3f7;
    font-weight: 500;
}

.option-card:has(input:checked) {
    border-color: #4fc3f7;
    background: #1a2a33;
    box-shadow: 0 0 15px rgba(79, 195, 247, 0.2);
}

.option-text {
    flex: 1;
    font-size: 1rem;
    line-height: 1.4;
    color: #ddd;
}

/* Навигация по опросу */
.survey-navigation {
    display: flex;
    gap: 10px;
    margin-top: 30px;
    position: sticky;
    bottom: 20px;
    /*
	background: #121212;
    border-top: 1px solid #333;	
	*/
    padding: 10px 0;
}

.survey-navigation button {
    flex: 1;
    padding: 15px;
    font-size: 1rem;
}

/* Модальное окно успеха */
.success-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.3s;
}

.modal-content {
    background: #1e1e1e;
    padding: 40px 20px;
    border-radius: 20px;
    text-align: center;
    max-width: 90%;
    animation: slideUp 0.3s;
    border: 1px solid #333;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
}

@keyframes slideUp {
    from { transform: translateY(50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.success-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    filter: drop-shadow(0 0 10px #4fc3f7);
}

.modal-content h2 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: var(--tg-theme-text-color, #fff);
}

.modal-content p {
    color: var(--tg-theme-hint-color, #aaa);
    margin-bottom: 30px;
}

.modal-content .primary-btn {
    max-width: 200px;
    margin: 0 auto;
}

/* Стили для ошибок */
.form-input.error {
    border-color: #ff5252 !important;
    background-color: #2a1a1a !important;
    animation: shake 0.3s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

/* Уведомления */
.notification {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 15px 25px;
    border-radius: 10px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5);
    z-index: 1000;
    font-size: 1rem;
    max-width: 90%;
    text-align: center;
    animation: slideDown 0.3s ease;
    border: 1px solid;
}

.notification.error {
    background: linear-gradient(135deg, #4a1c1c, #2a1010);
    color: #ffb3b3;
    border-color: #c62828;
}

.notification.warning {
    background: linear-gradient(135deg, #4a4010, #2a240a);
    color: #ffd966;
    border-color: #b78c1a;
}

.notification.success {
    background: linear-gradient(135deg, #1b3b1b, #0d2b0d);
    color: #a5d6a5;
    border-color: #2e7d32;
}

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: translate(-50%, 0);
    }
    to {
        opacity: 0;
        transform: translate(-50%, -20px);
    }
}

/* Улучшения для поля телефона */
#phone {
    font-family: monospace;
    letter-spacing: 0.5px;
    background: #1e1e1e;
}

#phone::placeholder {
    color: #555;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Десктопные стили */
@media (min-width: 769px) {
    .form-input {
        font-size: 1rem;
        padding: 12px 15px;
    }
    
    .option-card {
        cursor: pointer;
        transition: all 0.2s ease;
    }
    
    .option-card:hover {
        transform: translateX(5px);
        border-color: #4fc3f7;
        background: #252525;
    }
    
    .primary-btn:hover:not(:disabled) {
        transform: translateY(-2px);
        box-shadow: 0 8px 25px rgba(41, 121, 255, 0.6);
    }
}

/* Мобильные стили */
@media (max-width: 768px) {
    .form-input {
        font-size: 16px;
        padding: 15px;
    }
    
    .option-card {
        padding: 15px;
    }
    
    .notification {
        width: 90%;
        font-size: 0.95rem;
        padding: 12px 20px;
    }
    
    .welcome-card {
        padding: 30px 15px;
    }
    
    .welcome-card h2 {
        font-size: 1.3rem;
    }
}

/* Специальные элементы */
.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid #333;
    padding-bottom: 10px;
}

.tab-btn {
    background: none;
    border: none;
    padding: 8px 16px;
    font-size: 1rem;
    cursor: pointer;
    color: #888;
    border-radius: 8px;
    transition: all 0.3s;
}

.tab-btn.active {
    background: #4fc3f7;
    color: #000;
    font-weight: 500;
    box-shadow: 0 2px 10px rgba(79, 195, 247, 0.3);
}

.tab-btn:hover:not(.active) {
    background: #333;
    color: #fff;
}

.leaderboard-list {
    background: #1e1e1e;
    border-radius: 12px;
    padding: 10px;
    border: 1px solid #333;
}

.leaderboard-item {
    display: flex;
    align-items: center;
    padding: 12px;
    border-bottom: 1px solid #333;
    transition: background 0.3s;
}

.leaderboard-item:hover {
    background: #252525;
}

.leaderboard-item:last-child {
    border-bottom: none;
}

.rank {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4fc3f7, #2979ff);
    color: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    margin-right: 15px;
    box-shadow: 0 2px 10px rgba(79, 195, 247, 0.3);
}

.user-details {
    flex: 1;
}

.user-name {
    font-weight: 600;
    color: #fff;
}

.user-points {
    color: #888;
    font-size: 0.9rem;
}

/* Скроллбар для темной темы */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #1e1e1e;
}

::-webkit-scrollbar-thumb {
    background: #444;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Стили для ссылок */
a {
    color: #4fc3f7;
    text-decoration: none;
    transition: color 0.3s;
}

a:hover {
    color: #2979ff;
    text-decoration: underline;
}

/* Выделение текста */
::selection {
    background: #4fc3f7;
    color: #000;
}

/* Статистика и карточки */
.stat-card {
    background: #1e1e1e;
    border: 1px solid #333;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 15px;
    transition: transform 0.3s;
}

.stat-card:hover {
    transform: translateY(-2px);
    border-color: #4fc3f7;
}

.stat-value {
    font-size: 2rem;
    font-weight: 600;
    color: #4fc3f7;
    margin-bottom: 5px;
}

.stat-label {
    color: #888;
    font-size: 0.9rem;
}

/* Профиль пользователя */
.profile-info {
    background: #1e1e1e;
    border-radius: 12px;
    padding: 20px;
    border: 1px solid #333;
}

.profile-field {
    margin-bottom: 15px;
    padding: 10px;
    border-bottom: 1px solid #333;
}

.profile-field:last-child {
    border-bottom: none;
}

.field-label {
    display: block;
    color: #888;
    font-size: 0.9rem;
    margin-bottom: 5px;
}

.field-value {
    font-size: 1.1rem;
    font-weight: 500;
    color: #fff;
}

/* Лоадер для темной темы */
.loading {
    text-align: center;
    padding: 30px;
    color: #888;
}

.loading:after {
    content: '';
    display: block;
    width: 40px;
    height: 40px;
    margin: 20px auto;
    border: 3px solid #333;
    border-top-color: #4fc3f7;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}