:root {
  color-scheme: light dark;
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.5;
  background-color: #f1f5f9;
  color: #0f172a;
  margin: 0;
}

body {
  margin: 0;
}

.app-root {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: radial-gradient(circle at top, rgba(59, 130, 246, 0.12), transparent 60%),
    radial-gradient(circle at bottom, rgba(16, 185, 129, 0.12), transparent 55%);
}

.card {
  width: min(440px, 100%);
  background-color: rgba(255, 255, 255, 0.85);
  border-radius: 16px;
  box-shadow: 0 16px 60px rgba(15, 23, 42, 0.16);
  padding: 28px;
  backdrop-filter: blur(12px);
}

.card header h1 {
  margin: 0;
  font-size: 1.75rem;
}

.subtitle {
  margin: 4px 0 0;
  color: #475569;
  font-size: 0.95rem;
}

.alert {
  margin-top: 16px;
  font-size: 0.95rem;
  color: #0f172a;
  background-color: #e0f2fe;
  border-radius: 12px;
  padding: 12px 14px;
  display: none;
}

.alert.visible {
  display: block;
}

.alert.error {
  background-color: #fee2e2;
  color: #b91c1c;
}

.alert.success {
  background-color: #dcfce7;
  color: #166534;
}

form {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

label {
  display: grid;
  gap: 6px;
  font-weight: 500;
  color: #0f172a;
}

label span.optional {
  font-weight: 400;
  color: #64748b;
  font-size: 0.85rem;
}

input,
select {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.6);
  font-size: 1rem;
  background-color: rgba(241, 245, 249, 0.8);
  color: inherit;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input:focus,
select:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.25);
}

button {
  padding: 12px 16px;
  border-radius: 12px;
  border: none;
  background-color: #2563eb;
  color: #ffffff;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

button.secondary {
  background: none;
  color: #2563eb;
}

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

button:hover:not(:disabled) {
  background-color: #1d4ed8;
  transform: translateY(-1px);
}

.machine-summary {
  margin-top: 18px;
  padding: 14px;
  border-radius: 12px;
  background-color: rgba(15, 23, 42, 0.05);
  display: grid;
  gap: 8px;
  font-size: 0.95rem;
}

.machine-summary strong {
  font-weight: 600;
}

.actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 20px;
}

.actions button {
  flex: 1;
}

.status-text {
  margin-top: 16px;
  font-size: 0.95rem;
  color: #334155;
}

.spinner {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 3px solid rgba(37, 99, 235, 0.14);
  border-top-color: #2563eb;
  animation: spin 0.8s linear infinite;
  display: inline-block;
  vertical-align: middle;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-color-scheme: dark) {
  :root {
    background-color: #0f172a;
    color: #e2e8f0;
  }

  .card {
    background-color: rgba(15, 23, 42, 0.75);
    color: #e2e8f0;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.4);
  }

  .subtitle {
    color: #94a3b8;
  }

  .alert {
    background-color: rgba(37, 99, 235, 0.16);
    color: #bfdbfe;
  }

  .alert.error {
    background-color: rgba(248, 113, 113, 0.2);
    color: #fecaca;
  }

  .alert.success {
    background-color: rgba(34, 197, 94, 0.18);
    color: #bbf7d0;
  }

  input,
  select {
    background-color: rgba(15, 23, 42, 0.5);
    border-color: rgba(148, 163, 184, 0.35);
  }

  input:focus,
  select:focus {
    border-color: #60a5fa;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.32);
  }

  button.secondary {
    color: #93c5fd;
  }

  .machine-summary {
    background-color: rgba(148, 163, 184, 0.12);
  }

  .status-text {
    color: #cbd5f5;
  }
}
