/* public/styles.css — полностью адаптивный, единый стиль */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e8f0 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;      /* вертикальное расположение */
    padding: 20px;
    margin: 0;
}


/* Общий контейнер для всех страниц */
.container, .settings-container {
    max-width: 800px;
    width: 100%;
    background: white;
    border-radius: 32px;
    box-shadow: 0 25px 45px -12px rgba(0,0,0,0.25);
    padding: 40px 30px 50px;
    margin: 0 auto;              /* центрирование по горизонтали */
}

/* Для главной страницы — центрирование текста */
.container {
    text-align: center;
}

/* Для страницы настроек — выравнивание по левому краю */
.settings-container {
    text-align: left;
}

.app-header {
    display: flex;
    align-items: flex-start; /* выравнивание по верхнему краю */
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 30px;
    flex-wrap: wrap; /* для мобильных устройств */
}

.logo {
    max-width: 200px;
    height: auto;
    flex-shrink: 0;
}

.header-right {
    flex: 1;
    text-align: right; /* заголовок и инфо-блок выравниваются вправо */
}

.header-right h1 {
    margin: 0 0 8px 0;
    font-size: 1.8rem;
}

/* Инфоблок в шапке */
#infoBlock.info-block {
    background: #f8fafc;
    border-radius: 16px;
    padding: 12px 20px;
    display: inline-block; /* чтобы блок занимал ширину по содержимому */
    text-align: right; /* внутренний текст — по левому краю */
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}


h1 {
    font-size: 2rem;
    color: #1e2a3a;
    margin-bottom: 16px;
    word-break: break-word;
}

h2 {
    font-size: 1.5rem;
    color: #1e2a3a;
    margin: 20px 0 16px;
}

.badge {
    display: inline-block;
    background: #f0b400;
    padding: 6px 14px;
    border-radius: 40px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 24px;
}

p {
    color: #334155;
    font-size: 1.1rem;
    line-height: 1.5;
    margin-bottom: 20px;
}

.contact-block {
    background: #f8fafc;
    border-radius: 24px;
    padding: 24px 20px;
}

.contact-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 12px;
}

.button-group {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
    margin: 20px 0;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: #1e2a3a;
    color: white;
    text-decoration: none;
    font-weight: 600;
    padding: 12px 24px;
    border-radius: 60px;
    transition: 0.2s;
    border: none;
    cursor: pointer;
    font-size: 1rem;
}

.btn-auth {
    background: #f0b400;
    color: #1e2a3a;
}
.btn-auth:hover {
    background: #e0a800;
    transform: scale(1.02);
}
.btn-max {
    background: #1e2a3a;
    color: white;
}
.btn-max:hover {
    background: #0f172a;
    transform: scale(1.02);
}

/* Блоки информации (для настроек) */
.info-block {
    background: #f8fafc;
    border-radius: 24px;
    padding: 20px;
    margin: 20px 0;
}
.info-block p {
    margin-bottom: 10px;
    font-size: 1rem;
}
.info-block strong {
    color: #0f172a;
}

.marketplace-data {
    background: #f1f5f9;
    border-radius: 16px;
    padding: 16px;
    overflow-x: auto;
}
.marketplace-data pre {
    margin: 0;
    font-family: monospace;
    font-size: 0.85rem;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* Модальное окно (адаптивное) */
.modal {
    display: none;
    position: fixed;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}
.modal-content {
    background: white;
    padding: 30px;
    border-radius: 28px;
    width: 90%;
    max-width: 400px;
    text-align: center;
    position: relative;
}
.modal-content input {
    width: 100%;
    padding: 12px;
    margin: 15px 0;
    border: 1px solid #ccc;
    border-radius: 60px;
    font-size: 1rem;
    text-align: center;
}
.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #eee;
    border-top-color: #f0b400;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}
.close {
    position: absolute;
    right: 20px;
    top: 10px;
    font-size: 28px;
    cursor: pointer;
}

/* Убираем старый margin-top, теперь подвал прижимается через margin-top: auto */
.footer {
    text-align: center;
    font-size: 0.8rem;
    color: #94a3b8;
    padding: 20px 0 10px;
    width: 100%;                /* гарантия полной ширины */
}

/* АДАПТИВНОСТЬ ДЛЯ МОБИЛЬНЫХ УСТРОЙСТВ */
@media (max-width: 640px) {
    body {
        padding: 12px;
    }
    .container, .settings-container {
        padding: 24px 20px 30px;
        border-radius: 28px;
    }
    h1 {
        font-size: 1.6rem;
    }
    h2 {
        font-size: 1.3rem;
    }
    p {
        font-size: 1rem;
    }
    .btn {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
    .button-group {
        gap: 12px;
    }
    .modal-content {
        padding: 20px;
    }
	.app-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    .header-right {
        text-align: center;
        width: 100%;
    }
    #infoBlock.info-block {
        width: 100%;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .container, .settings-container {
        padding: 20px 16px 30px;
    }
    h1 {
        font-size: 1.4rem;
    }
    .logo {
        max-width: 140px;
    }
    .btn {
        padding: 8px 16px;
        font-size: 0.85rem;
    }
    .modal-content {
        padding: 16px;
    }
}

/* === Дополнительные стили для формы настроек === */

.dynamic-field-group {
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e2e8f0;
}
.dynamic-row {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 8px;
}
.dynamic-row input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid #cbd5e1;
    border-radius: 60px;
    font-size: 0.95rem;
}
.dynamic-row button {
    background: #ef4444;
    color: white;
    border: none;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.dynamic-row button:hover {
    background: #dc2626;
}
.add-row-btn {
    background: #f0b400;
    color: #1e2a3a;
    border: none;
    padding: 6px 14px;
    border-radius: 60px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    margin-top: 6px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.add-row-btn:hover {
    background: #e0a800;
}

/* Блоки маркетплейсов */
.marketplace-block {
    background: #f8fafc;
    border-radius: 24px;
    padding: 20px;
    margin-bottom: 24px;
}
.marketplace-block h3 {
    margin: 0 0 16px 0;
    color: #0f172a;
    font-size: 1.3rem;
}
.marketplace-field {
    margin-bottom: 16px;
}
.marketplace-field label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #1e2a3a;
}
.marketplace-field input, 
.marketplace-field textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #cbd5e1;
    border-radius: 60px;
    font-size: 0.95rem;
}
.marketplace-field textarea {
    border-radius: 20px;
    resize: vertical;
    min-height: 80px;
}

/* Переключатель (toggle) */
.toggle-switch {
    display: flex;
    align-items: center;
    gap: 15px;
    margin: 20px 0;
}
.toggle-switch label {
    font-weight: 600;
    color: #1e2a3a;
}
.switch {
    position: relative;
    display: inline-block;
    width: 52px;
    height: 26px;
}
.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}
.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.3s;
    border-radius: 34px;
}
.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}
input:checked + .slider {
    background-color: #f0b400;
}
input:checked + .slider:before {
    transform: translateX(26px);
}

/* JSON превью */
.json-preview {
    background: #1e2a3a;
    color: #e2e8f0;
    padding: 16px;
    border-radius: 20px;
    overflow-x: auto;
    font-family: monospace;
    font-size: 0.85rem;
    white-space: pre-wrap;
    margin: 20px 0;
}