* { 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: 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; }

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: 0.2s; }
button[type="submit"]:hover:not(:disabled) { background: #0056b3; }
button[type="submit"]:disabled { background: #8fb8e0; cursor: not-allowed; }

.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; }

@keyframes fadeIn { from { opacity: 0; transform: translateY(-5px); } to { opacity: 1; transform: translateY(0); } }
@keyframes spin { to { transform: rotate(360deg); } }

.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; }
.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; }
.progress-fill { height: 100%; width: 0%; background: linear-gradient(90deg, #007bff, #28a745); border-radius: 11px; transition: 0.4s; }
.progress-text { display: flex; justify-content: space-between; font-size: 14px; color: #333; font-weight: 600; }
#progressPercent { font-size: 20px; color: #007bff; }

.result-box { text-align: center; margin-top: 24px; padding: 24px; background: #f0fff4; border-radius: 10px; border: 1px solid #b7ebc6; animation: fadeIn 0.3s; }
.download-btn { display: inline-block; background: #28a745; color: #fff; padding: 12px 24px; text-decoration: none; border-radius: 8px; font-weight: bold; }
.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; }

.promo-video-container { margin-top: 25px; display: flex; justify-content: center; gap: 15px; flex-wrap: wrap; }
.promo-video { max-height: 250px; border-radius: 12px; box-shadow: 0 4px 15px rgba(0,0,0,0.1); }

/* ===== ВИЗУАЛЬНЫЙ РЕДАКТОР ===== */
.btn-secondary { background: #6c757d; color: #fff; border: none; padding: 8px 16px; border-radius: 6px; cursor: pointer; font-weight: 600; transition: 0.2s; }
.btn-secondary:hover { opacity: 0.9; }
.btn-icon { padding: 5px 10px; font-size: 18px; background: #e2e6ea; color: #333; border: none; border-radius: 4px; cursor: pointer; }
.btn-small { padding: 4px 10px; font-size: 12px; background: #fff; border: 1px solid #ccc; border-radius: 4px; cursor: pointer; font-weight: bold; }
.btn-small.danger { color: #dc3545; border-color: #dc3545; }

.obj-controls { display: flex; justify-content: space-between; align-items: center; background: #e3f2fd; padding: 8px 15px; border-radius: 8px; border: 1px solid #b6d4fe; margin-bottom: 15px; font-size: 13px; }

/* Дизайн Линейки для редактора */
.canvas-ruler-wrapper { position: relative; padding: 25px 0 0 25px; background: #ebeced; border: 1px solid #ccc; border-radius: 8px; overflow: auto; max-height: 60vh; }
.ruler-x { position: absolute; top: 0; left: 25px; right: 0; height: 25px; background: #f8f9fa; border-bottom: 1px solid #999; overflow: hidden; }
.ruler-y { position: absolute; top: 25px; left: 0; bottom: 0; width: 25px; background: #f8f9fa; border-right: 1px solid #999; overflow: hidden; }
.canvas-inner { box-shadow: 0 4px 15px rgba(0,0,0,0.2); display: inline-block; background: #fff; }

/* ===== Кнопка Менеджера Файлов ===== */
.file-btn-wrapper { text-align: center; margin: 35px 0; }
.file-btn { display: inline-block; background: linear-gradient(135deg, #c0392b, #e67e22); color: #fff; font-size: 1.2rem; font-weight: 700; padding: 20px 40px; border-radius: 50px; box-shadow: 0 8px 25px rgba(192, 57, 43, 0.4); border: 3px solid #fff; cursor: pointer; width: 100%; transition: 0.3s; }
.file-btn:hover { transform: scale(1.03); box-shadow: 0 12px 35px rgba(192, 57, 43, 0.6); }
.file-btn small { font-size: 0.85rem; font-weight: 400; display: block; opacity: 0.85; margin-top: 5px; }

/* ===== Модальное окно Файлов ===== */
.file-modal { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.7); backdrop-filter: blur(6px); z-index: 2000; justify-content: center; align-items: center; }
.file-modal.open { display: flex; }
.file-modal-content { background: #fff; max-width: 700px; width: 90%; border-radius: 24px; padding: 28px 32px; border: 3px solid #c0392b; position: relative; max-height: 90vh; overflow-y: auto; }
.file-modal-close { position: absolute; top: 16px; right: 22px; font-size: 1.8rem; color: #999; cursor: pointer; background: none; border: none; }
.file-modal-close:hover { color: #c0392b; }

.login-form { display: flex; flex-direction: column; gap: 14px; margin: 18px 0; }
.login-form input { padding: 13px 18px; border-radius: 30px; border: 2px solid #ddd; background: #f8f9fa; font-size: 0.95rem; outline: none; }
.login-form input:focus { border-color: #c0392b; }
.login-form button { padding: 13px 20px; border-radius: 30px; border: none; background: linear-gradient(135deg, #c0392b, #e67e22); color: #fff; font-weight: 700; cursor: pointer; }
.login-error { color: #c0392b; display: none; text-align: center; padding: 8px; background: #fdf0ef; border-radius: 16px; }

.file-manager { display: none; }
.file-manager.open { display: block; }
.file-list { background: #f8f9fa; border-radius: 16px; padding: 14px; margin: 12px 0; max-height: 220px; overflow-y: auto; border: 1px solid #ddd; }
.file-item { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-bottom: 1px solid #eee; font-size: 0.9rem; }
.file-name { flex: 1; }
.file-actions { display: flex; gap: 6px; }
.file-actions a { color: #c0392b; text-decoration: none; padding: 3px 10px; border-radius: 16px; border: 1px solid #c0392b; font-size: 0.8rem; }
.delete-btn { color: #c0392b; border: 1px solid #c0392b; cursor: pointer; background: none; padding: 3px 10px; border-radius: 16px; font-size: 0.8rem; }
.upload-area { display: flex; gap: 10px; flex-wrap: wrap; }
.upload-area input[type="file"] { flex: 1; padding: 8px; border-radius: 20px; border: 2px dashed #ccc; font-size: 0.85rem; min-width: 140px; }
.upload-btn { padding: 10px 22px; border-radius: 22px; border: none; background: linear-gradient(135deg, #c0392b, #e67e22); color: #fff; font-weight: 600; cursor: pointer; }
.logout-btn { background: none; border: 1px solid #ccc; color: #999; padding: 5px 14px; border-radius: 16px; cursor: pointer; font-size: 0.85rem; }
.file-hint { color: #999; font-size: 0.8rem; margin-top: 8px; }

@media (max-width: 480px) { .container { padding: 24px; } h1 { font-size: 22px; } }
