:root {
  --bg: #111118;
  --bg-deep: #090b17;
  --panel: rgba(23, 23, 42, 0.88);
  --panel-strong: rgba(29, 29, 52, 0.95);
  --panel-border: rgba(123, 115, 201, 0.24);
  --text: #f4f3fb;
  --muted: #c9c5d8;
  --muted-strong: #dbd6e9;
  --cyan: #6ddcff;
  --pink: #ff5fcf;
  --purple: #8e89ff;
  --danger: #ff7575;
  --warning: #ffcf6d;
  --success: #70f0b6;
  color-scheme: dark;
  font-family: Manrope, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg-deep);
  color: var(--text);
}

* {
  box-sizing: border-box;
}

body {
  background:
    radial-gradient(circle at 50% 0%, rgba(190, 72, 108, 0.18), transparent 34rem),
    linear-gradient(180deg, #0a1020 0%, #0b0f1d 48%, #15151c 100%);
  margin: 0;
  min-height: 100vh;
}

button,
input,
select {
  font: inherit;
}

button {
  border: 0;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--purple), var(--pink));
  box-shadow: 0 12px 30px rgba(255, 95, 207, 0.16);
  color: var(--text);
  cursor: pointer;
  font-weight: 800;
  padding: 10px 14px;
}

button.secondary {
  background: rgba(244, 243, 251, 0.08);
  border: 1px solid rgba(109, 220, 255, 0.22);
  box-shadow: none;
  color: var(--text);
}

button.danger {
  background: rgba(255, 117, 117, 0.16);
  color: var(--danger);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

input,
select {
  background: rgba(9, 11, 23, 0.72);
  border: 1px solid rgba(219, 214, 233, 0.18);
  border-radius: 6px;
  color: var(--text);
  min-height: 40px;
  padding: 8px 10px;
  width: 100%;
}

label {
  color: var(--muted-strong);
  display: grid;
  gap: 6px;
  font-size: 13px;
  font-weight: 800;
}

h1,
h2,
h3 {
  font-family: Sora, Manrope, ui-sans-serif, system-ui, sans-serif;
  letter-spacing: 0;
  margin-top: 0;
}

h1 {
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.05;
}

h2 {
  font-size: 20px;
}

.eyebrow {
  color: var(--cyan);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  margin: 0 0 7px;
  text-transform: uppercase;
}

.shell {
  margin: 0 auto;
  max-width: 1160px;
  padding: 24px;
}

.topbar {
  align-items: center;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.brand {
  font-family: Sora, Manrope, ui-sans-serif, system-ui, sans-serif;
  font-size: 23px;
  font-weight: 800;
  letter-spacing: 0;
}

.brand::before {
  background: linear-gradient(135deg, var(--cyan), var(--purple) 52%, var(--pink));
  border-radius: 999px;
  content: "";
  display: inline-block;
  height: 12px;
  margin-right: 10px;
  width: 12px;
}

.tabs,
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.panel {
  backdrop-filter: blur(18px);
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.24);
  padding: 18px;
}

.grid {
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 1fr) 360px;
}

.dropzone {
  align-items: center;
  background:
    linear-gradient(rgba(17, 17, 24, 0.68), rgba(17, 17, 24, 0.68)),
    linear-gradient(135deg, rgba(109, 220, 255, 0.18), rgba(255, 95, 207, 0.14));
  border: 1px dashed rgba(109, 220, 255, 0.44);
  border-radius: 8px;
  display: flex;
  min-height: 220px;
  justify-content: center;
  padding: 22px;
  text-align: center;
}

.dropzone.dragging {
  background:
    linear-gradient(rgba(17, 17, 24, 0.55), rgba(17, 17, 24, 0.55)),
    linear-gradient(135deg, rgba(109, 220, 255, 0.28), rgba(255, 95, 207, 0.2));
  border-color: var(--cyan);
}

.form-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 14px;
}

.form-grid button {
  align-self: end;
}

.job-list {
  display: grid;
  gap: 10px;
}

.job-row {
  align-items: center;
  background: var(--panel-strong);
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 14px;
}

.muted {
  color: var(--muted);
}

.status {
  border-radius: 999px;
  background: rgba(244, 243, 251, 0.09);
  color: var(--muted-strong);
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 8px;
  text-transform: uppercase;
}

.status.complete {
  background: rgba(112, 240, 182, 0.12);
  color: var(--success);
}

.status.processing,
.status.queued,
.status.provisioning_gpu,
.status.gpu_ready,
.status.uploading_output {
  background: rgba(255, 207, 109, 0.13);
  color: var(--warning);
}

.status.processing_failed,
.status.gpu_start_failed,
.status.no_gpu_available,
.status.auth_failed,
.status.upload_failed,
.status.output_upload_failed,
.status.cancelled,
.status.cleanup_failed {
  background: rgba(255, 117, 117, 0.14);
  color: var(--danger);
}

.metrics {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 16px;
}

.metric {
  background: var(--panel-strong);
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  padding: 14px;
}

.metric strong {
  display: block;
  font-size: 22px;
  margin-top: 3px;
}

.events {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.event {
  background: rgba(9, 11, 23, 0.48);
  border-left: 3px solid var(--cyan);
  border-radius: 0 6px 6px 0;
  padding: 8px 10px;
}

.offer-option {
  align-items: flex-start;
  background: rgba(9, 11, 23, 0.48);
  border: 1px solid rgba(219, 214, 233, 0.14);
  border-left: 3px solid rgba(109, 220, 255, 0.58);
  box-shadow: none;
  color: var(--text);
  display: grid;
  gap: 5px;
  margin-bottom: 8px;
  padding: 10px 12px;
  text-align: left;
  width: 100%;
}

.offer-option strong,
.offer-option small {
  display: block;
}

.offer-option small {
  color: var(--cyan);
  font-size: 11px;
  font-weight: 800;
  margin-top: 3px;
  text-transform: uppercase;
}

.offer-option.selected {
  background:
    linear-gradient(rgba(23, 23, 42, 0.82), rgba(23, 23, 42, 0.82)),
    linear-gradient(90deg, rgba(109, 220, 255, 0.26), rgba(255, 95, 207, 0.22));
  border-color: rgba(109, 220, 255, 0.62);
}

.login {
  margin: 12vh auto 0;
  max-width: 420px;
}

.error {
  color: var(--danger);
  font-weight: 650;
}

@media (max-width: 800px) {
  .grid,
  .form-grid,
  .metrics {
    grid-template-columns: 1fr;
  }

  .shell {
    padding: 16px;
  }
}
