/* Общие стили */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #8B5CF6;
    --primary-hover: #7C3AED;
    --primary-light: #EDE9FE;
    --secondary-color: #6366F1;
    --success-color: #10B981;
    --success-hover: #059669;
    --error-color: #EF4444;
    --error-hover: #DC2626;
    --warning-color: #F59E0B;
    --text-primary: #111827;
    --text-secondary: #6B7280;
    --border-color: #E5E7EB;
    --bg-color: #F9FAFB;
    --card-bg: #FFFFFF;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    color: var(--text-primary);
}

.container {
    width: 100%;
    max-width: 600px; /* Стандартная ширина для одной карточки */
    position: relative;
    transition: max-width 0.4s ease-in-out; /* Плавный переход ширины */
}

.container.container--wide {
    max-width: 1200px; /* Ширина для двух карточек */
}


/* Карточка */
.card {
    background: var(--card-bg);
    border-radius: 24px;
    padding: 32px; /* Уменьшаем отступы */
    box-shadow: var(--shadow-xl);
    animation: slideUp 0.4s ease-out;
}

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

/* Логотип */
.logo {
    display: flex;
    justify-content: center;
    margin-bottom: 24px;
}

/* Заголовки */
h1 {
    font-size: 32px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 8px;
    color: var(--text-primary);
}

h2 {
    font-size: 28px;
    text-align: center;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-primary);
}

h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
}

.subtitle {
    text-align: center;
    color: var(--text-secondary);
    font-size: 16px;
    margin-bottom: 32px;
}

.contact-subtitle {
    font-size: 14px; /* Делаем текст чуть меньше */
    margin-top: 0; /* Убираем отрицательный отступ, вызывающий наложение */
    margin-bottom: 24px;
}

.highlight {
    color: var(--primary-color);
    font-weight: 600;
}

/* Шаги */
.step {
    display: none;
}

.step.active {
    display: block;
}

/* Заголовок шага */
.step-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.back-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 14px;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 8px;
    transition: all 0.2s;
}

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

.order-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.order-label {
    font-size: 14px;
    color: var(--text-secondary);
}

.order-number {
    font-size: 16px;
    font-weight: 600;
    color: var(--primary-color);
}

/* Формы */
.form-group {

    margin-bottom: 24px;
}

label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--text-primary);
}

input[type="text"],
input[type="url"] {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    font-size: 16px;
    transition: all 0.2s;
    font-family: inherit;
}

input[type="text"]:focus,
input[type="url"]:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px var(--primary-light);
}

.input-hint {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    font-size: 13px;
    color: var(--text-secondary);
}

/* Кнопки */
.btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px; /* Убираем width: 100% */
    padding: 14px 24px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

/* Добавляем класс для кнопок, которые должны занимать всю ширину */
.btn-full-width {
    width: 100%;
}

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

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

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

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

.btn-primary:disabled {
    background: var(--border-color);
    color: var(--text-secondary); /* Изменяем цвет текста */
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-secondary {
    background: var(--bg-color);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
}

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

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

.btn-success:hover {
    background: var(--success-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 14px 0 rgba(16, 185, 129, 0.3);
}

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

.btn-danger:hover {
    background: var(--error-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 14px 0 rgba(239, 68, 68, 0.3);
}

.btn-text {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    padding: 4px;
}

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

.btn-outline-light {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.7);
    color: white;
}

.btn-outline-light:hover {
    background: rgba(255, 255, 255, 0.1);
}


/* Анимация точек */
.loading-dots-large {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-left: 8px;
}

.loading-dots-large span {
    width: 8px;
    height: 8px;
    background-color: currentColor;
    border-radius: 50%;
    animation: blink-large 1.4s infinite both;
}

.loading-dots-large span:nth-child(2) {
    animation-delay: 0.2s;
}

.loading-dots-large span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes blink-large {
    0%, 100% {
        opacity: 0.3;
        transform: scale(0.8);
    }
    40% {
        opacity: 1;
        transform: scale(1);
    }
}


/* Методы загрузки */
.upload-methods {
    display: grid;
    gap: 16px;
    margin-bottom: 24px;
}

.method-card {
    padding: 24px;
    border: 2px solid var(--border-color);
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.method-card:hover {
    border-color: var(--primary-color);
    background: var(--primary-light);
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.method-icon {
    display: flex;
    justify-content: center;
    margin-bottom: 16px;
}

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

.method-card p {
    font-size: 14px;
    color: var(--text-secondary);
}

/* Зона загрузки */
.upload-title {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    margin-bottom: 8px;
}

.upload-title h2 {
    margin-bottom: 0;
}

.step3-layout {
    display: grid;
    justify-content: center;
    grid-template-columns: minmax(0, 600px);
    gap: 24px;
}

/* Делаем так, чтобы карточка с drop-zone растягивалась по высоте */
@media (min-width: 901px) {
    .step3-layout.two-columns > .card:first-child {
        display: flex;
        flex-direction: column;
    }

    .step3-layout.two-columns > .card:first-child .drop-zone {
        flex-grow: 1;
        display: flex; /* Для центрирования контента внутри */
    }
}

.drop-zone {
    border: 3px dashed var(--border-color);
    border-radius: 16px;
    padding: 24px;
    text-align: center;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.drop-zone-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.drop-zone.drag-over {
    border-color: var(--primary-color);
    background: var(--primary-light);
}

.drop-zone-content svg {
    margin-bottom: 16px;
}

.drop-zone-content h3 {
    margin-top: 16px;
    margin-bottom: 8px;
}

.drop-zone-content p {
    color: var(--text-secondary);
    margin: 16px 0;
}

.file-hint {
    margin-top: 16px;
    font-size: 13px;
    color: var(--text-secondary);
}

/* Список файлов */
.file-list {
    height: 400px; /* Фиксированная высота */
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 8px; /* Добавляем отступ для скроллбара */
}

.file-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg-color);
    border-radius: 8px;
    margin-bottom: 8px;
}

.file-info {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0; /* Позволяет блоку сжиматься */
}

.file-actions {
    display: flex;
    gap: 4px;
}

.file-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    transition: background-color 0.2s;
}

.file-action-btn.file-view {
    color: var(--primary-color);
}

.file-action-btn.file-view:hover {
    background-color: var(--primary-light);
}

.file-action-btn.file-remove {
    color: var(--error-color);
}

.file-action-btn.file-remove:hover {
    background: #FEE2E2;
}


.file-icon {
    width: 40px;
    height: 40px;
    background: var(--primary-light);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    font-weight: 600;
    font-size: 12px;
    flex-shrink: 0; /* Запрещаем иконке сжиматься */
    overflow: hidden; /* Скрываем части изображения, выходящие за рамки */
}

.file-preview-image {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Масштабируем изображение, чтобы оно заполнило блок */
}


.file-info-details {
    flex: 1;
    min-width: 0; /* Позволяет блоку сжиматься */
}

.file-name {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-size {
    font-size: 12px;
    color: var(--text-secondary);
}

/* Прогресс загрузки */
.upload-progress {
    margin-top: 24px;
}

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

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    border-radius: 4px;
    transition: width 0.3s ease;
    width: 0%;
}

.progress-text {
    text-align: center;
    font-size: 14px;
    color: var(--text-secondary);
}

/* Контейнер кнопок */
.action-buttons {
    display: flex; /* Меняем grid на flex */
    gap: 12px;
    margin-top: 24px;
}

/* Задаем кнопке "Убрать всё" фиксированную ширину и запрещаем перенос */
#clearAllBtn {
    flex-shrink: 0; /* Запрещаем кнопке сжиматься */
    white-space: nowrap; /* Запрещаем перенос текста */
}

/* Кнопка "Загрузить" будет занимать всё оставшееся место */
#uploadBtn {
    flex-grow: 1; /* Разрешаем кнопке растягиваться */
    min-width: 0; /* Позволяем кнопке сжиматься, если нужно */
}

/* Результат проверки ссылки */
.link-check-result {
    padding: 16px;
    border-radius: 12px;
    margin-top: 16px;
    display: flex; /* Используем flexbox */
    flex-direction: column; /* Элементы в колонку */
    gap: 16px; /* Расстояние между текстом и кнопкой */
}

.link-check-result p {
    margin-bottom: 0; /* Убираем старый отступ, теперь есть gap */
    text-align: left; /* Выравниваем текст по левому краю */
}

.link-check-button-wrapper {
    display: flex;
    justify-content: center;
    width: 100%;
}

.link-check-result.success {
    background: #D1FAE5;
    color: #065F46;
}

.link-check-result.warning {
    background: #FEF3C7;
    color: #92400E;
}

.link-check-result.error {
    background: #FEE2E2;
    color: #991B1B;
}

/* Обработка */
.processing-animation {
    display: flex;
    justify-content: center;
    margin-bottom: 24px;
}

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

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

.processing-steps {
    margin-top: 32px;
}

.processing-step {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    margin-bottom: 8px;
    border-radius: 8px;
    background: var(--bg-color);
    transition: all 0.3s;
    border: 1px solid transparent;
}

.processing-step.active {
    background: rgba(139, 92, 246, 0.15);
    border-color: rgba(139, 92, 246, 0.3);
    color: #4c1d95;
    font-weight: 600;
}

.processing-step.completed {
    background: #D1FAE5;
    border-color: #6EE7B7;
    color: #065F46;
}

.step-icon {
    font-size: 20px;
}

/* Успех */
.success-animation {
    display: flex;
    justify-content: center;
    margin-bottom: 24px;
    animation: scaleIn 0.5s ease-out;
}

.error-animation {
    display: flex;
    justify-content: center;
    margin-bottom: 24px;
    animation: scaleIn 0.5s ease-out;
}


@keyframes scaleIn {
    from {
        transform: scale(0);
    }
    to {
        transform: scale(1);
    }
}

.success-info {
    background: var(--bg-color);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.info-label {
    font-size: 14px;
    color: var(--text-secondary);
}

.info-value {
    font-size: 16px;
    font-weight: 600;
    color: var(--primary-color);
}

.contact-feedback-section {
    margin-top: 32px;
    text-align: center;
    border: 2px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
}

.contact-feedback-section h3 {
    margin-bottom: 8px;
}

.contact-feedback-section p {
    margin-bottom: 16px;
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.5;
}


/* Сообщения об ошибках */
.error-message {
    padding: 12px 16px;
    background: #FEE2E2;
    color: #991B1B;
    border-radius: 8px;
    margin-top: 16px;
    font-size: 14px;
}

/* Модальное окно */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 16px;
    padding: 32px;
    max-width: 400px;
    width: 90%;
    animation: slideUp 0.3s ease-out;
}

.modal-content h3 {
    margin-bottom: 16px;
}

.modal-content p {
    color: var(--text-secondary);
    margin-bottom: 24px;
    line-height: 1.6;
}

.modal-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

/* Всплывающее уведомление (Toast) */
.toast-notification {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #2d3748;
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    z-index: 2000;
    font-size: 14px;
    font-weight: 500;
    animation: slideDown 0.5s ease-out, fadeOut 0.5s ease-in 3.5s forwards;
}

@keyframes slideDown {
    from {
        top: -100px;
        opacity: 0;
    }
    to {
        top: 20px;
        opacity: 1;
    }
}

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


/* Адаптивность */
@media (min-width: 901px) {
    .step3-layout.two-columns {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    }
}


@media (max-width: 768px) {
    .card {
        padding: 24px;
        border-radius: 16px;
    }

    h1 {
        font-size: 28px;
    }

    h2 {
        font-size: 24px;
    }

    .upload-methods {
        grid-template-columns: 1fr;
    }

    .modal-buttons {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    body {
        padding: 12px;
    }

    .card {
        padding: 20px;
    }

    h1 {
        font-size: 24px;
    }

    h2 {
        font-size: 20px;
    }

    .btn {
        padding: 12px 20px;
        font-size: 15px;
    }
}

/* Скрытие текста Drag-and-Drop на мобильных */
@media (orientation: portrait) {
    .desktop-only {
        display: none;
    }
}


/* Скроллбар */
.file-list::-webkit-scrollbar {
    width: 8px;
}

.file-list::-webkit-scrollbar-track {
    background: var(--bg-color);
    border-radius: 4px;
}

.file-list::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

.file-list::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* ==============================================
   СТИЛИ ДЛЯ СОГЛАШЕНИЯ И ФУТЕРА
   ============================================== */

/* Стили для текста соглашения под кнопкой */
.consent-text {
    font-size: 12px;
    color: var(--text-secondary); /* Используем цвет из вашей темы */
    text-align: center;
    margin-top: 16px; /* Отступ от кнопки */
    line-height: 1.5;
}

/* Стили для ссылок в тексте соглашения */
.consent-text a {
    color: var(--primary-color); /* Используем основной цвет */
    text-decoration: underline;
}

.consent-text a:hover {
    color: var(--primary-hover); /* Цвет при наведении */
}

/* Стили для "футера" */
.footer-text {
    font-size: 13px;
    color: #4b5563;
    opacity: 0.8;
    text-align: center;
    line-height: 1.6; /* Интервал для двух строк */
    /* Убрали position: fixed, bottom и z-index.
       Теперь позиционирование контролируется из new-style.css */
}

/* Ссылки в футере */
.footer-text a {
    color: inherit; /* Такой же цвет, как у текста */
    text-decoration: underline;
    font-weight: 500;
    transition: color 0.2s;
}

/* Ссылки при наведении */
.footer-text a:hover {
    color: var(--primary-color); /* Становятся основным цветом */
    opacity: 1;
}

/* Разделитель "|" */
.footer-text .footer-divider {
    opacity: 0.6;
    user-select: none; /* Его нельзя выделить */
    /* Убираем разделитель на маленьких экранах,
       чтобы ссылки были одна под другой
    */
}

/* Адаптивность: на телефонах делаем ссылки одна под другой */
@media (max-width: 480px) {
    .footer-text {
        font-size: 12px;
        bottom: 10px; /* Чуть выше */
    }

    /* Прячем разделитель */
    .footer-text .footer-divider {
        display: none;
    }

    /* Делаем ссылки блочными (одна под другой) */
    .footer-text a {
        display: block;
        margin-top: 4px;
    }
}

/* ==============================================
   СТИЛИ ДЛЯ УВЕДОМЛЕНИЯ О COOKIE
   ============================================== */

.cookie-consent {
    /* По умолчанию баннер видим, но будет скрыт через JS, если согласие не дано */
    opacity: 0;
    transform: translate(-50%, 100px); /* Объединяем центрирование и смещение для анимации */
    pointer-events: none;
    transition: opacity 0.5s ease-out, transform 0.5s ease-out;

    position: fixed;
    bottom: 20px;
    left: 50%;
    z-index: 1500;
    width: calc(100% - 40px); /* Отступы по бокам */
    background: rgba(31, 41, 55, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #f9fafb;
    border-radius: 16px;
    padding: 16px 24px;
    box-shadow: var(--shadow-xl);
    max-width: 1100px; /* Ограничиваем максимальную ширину */
}

/* Если согласие еще не дано, плавно показываем баннер */
.cookie-consent.visible {
    opacity: 1;
    transform: translateX(-50%); /* В конечном состоянии оставляем только центрирование */
    pointer-events: auto;
}

/* Если согласие уже было дано (класс добавляется до отрисовки), баннер не будет показан */
.cookie-consent-given .cookie-consent {
    display: none;
}

.cookie-consent-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    max-width: 1200px;
    margin: 0 auto;
    /* Убираем flex-wrap, чтобы на десктопе кнопки не переносились */
}

@media (max-width: 640px) {
    .cookie-consent-content {
        flex-direction: column; /* На маленьких экранах ставим элементы в колонку */
        text-align: center;
    }
}

.cookie-text {
    font-size: 14px;
    line-height: 1.5;
    margin: 0;
}

.cookie-buttons {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.cookie-text a {
    color: #a78bfa; /* Светло-фиолетовый, хорошо виден на темном фоне */
    text-decoration: underline;
}
