:root {
  --bg: #0f172a;
  --card: #020617;
  --border: #1e293b;
  --text: #e5e7eb;
  --muted: #94a3b8;
  --primary: #38bdf8;
  --primary-hover: #0ea5e9;
  --success: #22c55e;
  --error: #ef4444;
}

* {
  box-sizing: border-box;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(1200px circle at top, #020617, var(--bg));
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

/* Container */
.container {
  width: 100%;
  max-width: 720px;
}

/* Card */
.card {
  background: linear-gradient(180deg, #020617, #020617ee);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 2rem;
  box-shadow: 0 25px 50px rgba(0,0,0,0.5);
  overflow: hidden;
}

/* Header */
h1 {
  margin: 0;
  font-size: 1.8rem;
}

.subtitle {
  margin-top: 0.4rem;
  color: var(--muted);
  line-height: 1.4;
}

/* Form */
form {
  margin-top: 1.75rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

/* Kill stray text nodes in grid */
form > :not(input):not(textarea):not(div):not(button):not(label):not(small) {
  display: none;
}

/* Inputs */
input,
textarea {
  background: #020617;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.7rem 0.75rem;
  border-radius: 8px;
  font-size: 0.95rem;
}

input::placeholder,
textarea::placeholder {
  color: var(--muted);
}

input:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary);
}

/* Full width inputs */
.full {
  grid-column: 1 / -1;
}

/* Notes */
textarea {
  grid-column: 1 / -1;
  min-height: 110px;
  resize: vertical;
}

/* Quantity */
.quantity {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  max-width: 160px;
  margin-bottom: 1rem;
}

.quantity label {
  font-size: 0.8rem;
  color: var(--muted);
}

/* Quantity controls */
.qty-control {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.qty-control input {
  width: 64px;
  height: 36px;
  text-align: center;
  border-radius: 8px;
  padding: 0;
  font-size: 1rem;
}

.qty-control button {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #020617;
  color: var(--text);
  cursor: pointer;

  display: flex;
  align-items: center;
  justify-content: center;

  font-size: 1.25rem;
  padding: 0;
  margin: 0;
  white-space: normal;
}

.qty-control button:hover {
  border-color: var(--primary);
}

.helper {
  font-size: 0.75rem;
  color: var(--muted);
}

/* Submit button */
form > button[type="submit"] {
  grid-column: 1 / -1;
  width: 100%;
  min-height: 48px;

  margin-top: 0.75rem;
  padding: 0.9rem 1rem;

  font-size: 1rem;
  font-weight: 700;

  background: linear-gradient(180deg, var(--primary), var(--primary-hover));
  color: #020617;

  border: none;
  border-radius: 10px;

  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.1s ease;

  white-space: nowrap;
}

form > button[type="submit"]:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 25px rgba(56,189,248,0.25);
}

form > button[type="submit"]:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Messages */
.message {
  display: none;
  margin-top: 1rem;
  padding: 0.75rem;
  border-radius: 8px;
  font-size: 0.95rem;
}

.message.success {
  background: rgba(34,197,94,0.15);
  color: var(--success);
}

.message.error {
  background: rgba(239,68,68,0.15);
  color: var(--error);
}

/* Mobile */
@media (max-width: 640px) {
  form {
    grid-template-columns: 1fr;
  }
}
