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

body {
    font-family: 'Segoe UI', Roboto, system-ui, sans-serif;
    background: #1a1e2b;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #e0e0e0;
}

.app {
    display: flex;
    width: 100%;
    height: 100vh;
    max-width: 1600px;
    background: #1a1e2b;
    box-shadow: 0 0 30px rgba(0,0,0,0.7);
    overflow: hidden;
}

/* Боковая панель */
.sidebar {
    width: 300px;
    background: #242937;
    padding: 20px 16px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 24px;
    border-right: 1px solid #3a4050;
    box-shadow: 4px 0 15px rgba(0,0,0,0.3);
    z-index: 10;
}

.sidebar-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sidebar-section h3 {
    font-size: 16px;
    font-weight: 600;
    color: #b0b9d0;
    margin-bottom: 4px;
    letter-spacing: 0.3px;
}

.sidebar-section input[type="text"],
.sidebar-section input[type="file"] {
    padding: 10px 12px;
    background: #1a1e2b;
    border: 1px solid #3a4050;
    border-radius: 8px;
    color: white;
    font-size: 14px;
    outline: none;
    transition: border 0.2s;
}

.sidebar-section input[type="text"]:focus {
    border-color: #e67e22;
}

.sidebar-section input[type="file"] {
    padding: 8px;
    cursor: pointer;
}

.sidebar-section input[type="file"]::file-selector-button {
    background: #3a4050;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    color: white;
    margin-right: 10px;
    cursor: pointer;
}

.color-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.color-row input[type="color"] {
    width: 50px;
    height: 38px;
    border: 1px solid #3a4050;
    border-radius: 8px;
    background: transparent;
    cursor: pointer;
}

.checkbox-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 8px 0;
}

.checkbox-row input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.note {
    font-size: 12px;
    color: #9aa1b0;
    margin-top: 4px;
}

/* Кнопки */
.btn {
    padding: 10px 16px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.15s;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    text-align: center;
}

.btn-primary {
    background: #e67e22;
    color: white;
}

.btn-primary:hover {
    background: #d35400;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

.btn-secondary {
    background: #3498db;
    color: white;
}

.btn-secondary:hover {
    background: #2980b9;
    transform: translateY(-2px);
}

.btn-template {
    background: #2ecc71;
    color: white;
    flex: 1;
    padding: 8px 0;
}

.btn-template:hover {
    background: #27ae60;
}

.btn-icon {
    background: #5d6d7e;
    color: white;
    padding: 8px 12px;
    font-size: 16px;
}

.btn-icon:hover {
    background: #34495e;
}

.template-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.zoom-controls {
    flex-direction: row !important;
    margin-top: auto;
}

/* Область редактора */
.editor-area {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0f131c;
    padding: 16px;
    overflow: hidden;
}

.canvas-wrapper {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0f131c;
    border-radius: 12px;
    box-shadow: inset 0 0 20px #00000088;
}

#canvas {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    display: block;
    box-shadow: 0 0 0 2px #2c3e50;
    background: white;
}

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

.modal.show {
    display: flex;
}

.modal-content {
    background: #242937;
    border-radius: 16px;
    padding: 25px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 30px #00000099;
    border: 1px solid #3a4050;
    position: relative;
}

.modal-content h2 {
    margin-bottom: 20px;
    color: #e0e0e0;
    font-size: 22px;
}

.close-modal {
    position: absolute;
    right: 20px;
    top: 15px;
    font-size: 28px;
    color: #aaa;
    cursor: pointer;
    line-height: 1;
}
.close-modal:hover { color: white; }

.form-group {
    margin-bottom: 18px;
}
.form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    color: #b0b9d0;
}
.form-group input, 
.form-group textarea {
    width: 100%;
    padding: 12px;
    background: #1a1e2b;
    border: 1px solid #3a4050;
    border-radius: 8px;
    color: white;
    font-size: 15px;
}
.req { color: #e74c3c; }

.format-options {
    background: #1a1e2b;
    padding: 10px 15px;
    border-radius: 8px;
}
.format-option {
    display: block;
    margin: 8px 0;
}
.format-option input {
    width: auto;
    margin-right: 8px;
}

.form-status {
    margin-top: 15px;
    text-align: center;
    font-size: 14px;
}
.form-status.success { color: #2ecc71; }
.form-status.error { color: #e74c3c; }

#orderSubmitBtn {
    width: 100%;
    padding: 14px;
    font-size: 16px;
    margin-top: 10px;
}

/*кнопка домой*/
.home-button {
  position: fixed;
  top: 10px;
  left: 250px;
  width: 40px;
  height: 40px;
  background: linear-gradient(145deg, #4CAF50, #3d8b40);
  border-radius: 30%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: white;
  box-shadow: 
    0 4px 12px rgba(0, 0, 0, 0.2),
    inset 0 2px 0 rgba(255, 255, 255, 0.3),
    inset 0 -2px 0 rgba(0, 0, 0, 0.2);
  z-index: 1000;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  cursor: pointer;
  overflow: hidden;
}
.home-icon {
  width: 30px;
  height: 30px;
  transition: all 0.3s ease;
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.2));
}
/* Обёртка редактора с заголовком */
.editor-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.editor-title {
    text-align: center;
    color: #ffffff;
    font-size: 18px;
    font-weight: 600;
    padding: 8px 20px;
    margin: 0;
    background: #0f131c;
    border-bottom: 1px solid #2c3e50;
    flex-shrink: 0;
}


/* Адаптив для мобильных */
@media (max-width: 768px) {
    .app {
        flex-direction: column;
    }
    .sidebar {
        width: 100%;
        height: auto;
        max-height: 45vh;
        border-right: none;
        border-bottom: 1px solid #3a4050;
        padding: 16px;
        overflow-y: auto;
    }
    .editor-area {
        padding: 8px;
    }
    .template-buttons {
        justify-content: space-between;
    }
    .modal-content {
        padding: 20px 15px;
        max-height: 85vh;
    }
	.home-button {
	left: 340px;}
}

