:root {
  --bg: #f5f6f8;
  --panel: #ffffff;
  --panel-border: #d8dce3;
  --text: #1f2937;
  --muted: #5c6b80;
  --accent: #1d4ed8;
  --accent-muted: #93c5fd;
  --danger: #dc2626;
  --warning: #f97316;
  --success: #047857;
  font-family: "Inter", "Segoe UI", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: inherit;
  background: var(--bg);
  color: var(--text);
}

h1,
h2,
h3,
h4,
h5,
h6 {
  color: var(--text);
  margin: 0;
}

p {
  margin: 0 0 8px;
}

.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.app-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 24px;
  border-bottom: 1px solid var(--panel-border);
  background: var(--panel);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

.app-header h1 {
  font-size: 1.5rem;
  margin-bottom: 6px;
}

.app-header p {
  color: var(--muted);
  max-width: 520px;
}

.app-header span {
  font-size: 0.85rem;
  color: var(--muted);
}

.app-main {
  flex: 1;
  width: min(960px, 100%);
  margin: 24px auto;
  padding: 0 24px 48px;
}

.card {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 24px;
}

.card-header p {
  color: var(--muted);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--accent-muted);
  color: var(--accent);
  background: #eff6ff;
}

.alert {
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 24px;
}

.alert strong {
  display: block;
  margin-bottom: 6px;
}

.alert-error {
  border: 1px solid rgba(220, 38, 38, 0.3);
  background: rgba(254, 226, 226, 0.8);
  color: #7f1d1d;
}

.alert-warning {
  border: 1px solid rgba(249, 115, 22, 0.3);
  background: rgba(255, 237, 213, 0.8);
  color: #7c2d12;
}

.field-group {
  border: none;
  padding: 0;
  margin: 0 0 32px;
}

.field-group legend {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 12px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}

.field-label {
  font-weight: 600;
  color: #111827;
}

.required {
  color: var(--danger);
}

.input {
  width: 100%;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid var(--panel-border);
  background: #f8fafc;
  font-size: 1rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
  background: #fff;
}

.input-multiline {
  min-height: 120px;
  resize: vertical;
}

.choices-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.choice {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  background: #f8fafc;
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.choice:hover {
  border-color: var(--accent);
  box-shadow: 0 1px 0 rgba(37, 99, 235, 0.2);
}

.choice input {
  accent-color: var(--accent);
}

.choice-inline {
  display: inline-flex;
  margin-right: 12px;
}

.dropzone {
  border: 2px dashed var(--panel-border);
  border-radius: 10px;
  padding: 24px;
  text-align: center;
  color: var(--muted);
  background: #f8fafc;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.dropzone:hover {
  border-color: var(--accent);
  background: #eef2ff;
}

.field-error {
  font-size: 0.85rem;
  color: var(--danger);
}

.is-hidden {
  display: none !important;
}

.stack {
  display: flex;
  flex-direction: column;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: 8px;
  border: 1px solid transparent;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.button-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.button-primary:hover,
.button-primary:focus {
  background: #1e3a8a;
  border-color: #1e3a8a;
}

.button-secondary {
  background: #e2e8f0;
  color: #0f172a;
  border-color: #cbd5f5;
}

.button-secondary:hover,
.button-secondary:focus {
  background: #cbd5f5;
  color: #0f172a;
}

.success-card {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
}

.app-footer {
  margin-top: auto;
  padding: 24px;
  text-align: center;
  font-size: 0.85rem;
  color: var(--muted);
  border-top: 1px solid var(--panel-border);
  background: var(--panel);
}

@media (max-width: 640px) {
  .app-header {
    flex-direction: column;
    gap: 12px;
  }

  .card-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .form-actions {
    justify-content: stretch;
  }

  .form-actions .button {
    width: 100%;
  }
}
