:root {
  --bg: #f4f6fb;
  --card: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --border: #e5e7eb;
  --primary: #4f46e5;
  --primary-dark: #4338ca;
  --primary-soft: #eef2ff;
  --danger: #dc2626;
  --danger-soft: #fef2f2;
  --success: #16a34a;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(79, 70, 229, 0.08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Vazirmatn", Tahoma, sans-serif;
  background: linear-gradient(180deg, #eef2ff 0%, var(--bg) 280px);
  color: var(--text);
  line-height: 1.8;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 28px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}
.brand { display: flex; gap: 8px; align-items: center; font-weight: 700; color: var(--primary); text-decoration: none; }
.brand-mark { font-size: 20px; }
.topbar nav a { margin-inline-start: 18px; color: var(--muted); text-decoration: none; font-weight: 500; }
.topbar nav a:hover { color: var(--primary); }

.container { width: 100%; max-width: 760px; margin: 0 auto; padding: 32px 16px 56px; flex: 1; }

.hero { text-align: center; margin-bottom: 24px; }
.hero h1 { margin: 0 0 6px; font-size: 28px; }
.hero p { margin: 0; color: var(--muted); }

.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px;
  border: 1px solid var(--border);
}
.card.center { text-align: center; }

.group { border: 0; padding: 0; margin: 0 0 28px; }
.group legend {
  font-weight: 700;
  font-size: 17px;
  color: var(--primary);
  padding: 0 0 12px;
  margin-bottom: 4px;
  width: 100%;
  border-bottom: 1px dashed var(--border);
}

.row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field { margin-top: 16px; }
.label { display: block; font-weight: 500; margin-bottom: 6px; font-size: 14px; }
.req { color: var(--danger); }

input[type="text"], input[type="email"], select, textarea, .track-form input {
  width: 100%;
  font-family: inherit;
  font-size: 15px;
  padding: 11px 14px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  background: #fafbff;
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.12);
}

.kind-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.kind-card { cursor: pointer; }
.kind-card input { position: absolute; opacity: 0; pointer-events: none; }
.kind-card span {
  display: block;
  text-align: center;
  padding: 12px 8px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  background: #fafbff;
  transition: all 0.15s;
}
.kind-card:hover span { border-color: var(--primary); }
.kind-card input:checked + span {
  background: var(--primary-soft);
  border-color: var(--primary);
  color: var(--primary-dark);
  font-weight: 700;
}
.kind-card input:focus-visible + span { box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.15); }

.dropzone {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 20px;
  border: 2px dashed #c7d2fe;
  border-radius: 12px;
  background: var(--primary-soft);
  color: var(--primary-dark);
  cursor: pointer;
  transition: background 0.15s;
}
.dropzone:hover { background: #e0e7ff; }
.dz-icon { font-size: 20px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.switch { display: inline-flex; align-items: center; gap: 12px; cursor: pointer; margin-top: 16px; }
.switch input { position: absolute; opacity: 0; }
.slider {
  position: relative;
  width: 44px; height: 24px;
  background: #d1d5db;
  border-radius: 999px;
  transition: background 0.2s;
  flex-shrink: 0;
}
.slider::after {
  content: "";
  position: absolute;
  top: 3px; right: 3px;
  width: 18px; height: 18px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s;
}
.switch input:checked + .slider { background: var(--primary); }
.switch input:checked + .slider::after { transform: translateX(-20px); }
.switch input:focus-visible + .slider { box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.2); }
.hidden { display: none; }

.btn {
  display: inline-block;
  font-family: inherit;
  font-size: 16px;
  font-weight: 600;
  padding: 13px 28px;
  border: 0;
  border-radius: 12px;
  background: var(--primary);
  color: #fff;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}
.btn:hover { background: var(--primary-dark); }
.btn:active { transform: scale(0.98); }
.btn.ghost { background: var(--primary-soft); color: var(--primary-dark); }
.btn.ghost:hover { background: #e0e7ff; }
.form .btn { width: 100%; }

.error { color: var(--danger); font-size: 13px; margin: 6px 0 0; }
.alert { background: var(--danger-soft); color: var(--danger); padding: 12px 16px; border-radius: 10px; margin-top: 16px; }
.alert ul { margin: 0; padding: 0; list-style: none; }

.check {
  width: 72px; height: 72px; margin: 0 auto 12px;
  display: grid; place-items: center;
  background: #dcfce7; color: var(--success);
  border-radius: 50%; font-size: 36px; font-weight: 700;
}
.code {
  display: inline-block;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 28px; letter-spacing: 4px; font-weight: 700;
  padding: 10px 24px; margin: 6px 0;
  background: var(--primary-soft); color: var(--primary-dark);
  border-radius: 12px; direction: ltr;
}
.muted { color: var(--muted); }
.small { font-size: 13px; }
.actions { display: flex; gap: 12px; justify-content: center; margin-top: 20px; flex-wrap: wrap; }

.track-form { display: flex; gap: 10px; margin: 16px 0; }
.details { display: grid; grid-template-columns: 120px 1fr; gap: 10px 16px; margin: 20px 0 0; }
.details dt { color: var(--muted); }
.details dd { margin: 0; font-weight: 500; }
.badge { padding: 3px 12px; border-radius: 999px; font-size: 13px; background: #e5e7eb; }
.badge.new { background: #dbeafe; color: #1d4ed8; }
.badge.reviewing { background: #fef3c7; color: #b45309; }
.badge.done { background: #dcfce7; color: #15803d; }
.badge.rejected { background: #fee2e2; color: #b91c1c; }

.footer { text-align: center; color: var(--muted); font-size: 13px; padding: 20px; }

@media (max-width: 600px) {
  .row { grid-template-columns: 1fr; }
  .kind-grid { grid-template-columns: repeat(2, 1fr); }
  .card { padding: 20px; }
  .hero h1 { font-size: 23px; }
  .topbar { padding: 12px 16px; }
}
