:root {
  --night: #071511;
  --night-2: #0d241d;
  --pine: #1d6b48;
  --pine-2: #2b8a5f;
  --berry: #e0384f;
  --berry-2: #b8243b;
  --gold: #f5c76b;
  --gold-2: #e9ae3c;
  --snow: #fbf8f1;
  --text: #f3efe6;
  --muted: #a9bdb4;
  --glass: rgba(255, 255, 255, 0.055);
  --glass-2: rgba(255, 255, 255, 0.09);
  --line: rgba(255, 255, 255, 0.12);
  --shadow: 0 24px 60px -20px rgba(0, 0, 0, 0.6);
  --radius: 22px;
  --display: 'Fraunces', Georgia, serif;
  --body: 'Plus Jakarta Sans', system-ui, -apple-system, Segoe UI, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--body);
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 85% -10%, rgba(224, 56, 79, 0.22), transparent 60%),
    radial-gradient(900px 600px at -10% 10%, rgba(43, 138, 95, 0.28), transparent 60%),
    radial-gradient(800px 500px at 50% 120%, rgba(245, 199, 107, 0.12), transparent 60%),
    linear-gradient(180deg, var(--night-2), var(--night));
  background-attachment: fixed;
  overflow-x: hidden;
}

button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--gold); }

#snow, #confetti {
  position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none;
}
#snow { z-index: 0; }
#confetti { z-index: 60; }

/* ---------- string lights ---------- */
.lights {
  position: fixed; top: -6px; left: 0; right: 0; height: 44px; z-index: 5;
  display: flex; justify-content: space-around; pointer-events: none;
}
.lights::before {
  content: ''; position: absolute; left: -2%; right: -2%; top: 0; height: 22px;
  border-bottom: 2px solid rgba(20, 40, 30, 0.9); border-radius: 0 0 50% 50% / 0 0 100% 100%;
}
.lights i {
  position: relative; top: 14px; width: 10px; height: 16px; border-radius: 50%;
  background: var(--c); box-shadow: 0 4px 18px 3px var(--c);
  animation: twinkle 2.4s ease-in-out infinite; animation-delay: var(--d);
}
.lights i::before {
  content: ''; position: absolute; top: -5px; left: 2px; width: 6px; height: 6px;
  background: #233; border-radius: 2px;
}
@keyframes twinkle { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; box-shadow: 0 2px 6px 0 var(--c); } }

/* ---------- layout ---------- */
.wrap { position: relative; z-index: 1; max-width: 1120px; margin: 0 auto; padding: 56px 20px 64px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 28px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: 0.02em; text-decoration: none; color: var(--text); }
.brand .logo {
  width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; font-size: 20px;
  background: linear-gradient(135deg, var(--berry), var(--berry-2)); box-shadow: 0 8px 24px -6px rgba(224, 56, 79, 0.7);
}
.brand small { display: block; font-weight: 500; color: var(--muted); font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; }

.card {
  background: var(--glass); border: 1px solid var(--line); border-radius: var(--radius);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  box-shadow: var(--shadow); padding: 24px;
}
.card h2 { font-family: var(--display); font-weight: 600; font-size: 22px; margin: 0 0 4px; letter-spacing: -0.01em; }
.card .sub { color: var(--muted); font-size: 14px; margin: 0 0 18px; line-height: 1.5; }

/* ---------- controls ---------- */
.btn {
  --bg: var(--glass-2);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 18px; border-radius: 14px; border: 1px solid var(--line);
  background: var(--bg); color: var(--text); font-weight: 600; font-size: 14px; cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease, opacity 0.2s;
  white-space: nowrap; text-decoration: none;
}
.btn:hover { transform: translateY(-1px); background: rgba(255, 255, 255, 0.14); }
.btn:active { transform: translateY(0) scale(0.98); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
.btn.primary {
  background: linear-gradient(135deg, var(--berry), var(--berry-2)); border-color: transparent;
  box-shadow: 0 10px 30px -10px rgba(224, 56, 79, 0.9);
}
.btn.primary:hover { box-shadow: 0 14px 36px -10px rgba(224, 56, 79, 1); }
.btn.gold { background: linear-gradient(135deg, var(--gold), var(--gold-2)); color: #3a2604; border-color: transparent; box-shadow: 0 10px 30px -12px rgba(245, 199, 107, 0.9); }
.btn.green { background: linear-gradient(135deg, var(--pine-2), var(--pine)); border-color: transparent; }
.btn.ghost { background: transparent; }
.btn.danger { color: #ff9aa8; }
.btn.lg { padding: 15px 26px; font-size: 16px; border-radius: 16px; }
.btn.sm { padding: 7px 11px; font-size: 13px; border-radius: 10px; }
.btn.icon { padding: 7px; width: 34px; height: 34px; border-radius: 10px; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 12px; font-weight: 600; color: var(--muted); letter-spacing: 0.05em; text-transform: uppercase; }
.input, select.input, textarea.input {
  width: 100%; padding: 11px 14px; border-radius: 12px; border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.25); outline: none; transition: border-color 0.2s, box-shadow 0.2s;
}
.input:focus { border-color: var(--gold); box-shadow: 0 0 0 4px rgba(245, 199, 107, 0.15); }
textarea.input { resize: vertical; min-height: 96px; line-height: 1.5; }
select.input { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 34px; }
select.input option { background: #10231c; }

.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 13px; border-radius: 999px;
  background: var(--glass-2); border: 1px solid var(--line); font-size: 13px; font-weight: 600;
}
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.badge.ok { background: rgba(43, 138, 95, 0.25); color: #8fe0b5; }
.badge.wait { background: rgba(255, 255, 255, 0.08); color: var(--muted); }
.badge.warn { background: rgba(245, 199, 107, 0.18); color: var(--gold); }

.muted { color: var(--muted); }
.hidden { display: none !important; }

/* ---------- toast ---------- */
.toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 80; display: flex; flex-direction: column; gap: 8px; align-items: center; width: calc(100% - 32px); max-width: 420px; }
.toast {
  padding: 12px 18px; border-radius: 14px; background: rgba(12, 30, 24, 0.95); border: 1px solid var(--line);
  box-shadow: var(--shadow); font-size: 14px; font-weight: 500; animation: toastIn 0.3s ease;
}
.toast.error { border-color: rgba(224, 56, 79, 0.6); }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } }

/* ---------- modal ---------- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; padding: 16px;
  background: rgba(3, 10, 8, 0.7); backdrop-filter: blur(6px); animation: fade 0.2s ease;
}
.modal {
  width: 100%; max-width: 480px; max-height: calc(100vh - 32px); overflow: auto;
  background: linear-gradient(180deg, #11291f, #0b1c16); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px; box-shadow: var(--shadow); animation: pop 0.25s cubic-bezier(0.2, 0.9, 0.3, 1.3);
}
.modal h3 { font-family: var(--display); font-size: 24px; margin: 0 0 8px; }
.modal p { color: var(--muted); line-height: 1.55; margin: 0 0 16px; }
.modal .actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; flex-wrap: wrap; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: scale(0.94) translateY(8px); } }

/* ---------- help ---------- */
.help-fab {
  position: fixed; right: 18px; bottom: 18px; z-index: 40; display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 16px 10px 10px; border-radius: 999px; border: 1px solid rgba(245, 199, 107, 0.45);
  background: rgba(12, 30, 24, 0.92); color: var(--text); font-weight: 700; font-size: 14px; cursor: pointer;
  box-shadow: var(--shadow); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); transition: transform 0.15s ease, border-color 0.2s;
}
.help-fab:hover { transform: translateY(-2px); border-color: var(--gold); }
.help-fab:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
.help-fab .q {
  width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 15px; font-weight: 800;
  background: linear-gradient(135deg, var(--gold), var(--gold-2)); color: #3a2604;
}
.help-fab.pulse .q { animation: helpPulse 1.8s ease-in-out infinite; }
@keyframes helpPulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(245, 199, 107, 0.65); } 50% { box-shadow: 0 0 0 10px rgba(245, 199, 107, 0); } }
.modal.wide { max-width: 580px; }
.help-h { font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--gold); font-weight: 700; margin: 4px 0 10px; }
.help-steps { list-style: none; padding: 0; margin: 0 0 20px; display: flex; flex-direction: column; gap: 8px; }
.help-steps li { display: grid; grid-template-columns: 42px 1fr; gap: 12px; align-items: start; padding: 12px; border-radius: 14px; background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line); }
.help-steps .n { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; font-size: 21px; background: rgba(245, 199, 107, 0.12); }
.help-steps .ht { display: block; margin-bottom: 3px; }
.help-steps .hd { color: var(--muted); font-size: 14px; line-height: 1.5; }
.help-steps .hd b { color: var(--text); font-weight: 600; }
.faq details { border-top: 1px solid var(--line); padding: 11px 2px; }
.faq details:last-child { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; font-weight: 600; font-size: 15px; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; color: var(--gold); font-weight: 700; font-size: 18px; line-height: 1; }
.faq details[open] summary::after { content: '–'; }
.modal .faq p { margin: 8px 0 0; font-size: 14px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
@media (max-width: 600px) {
  .wrap { padding: 48px 16px 84px; }
  .help-fab { right: 14px; bottom: 14px; padding: 8px 14px 8px 8px; }
  .card { padding: 18px; border-radius: 18px; }
}
