* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; background: #f5f5f5; color: #333; }

.container { max-width: 900px; margin: 0 auto; padding: 20px; }

h1 { text-align: center; margin: 20px 0; font-size: 28px; color: #1a1a2e; }
h2 { margin: 15px 0 10px; font-size: 20px; }

/* Auth */
.auth-box { max-width: 400px; margin: 80px auto; background: #fff; padding: 40px; border-radius: 12px; box-shadow: 0 2px 20px rgba(0,0,0,0.1); }
.auth-box h2 { text-align: center; margin-bottom: 20px; }
.auth-box input { width: 100%; padding: 12px; margin: 8px 0; border: 1px solid #ddd; border-radius: 8px; font-size: 14px; }
.auth-box button { width: 100%; padding: 14px; margin-top: 15px; background: #4361ee; color: #fff; border: none; border-radius: 8px; font-size: 16px; cursor: pointer; }
.auth-box button:hover { background: #3a56d4; }
.auth-box .toggle { text-align: center; margin-top: 15px; font-size: 13px; }
.auth-box .toggle a { color: #4361ee; cursor: pointer; text-decoration: none; }

/* Screen visibility */
.screen { display: none; }
.screen.active { display: block; }

/* Input screen */
.product-card { background: #fff; border-radius: 10px; padding: 20px; margin: 15px 0; box-shadow: 0 1px 5px rgba(0,0,0,0.08); }
.product-card input[type="text"] { width: 100%; padding: 10px; border: 1px solid #ddd; border-radius: 6px; font-size: 14px; margin: 5px 0; }
.product-card textarea { width: 100%; padding: 10px; border: 1px solid #ddd; border-radius: 6px; font-size: 14px; margin: 5px 0; resize: vertical; height: 60px; }
.product-card .file-input { margin: 10px 0; }
.product-card .file-preview { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0; }
.product-card .file-preview img { width: 60px; height: 60px; object-fit: cover; border-radius: 4px; border: 1px solid #ddd; }
.product-card .image-count { font-size: 12px; color: #666; }

.mode-selector { margin: 20px 0; }
.mode-selector label { display: block; padding: 8px 12px; margin: 4px 0; background: #fff; border-radius: 6px; cursor: pointer; border: 2px solid transparent; }
.mode-selector label:hover { border-color: #4361ee; }
.mode-selector input[type="radio"]:checked + span { color: #4361ee; font-weight: 600; }

.btn { padding: 12px 30px; border: none; border-radius: 8px; font-size: 15px; cursor: pointer; margin: 5px; }
.btn-primary { background: #4361ee; color: #fff; }
.btn-primary:hover { background: #3a56d4; }
.btn-primary:disabled { background: #aaa; cursor: not-allowed; }
.btn-secondary { background: #e0e0e0; color: #333; }
.btn-danger { background: #e74c3c; color: #fff; }
.btn-success { background: #27ae60; color: #fff; }
.btn-small { padding: 6px 14px; font-size: 13px; }

.add-product { text-align: center; margin: 15px 0; }

/* Processing */
.progress-container { max-width: 500px; margin: 100px auto; text-align: center; background: #fff; padding: 50px; border-radius: 12px; box-shadow: 0 2px 20px rgba(0,0,0,0.1); }
.progress-bar { width: 100%; height: 20px; background: #e0e0e0; border-radius: 10px; overflow: hidden; margin: 20px 0; }
.progress-fill { height: 100%; background: linear-gradient(90deg, #4361ee, #3a86ff); border-radius: 10px; transition: width 0.5s; }
.progress-text { font-size: 14px; color: #666; margin: 10px 0; }
.progress-stage { font-size: 16px; font-weight: 600; margin: 10px 0; }

/* Results */
.result-product { background: #fff; border-radius: 10px; padding: 20px; margin: 15px 0; box-shadow: 0 1px 5px rgba(0,0,0,0.08); }
.result-product h3 { margin-bottom: 10px; }
.result-grid { display: flex; gap: 10px; flex-wrap: wrap; }
.result-grid .thumb-wrapper { position: relative; }
.result-grid img { width: 150px; height: 150px; object-fit: cover; border-radius: 6px; cursor: pointer; border: 3px solid transparent; transition: border 0.2s; }
.result-grid img.selected { border-color: #4361ee; }
.result-grid img:hover { opacity: 0.9; }

.result-actions { margin: 15px 0; display: flex; gap: 10px; flex-wrap: wrap; }

/* Modal */
.modal-overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.8); z-index: 100; justify-content: center; align-items: center; }
.modal-overlay.active { display: flex; }
.modal-overlay img { max-width: 90%; max-height: 90%; border-radius: 8px; }
.modal-close { position: fixed; top: 20px; right: 30px; color: #fff; font-size: 32px; cursor: pointer; z-index: 101; }

/* Toolbar */
.toolbar { display: flex; justify-content: space-between; align-items: center; padding: 15px 0; border-bottom: 1px solid #ddd; margin-bottom: 20px; }
.toolbar .user-info { font-size: 14px; color: #666; }
.toolbar .logout-btn { background: none; border: none; color: #e74c3c; cursor: pointer; font-size: 14px; }
