* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #0f1117;
  color: #e1e4e8;
  min-height: 100vh;
  position: relative;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: url('/bg.jpg') center/cover no-repeat;
  opacity: 0.5;
  pointer-events: none;
  z-index: 0;
}
.container { max-width: 800px; margin: 0 auto; padding: 20px; position: relative; z-index: 1; }
.container::before {
  content: "";
  position: absolute;
  top: -1px; left: 10%; right: 10%; height: 2px;
  background: linear-gradient(90deg, transparent, #58a6ff, #3fb950, #58a6ff, transparent);
  border-radius: 1px;
  opacity: 0.6;
}
.container::after {
  content: "";
  position: absolute;
  bottom: -1px; left: 10%; right: 10%; height: 2px;
  background: linear-gradient(90deg, transparent, #58a6ff, #3fb950, #58a6ff, transparent);
  border-radius: 1px;
  opacity: 0.6;
}
header { text-align: center; padding: 30px 0 20px; }
header h1 {
  font-size: 2em;
  background: linear-gradient(135deg, #58a6ff, #3fb950);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.subtitle { color: #8b949e; margin-top: 4px; }

.page { display: none; }
.page.active { display: block; }

.card {
  background: #161b22;
  border: 1px solid #30363d;
  border-radius: 8px;
  padding: 24px;
  margin-bottom: 20px;
}
.card h2 { font-size: 1.1em; margin-bottom: 16px; color: #f0f6fc; }

.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: 0.9em; margin-bottom: 4px; color: #8b949e; }
.form-group input {
  width: 100%;
  padding: 10px 12px;
  background: #0d1117;
  border: 1px solid #30363d;
  border-radius: 6px;
  color: #e1e4e8;
  font-size: 1em;
}
.form-group input:focus { outline: none; border-color: #58a6ff; }
.form-group select {
  width: 100%;
  padding: 10px 12px;
  background: #0d1117;
  border: 1px solid #30363d;
  border-radius: 6px;
  color: #e1e4e8;
  font-size: 1em;
}
.form-group select:focus { outline: none; border-color: #58a6ff; }

.checkbox-group { display: flex; flex-direction: column; gap: 6px; }
.checkbox-label {
  display: flex !important;
  align-items: center;
  gap: 8px;
  font-size: 0.95em !important;
  color: #e1e4e8 !important;
  cursor: pointer;
}
.checkbox-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #238636;
}

.btn-primary {
  width: 100%;
  padding: 12px;
  background: #238636;
  border: none;
  border-radius: 6px;
  color: #fff;
  font-size: 1em;
  font-weight: 600;
  cursor: pointer;
}
.btn-primary:hover { background: #2ea043; }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-back {
  background: none;
  border: 1px solid #30363d;
  color: #58a6ff;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  margin-bottom: 12px;
  font-size: 0.9em;
}

/* Progress */
.progress-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 16px;
}
.progress-header h2 { font-size: 1.1em; color: #f0f6fc; margin: 0; }
.progress-timer {
  font-size: 1.5em; font-weight: 700;
  color: #58a6ff;
  font-variant-numeric: tabular-nums;
  letter-spacing: 1px;
}
.progress-bar-wrap {
  background: #0d1117;
  border-radius: 20px;
  padding: 3px;
  margin-bottom: 20px;
  border: 1px solid #21262d;
}
.progress-bar {
  height: 10px;
  background: #21262d;
  border-radius: 16px;
  overflow: hidden;
  position: relative;
}
.progress-fill {
  height: 100%;
  width: 40%;
  background: linear-gradient(90deg, #238636, #3fb950, #58a6ff, #3fb950);
  background-size: 300% 100%;
  border-radius: 16px;
  position: absolute;
  left: -10%;
  animation: run 2.5s ease-in-out infinite;
}
@keyframes run {
  0%   { left: -40%; width: 40%; }
  50%  { width: 60%; }
  100% { left: 100%; width: 40%; }
}

/* Step list */
.step-list { display: flex; flex-direction: column; gap: 6px; }
.step-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 0.95em;
  transition: all 0.3s ease;
}
.step-item.pending { color: #484f58; }
.step-item.active {
  color: #f0f6fc;
  background: rgba(56, 139, 253, 0.1);
  border: 1px solid rgba(56, 139, 253, 0.25);
  box-shadow: 0 0 20px rgba(56, 139, 253, 0.05);
}
.step-item.done { color: #3fb950; }
.step-icon {
  width: 24px; height: 24px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
  flex-shrink: 0;
}
.step-item.pending .step-icon {
  background: #161b22; border: 2px solid #30363d;
  color: #484f58;
}
.step-item.active .step-icon {
  background: rgba(56,139,253,0.15); border: 2px solid #388bfd;
  color: #58a6ff;
  box-shadow: 0 0 12px rgba(56,139,253,0.3);
}
.step-item.done .step-icon {
  background: #238636; border: 2px solid #3fb950;
  color: #fff;
}
.step-name { flex: 1; font-weight: 500; }
.step-status { font-size: 0.8em; }
.step-item.done .step-status { color: #3fb950; }
.step-item.active .step-status { color: #58a6ff; }
.step-item.pending .step-status { color: #484f58; }

.report-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 0; border-bottom: 1px solid #21262d;
}
.report-item:last-child { border-bottom: none; }
.report-ticker { font-weight: 600; color: #58a6ff; }
.report-date { color: #8b949e; font-size: 0.85em; }
.report-status { font-size: 0.85em; }
.status-completed { color: #3fb950; }
.status-error { color: #f85149; }
.status-pending { color: #d29922; }
.report-cost { color: #8b949e; font-size: 0.85em; }
.report-view { color: #58a6ff; cursor: pointer; text-decoration: underline; }

.muted { color: #484f58; font-size: 0.9em; }
footer { text-align: center; padding: 20px; color: #484f58; font-size: 0.8em; }

/* Top bar */
.top-bar {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 0; margin-bottom: 16px; flex-wrap: wrap;
}
.balance-display { font-size: 1em; font-weight: 600; color: #3fb950; margin-right: auto; }
.btn-small {
  background: #21262d; border: 1px solid #30363d; color: #e1e4e8;
  padding: 6px 14px; border-radius: 6px; cursor: pointer; font-size: 0.85em;
}
.btn-small:hover { background: #30363d; }
.btn-logout { color: #f85149; }

/* Auth */
.auth-toggle { text-align: center; margin-top: 12px; font-size: 0.9em; color: #8b949e; }
.auth-toggle a { color: #58a6ff; text-decoration: none; }
.error-msg { color: #f85149; font-size: 0.85em; text-align: center; margin-top: 8px; }

/* Report header buttons */
.report-actions { display: flex; gap: 8px; }
.btn-pdf {
  background: #1f6feb; border: none; color: #fff;
  padding: 6px 16px; border-radius: 6px; cursor: pointer; font-size: 0.85em;
}
.btn-pdf:hover { background: #388bfd; }

#report-content {
  max-width: 100%;
  overflow-x: auto;
}
#report-content h1, #report-content h2, #report-content h3 {
  color: #f0f6fc;
  margin: 16px 0 8px;
}
#report-content p { margin: 8px 0; line-height: 1.6; }
#report-content pre {
  background: #0d1117;
  padding: 12px;
  border-radius: 6px;
  overflow-x: auto;
  font-size: 0.85em;
}
#report-content code { background: #0d1117; padding: 2px 6px; border-radius: 3px; font-size: 0.85em; }
#report-content hr { border: none; border-top: 1px solid #30363d; margin: 16px 0; }
#report-content table { border-collapse: collapse; width: 100%; margin: 8px 0; }
#report-content th, #report-content td { border: 1px solid #30363d; padding: 6px 10px; text-align: left; }
#report-content th { background: #161b22; }
