@font-face {
  font-family: "Pusab";
  src: url("fonts/Pusab.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --ink: #3a2148;
  --muted: #6d4a78;
  --panel: rgba(255, 248, 252, 0.92);
  --panel-border: rgba(255, 255, 255, 0.65);
  --accent: #ff5fa2;
  --accent-deep: #e23d86;
  --ok: #1f8a5b;
  --ok-bg: #e8fff4;
  --err: #b42318;
  --err-bg: #fff1f0;
  --shadow: 0 24px 60px rgba(90, 30, 80, 0.28);
  --radius: 28px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "Segoe UI", "Trebuchet MS", Candara, sans-serif;
  color: var(--ink);
  background: #2a1035;
  overflow-x: hidden;
}

.bg {
  position: fixed;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(58, 20, 70, 0.35), rgba(20, 8, 30, 0.55)),
    url("background.png") center / cover no-repeat;
  z-index: 0;
  transform: scale(1.02);
  filter: saturate(1.05);
}

.candy {
  position: fixed;
  width: 110px;
  height: 110px;
  background-size: contain;
  background-repeat: no-repeat;
  z-index: 1;
  opacity: 0.9;
  pointer-events: none;
  animation: floaty 7s ease-in-out infinite;
}

.candy-a {
  left: 6vw;
  top: 18vh;
  background-image: url("candy-1.png");
}

.candy-b {
  right: 7vw;
  bottom: 14vh;
  width: 130px;
  height: 130px;
  background-image: url("candy-3.png");
  animation-delay: -2.5s;
}

@keyframes floaty {
  0%, 100% { transform: translateY(0) rotate(-4deg); }
  50% { transform: translateY(-18px) rotate(5deg); }
}

.wrap {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 16px;
}

.card {
  width: min(560px, 100%);
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  padding: 28px 28px 22px;
  animation: rise 0.55s ease-out both;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(18px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.brand {
  text-align: center;
  margin-bottom: 18px;
}

.brand-icon {
  display: block;
  margin: 0 auto 8px;
  filter: drop-shadow(0 8px 12px rgba(180, 40, 100, 0.35));
  animation: bob 3.2s ease-in-out infinite;
}

@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.brand h1 {
  margin: 0;
  font-family: "Pusab", "Segoe UI", sans-serif;
  font-size: clamp(2.2rem, 6vw, 3rem);
  letter-spacing: 0.02em;
  color: #ff4f9a;
  text-shadow: 0 3px 0 #fff, 0 8px 18px rgba(255, 80, 150, 0.35);
}

.lead {
  margin: 10px auto 0;
  max-width: 42ch;
  color: var(--muted);
  line-height: 1.45;
  font-size: 0.98rem;
}

.hint {
  margin: 0 0 16px;
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(255, 236, 246, 0.9);
  border: 1px solid rgba(255, 95, 162, 0.28);
}

.hint h2 {
  margin: 0 0 6px;
  font-size: 1rem;
  color: var(--accent-deep);
}

.hint p {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.4;
}

.hint .path {
  display: block;
  margin: 0 0 8px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(58, 33, 72, 0.92);
  color: #ffe8f4;
  font-size: 0.82rem;
  line-height: 1.35;
  word-break: break-all;
  overflow-wrap: anywhere;
}

.hint-extra {
  margin-bottom: 6px !important;
}

.hint-extra:last-child {
  margin-bottom: 0 !important;
}

.hint-extra code {
  font-size: 0.8rem;
  word-break: break-all;
}

.alert {
  border-radius: 14px;
  padding: 12px 14px;
  margin-bottom: 14px;
  font-size: 0.95rem;
  line-height: 1.35;
}

.alert.success {
  background: var(--ok-bg);
  color: var(--ok);
  border: 1px solid rgba(31, 138, 91, 0.25);
}

.alert.error {
  background: var(--err-bg);
  color: var(--err);
  border: 1px solid rgba(180, 35, 24, 0.2);
}

.form {
  display: grid;
  gap: 14px;
}

.field {
  display: grid;
  gap: 6px;
}

.field > span {
  font-weight: 700;
  font-size: 0.92rem;
}

input[type="text"],
textarea {
  width: 100%;
  border: 2px solid rgba(255, 95, 162, 0.28);
  background: rgba(255, 255, 255, 0.88);
  border-radius: 14px;
  padding: 12px 14px;
  font: inherit;
  color: var(--ink);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

textarea {
  resize: vertical;
  min-height: 140px;
}

input[type="text"]:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(255, 95, 162, 0.18);
}

.file-box {
  position: relative;
  border: 2px dashed rgba(255, 95, 162, 0.45);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
  min-height: 92px;
  display: grid;
  place-items: center;
  overflow: hidden;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.file-box:hover,
.file-box.is-ready {
  border-color: var(--accent);
  background: rgba(255, 240, 248, 0.95);
}

.file-box input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.file-ui {
  text-align: center;
  pointer-events: none;
  padding: 12px;
}

.file-ui strong {
  display: block;
  color: var(--accent-deep);
  margin-bottom: 4px;
}

.file-ui small {
  color: var(--muted);
}

.btn {
  appearance: none;
  border: 0;
  cursor: pointer;
  border-radius: 999px;
  padding: 14px 18px;
  font: inherit;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #fff;
  background: linear-gradient(180deg, #ff79b4 0%, var(--accent-deep) 100%);
  box-shadow: 0 10px 0 #b21f66, 0 16px 24px rgba(226, 61, 134, 0.35);
  transition: transform 0.12s ease, filter 0.12s ease;
}

.btn:hover {
  filter: brightness(1.04);
}

.btn:active {
  transform: translateY(3px);
  box-shadow: 0 7px 0 #b21f66, 0 10px 16px rgba(226, 61, 134, 0.3);
}

.btn[disabled] {
  opacity: 0.65;
  cursor: wait;
  filter: grayscale(0.15);
}

.note {
  margin: 2px 0 0;
  text-align: center;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.4;
}

.hp {
  position: absolute;
  left: -10000px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

@media (max-width: 560px) {
  .card {
    padding: 22px 16px 18px;
    border-radius: 22px;
  }

  .candy {
    width: 72px;
    height: 72px;
    opacity: 0.7;
  }

  .candy-b {
    width: 84px;
    height: 84px;
  }
}
