:root {
  --purple: #7c3aed;
  --purple-light: #a78bfa;
  --pink: #ec4899;
  --ink: #1f2937;
  --ink-soft: #4b5563;
  --border: #e5e7eb;
  --bg-soft: #f9fafb;
  --success: #16a34a;
  --success-soft: #f0fdf4;
  --danger: #dc2626;
  --danger-soft: #fef2f2;
  --receipt: #17151f;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body { height: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--ink);
  background: #ffffff;
  display: flex;
  justify-content: center;
  padding: 32px 16px 56px;
  overflow-x: hidden;
  position: relative;
}

/* =================== Background hidup: blob mengambang pelan =================== */
.bg-blob {
  position: fixed;
  border-radius: 50%;
  filter: blur(60px);
  z-index: 0;
  pointer-events: none;
  opacity: 0.5;
}
.blob-1 {
  width: 420px; height: 420px;
  top: -140px; left: -100px;
  background: radial-gradient(circle, rgba(167,139,250,0.35), transparent 70%);
  animation: floatSlow 16s ease-in-out infinite;
}
.blob-2 {
  width: 480px; height: 480px;
  bottom: -180px; right: -140px;
  background: radial-gradient(circle, rgba(236,72,153,0.22), transparent 70%);
  animation: floatSlow 20s ease-in-out infinite reverse;
}

@keyframes floatSlow {
  0%   { transform: translate(0, 0) scale(1); }
  33%  { transform: translate(30px, -24px) scale(1.06); }
  66%  { transform: translate(-20px, 18px) scale(0.96); }
  100% { transform: translate(0, 0) scale(1); }
}

main {
  width: 100%;
  max-width: 560px;
  position: relative;
  z-index: 1;
}

/* =================== Brand + Hero =================== */
.brandline {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  margin-bottom: 18px;
  opacity: 0; animation: fadeUp 0.55s ease forwards;
}
.brandline .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--purple); }
.brandline span {
  font-size: 11px; letter-spacing: 0.16em; font-weight: 700;
  color: var(--purple); text-transform: uppercase;
}

.hero {
  text-align: center; margin-bottom: 22px;
  opacity: 0; animation: fadeUp 0.55s ease forwards 0.08s;
}
.hero h1 {
  margin: 0 0 8px;
  font-size: 27px;
  font-weight: 800;
  background: linear-gradient(120deg, var(--purple), var(--pink), var(--purple));
  background-size: 300% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: gradientShift 4s linear infinite;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.hero p { margin: 0; font-size: 13.5px; color: var(--ink-soft); line-height: 1.5; }
.hero .rule {
  width: 44px; height: 3px; border-radius: 3px; margin: 14px auto 0;
  background: linear-gradient(90deg, var(--purple), var(--pink));
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  100% { background-position: 300% 50%; }
}

/* =================== Card form =================== */
.card {
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 28px 26px;
  margin-bottom: 18px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 16px 36px rgba(124, 58, 237, 0.10);
  opacity: 0; animation: cardIn 0.55s cubic-bezier(0.16, 1, 0.3, 1) forwards 0.16s;
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(16px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.card-label {
  font-size: 11px; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--purple-light); margin-bottom: 16px;
}

.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

label {
  display: block; font-size: 12.5px; font-weight: 600;
  color: var(--ink-soft); margin: 14px 2px 6px;
}
.row label { margin-top: 0; }

.input, select.input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1.5px solid var(--border);
  background: var(--bg-soft);
  color: var(--ink);
  font-size: 16px;
  font-family: inherit;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.input::placeholder { color: #b6b4c1; }
.input:focus {
  outline: none; border-color: var(--purple); background: #fff;
  box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.14);
}

select.input {
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9'><path d='M1 1L7 7L13 1' stroke='%237c3aed' stroke-width='1.8' fill='none' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
  cursor: pointer;
}

.btns { display: flex; flex-direction: column; gap: 10px; margin-top: 20px; }
.btn {
  border: none; border-radius: 13px; padding: 14px 16px;
  font-weight: 700; font-size: 14.5px; cursor: pointer;
  font-family: inherit;
  transition: transform 0.18s ease, box-shadow 0.25s ease, opacity 0.15s ease, background 0.15s ease;
}
.btn:active { transform: scale(0.97); }
.btn-primary {
  background: linear-gradient(135deg, var(--purple), #6d28d9);
  color: #fff;
  box-shadow: 0 10px 22px -8px rgba(124, 58, 237, 0.55);
}
.btn-primary:hover { opacity: 0.94; transform: translateY(-1px); box-shadow: 0 14px 28px -8px rgba(124, 58, 237, 0.65); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

.btn-row { display: flex; gap: 10px; }
.btn-row .btn { flex: 1; }

.btn-ghost { background: #fff; border: 1.5px solid var(--border); color: var(--ink-soft); }
.btn-ghost:hover { background: var(--bg-soft); border-color: var(--purple-light); color: var(--purple); }

.btn-wa { background: var(--success-soft); color: var(--success); border: 1.5px solid #cdefdd; }
.btn-wa:hover { background: #defbe9; }

.alert {
  margin-top: 14px; padding: 11px 13px; border-radius: 12px;
  font-size: 13px; font-weight: 500;
  display: flex; gap: 8px; align-items: flex-start;
  animation: shakeIn 0.35s cubic-bezier(0.36, 0.07, 0.19, 0.97);
}
.alert.error { background: var(--danger-soft); color: var(--danger); }
.alert.ok { background: var(--success-soft); color: var(--success); }

@keyframes shakeIn {
  0% { transform: translateX(0); opacity: 0; }
  25% { transform: translateX(-6px); }
  50% { transform: translateX(4px); opacity: 1; }
  75% { transform: translateX(-2px); }
  100% { transform: translateX(0); }
}

/* =================== Receipt (nota hasil) =================== */
.receipt {
  position: relative;
  background: var(--receipt);
  color: #f2f1f6;
  border-radius: 20px;
  padding: 26px 22px 22px;
  box-shadow: 0 24px 48px -22px rgba(30, 12, 60, 0.55);
  overflow: hidden;
}
.receipt::before {
  content: "";
  position: absolute; top: 0; left: 0; right: 0; height: 12px;
  background-image: radial-gradient(circle at 9px 0, #fff 6.5px, transparent 7px);
  background-size: 18px 12px;
  background-repeat: repeat-x;
}
.receipt.show { animation: receiptIn 0.6s cubic-bezier(0.16, 1, 0.3, 1); }

@keyframes receiptIn {
  0% { opacity: 0; transform: translateY(-14px) scale(0.97); }
  60% { opacity: 1; transform: translateY(4px) scale(1.005); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

.receipt-head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin: 6px 0 16px; padding-bottom: 14px;
  border-bottom: 1px dashed rgba(255,255,255,0.18);
}
.receipt-head .eyebrow {
  font-size: 10.5px; letter-spacing: 0.14em; text-transform: uppercase;
  color: #c9b8ff; font-weight: 700;
}
.receipt-head h2 { font-size: 16px; margin: 2px 0 0; font-weight: 700; color: #fff; }

.rline {
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
  padding: 7px 0; font-family: 'SFMono-Regular', 'Consolas', monospace; font-size: 12.5px;
}
.rline span:first-child { color: #c9b8ff; }
.rline span:last-child { color: #f2f1f6; font-weight: 600; }

.receipt-total {
  margin-top: 14px; padding-top: 16px; border-top: 1px dashed rgba(255,255,255,0.18);
  display: flex; align-items: center; justify-content: space-between;
}
.receipt-total span:first-child {
  font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase;
  color: #c9b8ff; font-weight: 700;
}
.receipt-total span:last-child {
  font-family: 'SFMono-Regular', 'Consolas', monospace; font-size: 22px;
  font-weight: 600;
  background: linear-gradient(120deg, var(--pink), var(--purple-light));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

footer {
  text-align: center; margin-top: 24px; font-size: 13px; color: var(--ink-soft);
  position: relative; z-index: 1;
}
.heart { display: inline-block; color: var(--pink); animation: heartbeat 1.6s ease-in-out infinite; }

@keyframes heartbeat {
  0%, 100% { transform: scale(1); }
  15% { transform: scale(1.3); }
  30% { transform: scale(1); }
  45% { transform: scale(1.2); }
  60% { transform: scale(1); }
}

footer a { color: var(--purple); font-weight: 600; text-decoration: none; transition: color 0.2s ease; }
footer a:hover { color: var(--pink); text-decoration: underline; }

/* =================== Breakpoints =================== */
@media (min-width: 640px) {
  main { max-width: 620px; }
}

@media (min-width: 900px) {
  body { padding: 56px 24px; align-items: flex-start; }
  main { max-width: 720px; }
  .hero h1 { font-size: 34px; }
  .hero p { font-size: 15px; }
  .card { padding: 40px 44px; }
  .receipt { padding: 32px 36px 28px; }
  .receipt-total span:last-child { font-size: 26px; }
}

@media (max-width: 420px) {
  body { padding: 20px 12px 40px; }
  .row { grid-template-columns: 1fr; }
  .hero h1 { font-size: 22px; }
  .card { padding: 22px 18px; border-radius: 18px; }
  .receipt-total span:last-child { font-size: 20px; }
  .bg-blob { filter: blur(40px); opacity: 0.4; }
}

@media (prefers-reduced-motion: reduce) {
  .card, .receipt, .brandline, .hero, .heart {
    animation: none !important;
    transition: none !important;
    opacity: 1 !important;
  }
}
