:root {
  --brand: #ff003b;
  --brand-dark: #d4153550;
  --ink: #15171a;
  --muted: #6b7280;
  --line: #e4e6ea;
  --bg: #f5f6f8;
  --card: #ffffff;
  --ok: #16a34a;
  --err: #dc2626;
  --radius: 14px;
  --shadow: 0 1px 3px rgba(16,17,20,.06), 0 8px 24px rgba(16,17,20,.06);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: inherit;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { max-width: 760px; margin: 0 auto; padding: 24px 18px 64px; }
.wrap-wide { max-width: 1040px; }

/* ---- Top bar ---- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 14px 20px; background: var(--card);
  border-bottom: 1px solid var(--line);
}
.topbar .logo { height: 30px; }
.topbar .nav a { color: var(--muted); font-size: 14px; margin-left: 18px; }
.topbar .nav a:hover { color: var(--ink); text-decoration: none; }

/* ---- Cards ---- */
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 22px; margin-bottom: 18px;
}
.card h2 { margin: 0 0 4px; font-size: 18px; }
.card .sub { color: var(--muted); font-size: 14px; margin: 0 0 16px; }

.brand-bar { height: 4px; background: var(--brand); border-radius: 4px 4px 0 0; }

/* ---- Forms ---- */
label { display: block; font-size: 13px; font-weight: 600; margin: 14px 0 6px; }
input[type=text], input[type=email], input[type=tel], input[type=password],
textarea, select {
  width: 100%; padding: 12px 14px; font-size: 16px;
  border: 1px solid var(--line); border-radius: 10px; background: #fff;
  color: var(--ink); font-family: inherit;
}
input:focus, textarea:focus, select:focus {
  outline: none; border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(250,30,68,.12);
}
textarea { resize: vertical; min-height: 90px; line-height: 1.5; }
.hint { font-size: 12px; color: var(--muted); margin-top: 4px; font-weight: 400; }
.row { display: flex; gap: 14px; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 180px; }

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 22px; font-size: 16px; font-weight: 600; cursor: pointer;
  border: none; border-radius: 10px; background: var(--brand); color: #fff;
  font-family: inherit; transition: transform .04s ease, filter .15s ease;
}
.btn:hover { filter: brightness(1.05); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-ghost { background: #fff; color: var(--ink); border: 1px solid var(--line); }
.btn-ghost:hover { background: #f9fafb; }
.btn-danger { background: #fff; color: var(--err); border: 1px solid #f3c2c2; }
.btn-sm { padding: 8px 14px; font-size: 14px; }
.btn-lg { padding: 18px 30px; font-size: 19px; width: 100%; }

/* ---- Signature ---- */
.sig-wrap { position: relative; }
.sig-pad {
  width: 100%; height: 240px; background: #fff;
  border: 2px dashed #c9ccd2; border-radius: 12px; touch-action: none;
  display: block;
}
.sig-pad.filled { border-style: solid; border-color: var(--brand); }
.sig-placeholder {
  position: absolute; inset: 0; display: flex; align-items: center;
  justify-content: center; color: #b6bac1; font-size: 16px; pointer-events: none;
}
.sig-actions { display: flex; justify-content: flex-end; margin-top: 8px; }

/* ---- Flash / alerts ---- */
.flash { padding: 12px 16px; border-radius: 10px; margin-bottom: 14px; font-size: 14px; }
.flash.success { background: #e8f7ee; color: #11643a; border: 1px solid #b6e6c8; }
.flash.error { background: #fdecec; color: #9b1c1c; border: 1px solid #f3c2c2; }

/* ---- Badges ---- */
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600; }
.badge.ok { background: #e8f7ee; color: var(--ok); }
.badge.pending { background: #fff4e5; color: #b45309; }
.badge.err { background: #fdecec; color: var(--err); }
.badge.muted { background: #eef0f3; color: var(--muted); }

/* ---- Tables ---- */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 11px 10px; border-bottom: 1px solid var(--line); }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
tr:last-child td { border-bottom: none; }

/* ---- Production list cards ---- */
.prod-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px,1fr)); gap: 16px; }
.prod-card { display: block; padding: 20px; border-radius: var(--radius);
  background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow);
  color: var(--ink); transition: transform .08s ease, box-shadow .15s ease; }
.prod-card:hover { text-decoration: none; transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(16,17,20,.1); }
.prod-card .pname { font-size: 17px; font-weight: 700; margin-bottom: 4px; }
.prod-card .pmeta { font-size: 13px; color: var(--muted); }

.field-row { display: grid; grid-template-columns: 1fr 1.4fr 110px 90px 40px;
  gap: 8px; align-items: center; margin-bottom: 8px; }
.field-row input, .field-row select { margin: 0; }
.field-row .chk { display: flex; align-items: center; justify-content: center; }

.section-title { font-size: 13px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .04em; color: var(--muted); margin: 26px 0 10px;
  padding-bottom: 6px; border-bottom: 1px solid var(--line); }

.muted { color: var(--muted); }
.right { text-align: right; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.mt0 { margin-top: 0; }

/* ---- Kiosk thank-you overlay ---- */
.overlay {
  position: fixed; inset: 0; background: rgba(255,255,255,.97);
  display: none; align-items: center; justify-content: center; flex-direction: column;
  z-index: 50; text-align: center; padding: 30px;
}
.overlay.show { display: flex; }
.overlay .check {
  width: 96px; height: 96px; border-radius: 50%; background: var(--brand);
  display: flex; align-items: center; justify-content: center; margin-bottom: 22px;
}
.overlay .check svg { width: 52px; height: 52px; stroke: #fff; }
.overlay h1 { font-size: 30px; margin: 0 0 8px; }
.overlay p { color: var(--muted); font-size: 17px; margin: 0 0 26px; }

.declaration { background: #fafafa; border: 1px solid var(--line); border-radius: 12px;
  padding: 18px 20px; font-size: 14px; line-height: 1.6; }
.declaration ol { margin: 8px 0 0; padding-left: 20px; }
.declaration li { margin-bottom: 8px; }
.declaration .meta-line { color: var(--muted); }
