/* ========== ОСНОВНЫЕ ПЕРЕМЕННЫЕ ========== */
:root {
    --primary: #2AABEE;
    --primary-dark: #1790c2;
    --success: #4CAF50;
    --warning: #FF9800;
    --danger: #f44336;
    --text: #1a1e26;
    --text-light: #5a636d;
    --background: #ffffff;
    --background-alt: #f8fafd;
    --border: #eceef2;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-hover: 0 8px 24px rgba(0, 0, 0, 0.12);
}

/* ========== СБРОС ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: var(--background);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

/* ========== КОНТЕЙНЕР ========== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* ========== ЗАГОЛОВКИ ========== */
h1, h2, h3 {
    margin-bottom: 1rem;
    color: var(--text);
}

h1.logo {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.subtitle {
    color: var(--text-light);
    font-size: 1.1rem;
}

/* ========== КНОПКИ ========== */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border-radius: 40px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    font-size: 1rem;
    text-align: center;
}

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

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
}

.btn-outline:hover {
    background: var(--primary);
    color: white;
}

.btn-block {
    display: block;
    width: 100%;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.9rem;
}

.btn-telegram {
    background: #27A7E7;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
}

.telegram-icon {
    font-size: 1.2rem;
}

/* ========== ФОРМЫ ========== */
.auth-card {
    background: var(--background-alt);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 30px;
    max-width: 400px;
    margin: 30px auto;
    box-shadow: var(--shadow);
}

.auth-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.tab-btn {
    flex: 1;
    padding: 12px;
    border: none;
    background: transparent;
    border-radius: 40px;
    cursor: pointer;
    font-weight: 600;
    color: var(--text-light);
    transition: all 0.2s;
}

.tab-btn.active {
    background: var(--primary);
    color: white;
}

.auth-form {
    display: none;
}

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

.auth-form h2 {
    text-align: center;
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: var(--text-light);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border);
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.2s;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(42, 171, 238, 0.1);
}

.auth-footer {
    text-align: center;
    margin-top: 20px;
    color: var(--text-light);
    font-size: 0.9rem;
}

.telegram-auth {
    max-width: 400px;
    margin: 20px auto;
    text-align: center;
}

.hint {
    color: var(--text-light);
    font-size: 0.8rem;
    margin-top: 5px;
}

/* ========== ПРЕВЬЮ ФУНКЦИЙ ========== */
.features-preview {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-top: 40px;
    flex-wrap: wrap;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-light);
}

.feature-icon {
    font-size: 1.5rem;
}

/* ========== НАВИГАЦИЯ ========== */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 30px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 1.3rem;
    font-weight: 600;
}

.back-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.back-link:hover {
    text-decoration: underline;
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-email {
    color: var(--text-light);
    font-size: 0.9rem;
}

/* ========== СТАТУС-КАРТОЧКА ========== */
.status-card {
    background: var(--background-alt);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: var(--shadow);
}

.status-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.badge {
    padding: 4px 12px;
    border-radius: 40px;
    font-size: 0.8rem;
    font-weight: 600;
}

.badge-pro {
    background: var(--primary);
    color: white;
}

.badge-free {
    background: var(--border);
    color: var(--text-light);
}

.keys-info {
    margin-bottom: 15px;
}

.keys-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
}

.key-progress {
    width: 100%;
    height: 10px;
    background: var(--border);
    border-radius: 10px;
    overflow: hidden;
}

.key-progress-fill {
    height: 100%;
    background: var(--primary);
    transition: width 0.3s;
}

.pro-expiry {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 15px;
    padding: 10px;
    background: rgba(42, 171, 238, 0.1);
    border-radius: 10px;
}

/* ========== СЕТКА ФУНКЦИЙ ========== */
.function-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin: 20px 0 30px;
}

.function-card {
    background: var(--background-alt);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

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

.function-icon {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.function-card h3 {
    margin-bottom: 8px;
}

.function-desc {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 15px;
}

.function-key-cost {
    display: inline-block;
    padding: 4px 12px;
    background: var(--border);
    border-radius: 40px;
    font-size: 0.8rem;
    color: var(--text-light);
}

/* ========== ИСТОРИЯ ========== */
.history-section {
    margin-top: 40px;
}

.history-list {
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
}

.history-item {
    display: flex;
    justify-content: space-between;
    padding: 15px 20px;
    border-bottom: 1px solid var(--border);
    background: white;
}

.history-item:last-child {
    border-bottom: none;
}

.history-item.placeholder {
    color: var(--text-light);
    justify-content: center;
}

.history-function {
    font-weight: 500;
}

.history-date {
    color: var(--text-light);
    font-size: 0.9rem;
}

/* ========== ЗАГРУЗКА ФАЙЛОВ ========== */
.analyze-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.key-cost {
    padding: 6px 16px;
    background: var(--border);
    border-radius: 40px;
    font-size: 0.9rem;
}

.file-info {
    margin-bottom: 15px;
}

.file-info-text {
    padding: 10px;
    background: var(--background-alt);
    border-radius: 10px;
    color: var(--text-light);
}

.dropzone {
    border: 2px dashed var(--border);
    border-radius: 20px;
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 20px;
}

.dropzone:hover {
    border-color: var(--primary);
    background: rgba(42, 171, 238, 0.05);
}

.dropzone.dragover {
    border-color: var(--primary);
    background: rgba(42, 171, 238, 0.1);
}

.dropzone-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 15px;
}

.dropzone-hint {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-top: 10px;
}

.vacancy-field {
    margin: 20px 0;
}

.vacancy-field label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.vacancy-field textarea {
    width: 100%;
    padding: 15px;
    border: 2px solid var(--border);
    border-radius: 12px;
    font-size: 1rem;
    resize: vertical;
    font-family: inherit;
}

.vacancy-field textarea:focus {
    outline: none;
    border-color: var(--primary);
}

/* ========== РЕЗУЛЬТАТЫ ========== */
.result-section {
    margin-top: 30px;
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.result-content {
    background: var(--background-alt);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 30px;
}

.score-card {
    text-align: center;
}

.total-score {
    font-size: 3rem;
    font-weight: bold;
    color: var(--primary);
    margin-bottom: 30px;
}

.categories {
    text-align: left;
    margin-bottom: 30px;
}

.category {
    margin-bottom: 15px;
}

.category-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--border);
    border-radius: 4px;
    overflow: hidden;
    margin: 5px 0;
}

.progress-fill {
    height: 100%;
    background: var(--primary);
    transition: width 0.3s;
}

.recommendations {
    text-align: left;
    background: white;
    padding: 20px;
    border-radius: 12px;
    margin-top: 20px;
}

.recommendations h3 {
    margin-bottom: 15px;
    color: var(--text);
}

.recommendations ul {
    list-style: none;
}

.recommendations li {
    padding: 8px 0 8px 24px;
    position: relative;
    color: var(--text-light);
}

.recommendations li::before {
    content: "•";
    color: var(--primary);
    font-weight: bold;
    position: absolute;
    left: 8px;
}

.red-flags {
    text-align: left;
}

.flag-item {
    padding: 15px;
    background: white;
    border-radius: 12px;
    margin-bottom: 10px;
    border-left: 4px solid var(--danger);
}

.flag-item.warning {
    border-left-color: var(--warning);
}

.flag-title {
    font-weight: 600;
    margin-bottom: 5px;
}

.flag-description {
    color: var(--text-light);
    font-size: 0.9rem;
}

.letter-content {
    white-space: pre-wrap;
    line-height: 1.8;
    font-family: 'Georgia', serif;
    padding: 20px;
    background: white;
    border-radius: 12px;
}

/* ========== МОДАЛЬНЫЕ ОКНА ========== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    position: relative;
    background: white;
    max-width: 500px;
    margin: 50px auto;
    padding: 30px;
    border-radius: 20px;
    box-shadow: var(--shadow-hover);
    animation: slideIn 0.3s;
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    cursor: pointer;
    font-size: 24px;
    color: var(--text-light);
    transition: color 0.2s;
}

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

.pro-features {
    margin: 20px 0;
}

.pro-feature {
    padding: 10px 0;
    color: var(--text-light);
}

.pro-price {
    text-align: center;
    margin: 20px 0;
    padding: 20px;
    background: var(--background-alt);
    border-radius: 12px;
}

.price {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--primary);
}

.period {
    color: var(--text-light);
    font-size: 1rem;
}

/* ========== ОВЕРЛЕЙ ЗАГРУЗКИ ========== */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* ========== СООБЩЕНИЯ ========== */
.error-message {
    background: #ffebee;
    color: var(--danger);
    padding: 15px;
    border-radius: 12px;
    margin: 10px 0;
    display: none;
    border-left: 4px solid var(--danger);
}

.success-message {
    background: #e8f5e9;
    color: var(--success);
    padding: 15px;
    border-radius: 12px;
    margin: 10px 0;
    display: none;
    border-left: 4px solid var(--success);
}

/* ========== СТРАНИЦА УСПЕХА ========== */
.success-page {
    text-align: center;
    padding: 60px 20px;
    max-width: 500px;
    margin: 0 auto;
}

.success-icon {
    font-size: 5rem;
    margin-bottom: 20px;
    animation: bounce 1s;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

.success-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 30px;
    flex-wrap: wrap;
}

/* ========== АДАПТИВНОСТЬ ========== */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }

    .navbar {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .nav-user {
        flex-direction: column;
        width: 100%;
    }

    .btn-sm {
        width: 100%;
    }

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

    .status-header {
        flex-direction: column;
        text-align: center;
    }

    .modal-content {
        margin: 20px;
        padding: 20px;
    }

    .success-actions {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }
}
/* ========== ДОПОЛНИТЕЛЬНЫЕ СТИЛИ ДЛЯ ЗАГРУЗКИ ФАЙЛОВ ========== */

/* Стили для области загрузки вакансии */
.vacancy-field {
    margin: 30px 0 20px;
    padding-top: 20px;
    border-top: 2px solid var(--border);
}

.vacancy-field label {
    display: block;
    margin-bottom: 15px;
    font-weight: 600;
    color: var(--text);
    font-size: 1.1rem;
}

.vacancy-dropzone {
    border-color: #ff9800;
    background: rgba(255, 152, 0, 0.02);
}

.vacancy-dropzone:hover {
    border-color: #ff9800;
    background: rgba(255, 152, 0, 0.05);
}

.vacancy-dropzone.dragover {
    border-color: #ff9800;
    background: rgba(255, 152, 0, 0.1);
}

/* Информация о загруженном файле вакансии */
.vacancy-file-info {
    background: #fff3e0;
    padding: 12px 16px;
    border-radius: 10px;
    border-left: 4px solid #ff9800;
    margin-top: 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.95rem;
    color: #663c00;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Кнопка сброса файла */
.reset-file-btn {
    background: #ff9800;
    color: white;
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(255, 152, 0, 0.3);
}

.reset-file-btn:hover {
    background: #f57c00;
    transform: scale(1.1);
}

/* Адаптация для мобильных устройств */
@media (max-width: 768px) {
    .vacancy-file-info {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .reset-file-btn {
        width: 32px;
        height: 32px;
    }
}

/* Стили для состояния загрузки */
.dropzone.loading {
    opacity: 0.6;
    pointer-events: none;
    position: relative;
}

.dropzone.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 30px;
    height: 30px;
    margin: -15px 0 0 -15px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Индикатор прогресса загрузки */
.upload-progress {
    margin-top: 15px;
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    overflow: hidden;
}

.upload-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), #ff9800);
    transition: width 0.3s ease;
}

/* Сообщение о размере файла */
.file-size-warning {
    color: var(--warning);
    font-size: 0.85rem;
    margin-top: 5px;
    padding: 5px 10px;
    background: #fff3e0;
    border-radius: 6px;
    display: inline-block;
}

/* Иконки для разных типов файлов */
.file-icon-pdf { color: #f44336; }
.file-icon-docx { color: #2196f3; }
.file-icon-txt { color: #4caf50; }

/* Анимация появления кнопки анализа */
#analyze-btn {
    animation: fadeInUp 0.5s ease;
    margin-top: 20px;
}

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

/* Стили для отображения информации о двух файлах */
.files-info {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.file-info-card {
    flex: 1;
    min-width: 200px;
    background: var(--background-alt);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 15px;
}

.file-info-card.resume {
    border-left: 4px solid var(--primary);
}

.file-info-card.vacancy {
    border-left: 4px solid #ff9800;
}

.file-info-card .file-label {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-bottom: 5px;
}

.file-info-card .file-name {
    font-weight: 600;
    margin-bottom: 5px;
    word-break: break-word;
}

.file-info-card .file-meta {
    font-size: 0.85rem;
    color: var(--text-light);
}

/* Подсказки */
.upload-hint {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-top: 5px;
}

.upload-hint i {
    font-style: normal;
    color: var(--primary);
}

/* Разделитель между загрузками */
.upload-separator {
    text-align: center;
    margin: 20px 0;
    position: relative;
}

.upload-separator::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--border);
    z-index: 1;
}

.upload-separator span {
    background: white;
    padding: 0 15px;
    color: var(--text-light);
    font-size: 0.9rem;
    position: relative;
    z-index: 2;
}

/* Уведомление об успешной загрузке */
.upload-success {
    background: #e8f5e9;
    border-radius: 8px;
    padding: 8px 12px;
    margin-top: 10px;
    font-size: 0.9rem;
    color: #2e7d32;
    display: flex;
    align-items: center;
    gap: 8px;
}

.upload-success::before {
    content: '✓';
    background: #4caf50;
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}
/* ========== SUPPORT PAGE ========== */
.support-page {
    max-width: 700px;
    margin: 0 auto;
    padding: 2rem 0;
}

.support-page h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.support-description {
    color: var(--text-secondary);
    margin-bottom: 2rem;
    font-size: 1.1rem;
}

.support-form {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

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

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

.form-group label .required {
    color: #e74c3c;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-group input[type="file"] {
    padding: 0.5rem 0;
    border: none;
}

.form-group small {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
}

.result-message {
    margin-top: 1.5rem;
    padding: 1rem;
    border-radius: 8px;
    text-align: center;
}

.result-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.result-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}