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

body {
  font-family: -apple-system, "PingFang TC", "Microsoft JhengHei", sans-serif;
  background: #f4f6fa;
  color: #2d2d2d;
  min-height: 100vh;
}

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

header {
  text-align: center;
  margin-bottom: 40px;
}
header h1 {
  font-size: 28px;
  font-weight: 700;
  color: #1a1a2e;
  letter-spacing: 1px;
}
header p {
  font-size: 13px;
  color: #888;
  margin-top: 6px;
  letter-spacing: 2px;
}

/* Steps */
.step { display: none; }
.step.active { display: block; }

h2 {
  font-size: 18px;
  font-weight: 600;
  color: #1a1a2e;
  margin-bottom: 20px;
}

/* Type cards */
.type-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}

.type-card {
  background: #fff;
  border: 2px solid #e8ecf0;
  border-radius: 14px;
  padding: 28px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
}
.type-card:hover {
  border-color: #6c63ff;
  box-shadow: 0 4px 20px rgba(108, 99, 255, 0.12);
  transform: translateY(-2px);
}
.type-card .icon { font-size: 36px; margin-bottom: 12px; }
.type-card h3 { font-size: 15px; font-weight: 600; margin-bottom: 8px; color: #1a1a2e; }
.type-card p { font-size: 12px; color: #888; line-height: 1.6; }

/* Form */
.form-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}
.back-btn {
  background: none;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 6px 14px;
  font-size: 13px;
  cursor: pointer;
  color: #555;
  transition: all 0.2s;
}
.back-btn:hover { background: #f0f0f0; }

.form-section {
  background: #fff;
  border-radius: 14px;
  padding: 24px;
  margin-bottom: 20px;
  border: 1px solid #e8ecf0;
}
.form-section h3 {
  font-size: 15px;
  font-weight: 600;
  color: #6c63ff;
  margin-bottom: 18px;
  padding-bottom: 10px;
  border-bottom: 1px solid #f0f0f0;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 14px;
}
.field-row.full { grid-template-columns: 1fr; }

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.field label {
  font-size: 12px;
  font-weight: 500;
  color: #666;
}
.field label .required { color: #e74c3c; margin-left: 2px; }

.field input, .field textarea, .field select {
  border: 1px solid #dde2e8;
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 14px;
  font-family: inherit;
  color: #2d2d2d;
  transition: border 0.2s;
  background: #fafbfc;
}
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none;
  border-color: #6c63ff;
  background: #fff;
}
.field textarea { resize: vertical; min-height: 70px; }

.field input[type="number"] { -moz-appearance: textfield; }

/* Tags input for products */
.tags-container {
  border: 1px solid #dde2e8;
  border-radius: 8px;
  padding: 8px;
  background: #fafbfc;
  min-height: 44px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  cursor: text;
}
.tags-container:focus-within { border-color: #6c63ff; background: #fff; }
.tag {
  background: #ede9ff;
  color: #6c63ff;
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.tag .remove { cursor: pointer; font-size: 15px; line-height: 1; color: #999; }
.tag .remove:hover { color: #e74c3c; }
.tags-input {
  border: none;
  outline: none;
  font-size: 14px;
  font-family: inherit;
  background: transparent;
  min-width: 120px;
  flex: 1;
}

.hint { font-size: 11px; color: #aaa; margin-top: 2px; }

/* Amount display */
.amount-summary {
  background: #f8f7ff;
  border: 1px solid #ede9ff;
  border-radius: 10px;
  padding: 16px 20px;
  margin-top: 8px;
}
.amount-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: #555;
  padding: 4px 0;
}
.amount-row.total {
  font-weight: 700;
  font-size: 15px;
  color: #1a1a2e;
  border-top: 1px solid #ddd;
  margin-top: 8px;
  padding-top: 10px;
}

.form-actions {
  text-align: center;
  margin-top: 8px;
}
.generate-btn {
  background: #6c63ff;
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 14px 48px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  letter-spacing: 0.5px;
}
.generate-btn:hover { background: #5a52d5; transform: translateY(-1px); box-shadow: 0 4px 16px rgba(108,99,255,0.3); }
.generate-btn:active { transform: translateY(0); }

/* Loading */
.loading {
  position: fixed;
  inset: 0;
  background: rgba(255,255,255,0.85);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  font-size: 16px;
  color: #555;
}
.loading.hidden { display: none; }
.spinner {
  width: 40px; height: 40px;
  border: 3px solid #ede9ff;
  border-top-color: #6c63ff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Auth pages */
.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f4f6fa;
  padding: 24px;
}
.auth-box {
  background: #fff;
  border-radius: 18px;
  padding: 40px 36px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 4px 30px rgba(0,0,0,0.08);
}
.auth-logo { text-align: center; margin-bottom: 28px; }
.auth-logo h1 { font-size: 20px; font-weight: 700; color: #1a1a2e; }
.auth-logo p { font-size: 12px; color: #aaa; margin-top: 4px; letter-spacing: 2px; }
.auth-btn {
  width: 100%;
  background: #6c63ff;
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 12px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 20px;
  transition: background 0.2s;
}
.auth-btn:hover { background: #5a52d5; }
.auth-link { text-align: center; font-size: 13px; color: #888; margin-top: 16px; }
.auth-link a { color: #6c63ff; text-decoration: none; }
.alert {
  background: #ffeaea;
  color: #c0392b;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  margin-bottom: 16px;
}
.alert.success { background: #eafff3; color: #27ae60; }

/* Admin table */
.user-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.user-table th {
  text-align: left;
  padding: 8px 12px;
  color: #888;
  font-weight: 500;
  border-bottom: 1px solid #f0f0f0;
}
.user-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #f8f8f8;
}
.action-btn {
  border: none;
  border-radius: 6px;
  padding: 5px 14px;
  font-size: 12px;
  cursor: pointer;
  font-weight: 500;
  margin-right: 6px;
}
.action-btn.approve { background: #eafff3; color: #27ae60; }
.action-btn.approve:hover { background: #27ae60; color: #fff; }
.action-btn.reject { background: #ffeaea; color: #e74c3c; }
.action-btn.reject:hover { background: #e74c3c; color: #fff; }

@media (max-width: 600px) {
  .field-row { grid-template-columns: 1fr; }
  .type-grid { grid-template-columns: 1fr 1fr; }
}
