* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif; background: #f4f6f8; color: #222; line-height: 1.6; padding: 20px; }
.container { max-width: 640px; margin: 0 auto; background: #fff; padding: 40px; border-radius: 12px; box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08); }
header { margin-bottom: 30px; text-align: center; }
h1 { font-size: 28px; margin-bottom: 8px; color: #1a1a1a; }
.subtitle { color: #666; font-size: 15px; }
.form-group { margin-bottom: 22px; }
label { display: block; margin-bottom: 8px; font-weight: 600; font-size: 14px; color: #333; }
.file-drop { position: relative; border: 2px dashed #c3cbd6; border-radius: 8px; padding: 24px; text-align: center; background: #fafbfc; cursor: pointer; transition: border-color 0.2s, background 0.2s; }
.file-drop:hover { border-color: #007bff; background: #f0f7ff; }
.file-drop input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
#fileName { color: #555; font-size: 14px; pointer-events: none; }
input[type="range"] { width: 100%; accent-color: #007bff; }
select { width: 100%; padding: 10px; border: 1px solid #c3cbd6; border-radius: 6px; font-size: 14px; background: #fff; cursor: pointer; }
button[type="submit"] { width: 100%; background: #007bff; color: #fff; padding: 14px; border: none; border-radius: 8px; font-size: 16px; font-weight: 600; cursor: pointer; transition: background 0.2s; }
button[type="submit"]:hover:not(:disabled) { background: #0056b3; }
button[type="submit"]:disabled { background: #8fb8e0; cursor: not-allowed; }
.loading { text-align: center; margin-top: 30px; padding: 20px; background: #f0f7ff; border-radius: 8px; }
.spinner { width: 36px; height: 36px; margin: 0 auto 12px; border: 4px solid #d0e2ff; border-top-color: #007bff; border-radius: 50%; animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.download-btn { display: inline-block; margin-top: 10px; background: #28a745; color: #fff; padding: 12px 24px; text-decoration: none; border-radius: 8px; font-weight: 600; transition: background 0.2s; }
.download-btn:hover { background: #218838; }
@media (max-width: 480px) { .container { padding: 24px; } h1 { font-size: 22px; } }
.checkbox-group {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 22px;
    background: #f0f7ff;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #c3cbd6;
}
.checkbox-group input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #007bff;
}
.checkbox-group label {
    margin-bottom: 0;
    cursor: pointer;
}
.checkbox-group {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 15px;
    background: #f0f7ff;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #c3cbd6;
}
.checkbox-group input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #007bff;
}
.checkbox-group label {
    margin-bottom: 0;
    cursor: pointer;
    font-weight: 600;
}
.sub-group {
    margin-left: 15px;
    padding-left: 15px;
    border-left: 3px solid #007bff;
    margin-bottom: 25px;
    animation: fadeIn 0.3s ease-in-out;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ===== Плашка "Сервер занят" ===== */
.busy-box {
    display: flex;
    align-items: center;
    gap: 16px;
    background: #fff7e6;
    border: 1px solid #ffd591;
    border-left: 5px solid #fa8c16;
    padding: 16px 20px;
    border-radius: 10px;
    margin-bottom: 24px;
    animation: fadeIn 0.3s ease-in-out;
}
.busy-icon {
    font-size: 32px;
    animation: spin 2s linear infinite;
}
.busy-text strong {
    display: block;
    color: #ad4e00;
    font-size: 16px;
    margin-bottom: 4px;
}
.busy-text p {
    color: #874d00;
    font-size: 14px;
    margin: 0;
}

/* ===== Прогресс-бар ===== */
.loading {
    text-align: center;
    margin-top: 30px;
    padding: 24px;
    background: #f0f7ff;
    border-radius: 10px;
}
.progress-bar {
    width: 100%;
    height: 22px;
    background: #d0e2ff;
    border-radius: 11px;
    overflow: hidden;
    margin-bottom: 12px;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
}
.progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #007bff, #28a745);
    border-radius: 11px;
    transition: width 0.4s ease;
}
.progress-text {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    color: #333;
    font-weight: 600;
}
#progressPercent {
    font-size: 20px;
    color: #007bff;
    font-weight: 700;
}
#progressMessage {
    color: #666;
    font-weight: 500;
}

/* ===== Результат ===== */
.result-box {
    text-align: center;
    margin-top: 24px;
    padding: 24px;
    background: #f0fff4;
    border-radius: 10px;
    border: 1px solid #b7ebc6;
    animation: fadeIn 0.3s ease-in-out;
}

/* ===== Ошибка ===== */
.error-box {
    margin-top: 24px;
    padding: 18px 22px;
    background: #fff1f0;
    border: 1px solid #ffa39e;
    border-left: 5px solid #f5222d;
    border-radius: 10px;
    color: #a8071a;
    font-weight: 600;
    animation: fadeIn 0.3s ease-in-out;
}

/* ===== Анимации ===== */
@keyframes spin {
    to { transform: rotate(360deg); }
}
