@font-face {
  font-family: "Baloo 2";
  src: url("fonts/baloo2-semibold.ttf") format("truetype");
  font-style: normal;
  font-weight: 600;
  font-display: swap;
}

@font-face {
  font-family: "Baloo 2";
  src: url("fonts/baloo2-bold.ttf") format("truetype");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

@font-face {
  font-family: "Baloo 2";
  src: url("fonts/baloo2-extrabold.ttf") format("truetype");
  font-style: normal;
  font-weight: 800;
  font-display: swap;
}

@font-face {
  font-family: "Knewave";
  src: url("fonts/knewave-regular.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

:root {
  color-scheme: light;
  font-family: "Baloo 2", ui-rounded, system-ui, sans-serif;
  font-synthesis: none;
  --brand-red: #a8070b;
  --brand-red-dark: #780307;
  --brand-green: #8ad626;
  --brand-green-dark: #587b29;
  --brand-button: #61ce70;
  --brand-yellow: #fff700;
  --brand-cream: #f4f7e9;
  --brand-ink: #31411f;
}

* { box-sizing: border-box; }

html { min-width: 320px; background: var(--brand-green-dark); }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--brand-ink);
  background:
    radial-gradient(circle at 12% 18%, rgba(255, 247, 0, .34), transparent 20%),
    radial-gradient(circle at 86% 20%, rgba(138, 214, 38, .36), transparent 24%),
    linear-gradient(180deg, var(--brand-red) 0 58px, transparent 58px),
    linear-gradient(145deg, #f5f7e9 0%, #e6efd2 48%, #cfdfad 100%);
}

button, input { font: inherit; }

button, a { -webkit-tap-highlight-color: transparent; }

.page-shell {
  min-height: 100vh;
  overflow: hidden;
  padding: 24px 16px;
  position: relative;
}

.page-shell::before,
.page-shell::after {
  content: "";
  position: fixed;
  z-index: 0;
  border-radius: 999px;
  filter: blur(70px);
  pointer-events: none;
}

.page-shell::before {
  width: 210px;
  height: 210px;
  left: 40px;
  top: 32px;
  background: rgba(255, 247, 0, .32);
}

.page-shell::after {
  width: 290px;
  height: 290px;
  right: 32px;
  bottom: 16px;
  background: rgba(97, 206, 112, .25);
}

.generator {
  position: relative;
  z-index: 1;
  width: min(100%, 1280px);
  margin: 0 auto;
  display: grid;
  gap: 30px;
  align-items: start;
}

.form-card {
  padding: 28px;
  border: 2px solid rgba(88, 123, 41, .16);
  border-radius: 32px;
  background: rgba(255, 255, 255, .95);
  box-shadow: 0 24px 70px rgba(70, 92, 36, .24);
  backdrop-filter: blur(14px);
}

.brand-bar {
  margin: -12px -8px 26px;
  padding: 10px 18px 12px;
  min-height: 104px;
  display: flex;
  align-items: center;
  gap: 18px;
  border-radius: 24px;
  color: #fff;
  background:
    radial-gradient(circle at 20% 10%, rgba(255, 247, 0, .2), transparent 30%),
    linear-gradient(135deg, var(--brand-red), var(--brand-red-dark));
  box-shadow: 0 14px 30px rgba(121, 3, 7, .22);
}

.brand-bar img {
  width: 134px;
  height: auto;
  flex: 0 0 auto;
  filter: drop-shadow(0 7px 9px rgba(0, 0, 0, .25));
}

.brand-bar span {
  color: var(--brand-yellow);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.brand-bar p {
  margin: 1px 0 0;
  font-size: 18px;
  font-weight: 800;
}

.hero {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  margin-bottom: 30px;
}

.eyebrow {
  width: fit-content;
  margin: 0 0 8px;
  padding: 6px 15px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  background: rgba(138, 214, 38, .2);
  color: var(--brand-green-dark);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .2em;
  text-transform: uppercase;
}

.eyebrow svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; }

h1 {
  margin: 0;
  max-width: 610px;
  max-width: 650px;
  color: var(--brand-red);
  font-family: "Knewave", "Baloo 2", sans-serif;
  font-size: clamp(2.05rem, 4.2vw, 3.35rem);
  line-height: 1.03;
  letter-spacing: .005em;
  font-weight: 400;
  text-shadow: 2px 3px 0 rgba(255, 247, 0, .55);
}

.intro {
  max-width: 680px;
  margin: 14px 0 0;
  color: rgba(49, 65, 31, .75);
  font-size: 17px;
  line-height: 1.48;
  font-weight: 700;
}

.hero-icon {
  flex: 0 0 auto;
  width: 70px;
  height: 70px;
  display: grid;
  place-items: center;
  border-radius: 24px;
  color: var(--brand-red);
  background: linear-gradient(135deg, var(--brand-yellow), #ffb700);
  box-shadow: 0 14px 30px rgba(168, 7, 11, .18);
}

.hero-icon svg { width: 42px; height: 42px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }

.fields-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px 16px;
}

.field { display: block; }

.field > span {
  margin: 0 0 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--brand-green-dark);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.field span svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.field input {
  width: 100%;
  min-height: 56px;
  padding: 14px 16px;
  border: 2px solid rgba(88, 123, 41, .2);
  border-radius: 17px;
  outline: none;
  color: var(--brand-ink);
  background: var(--brand-cream);
  font-size: 17px;
  font-weight: 800;
  transition: border-color .2s ease, background .2s ease, box-shadow .2s ease;
}

.field input:focus {
  border-color: var(--brand-green);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(138, 214, 38, .16);
}

.field input::placeholder { color: rgba(51, 65, 15, .42); }

.message {
  margin: 20px 0 0;
  padding: 13px 15px;
  border: 1px solid #fecaca;
  border-radius: 15px;
  color: #b91c1c;
  background: #fef2f2;
  font-size: 14px;
  font-weight: 800;
}

.actions {
  margin-top: 24px;
  display: flex;
  gap: 12px;
}

.actions button, .download-panel a {
  border-radius: 17px;
  font-weight: 900;
  letter-spacing: .04em;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}

.primary-button {
  min-height: 56px;
  padding: 14px 24px;
  flex: 1;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  border: 0;
  color: #fff;
  background: linear-gradient(100deg, #55bd65, var(--brand-button));
  box-shadow: 0 10px 22px rgba(69, 151, 79, .24);
  font-size: 17px;
}

.primary-button svg, .download-panel svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.primary-button:not(:disabled):hover { transform: translateY(-2px); box-shadow: 0 14px 28px rgba(69, 151, 79, .32); }
.primary-button:disabled { opacity: .55; cursor: wait; }

.secondary-button {
  min-height: 56px;
  padding: 14px 24px;
  border: 2px solid rgba(168, 7, 11, .18);
  color: var(--brand-red);
  background: transparent;
}

.secondary-button:hover { background: #fff2f2; }

.download-panel {
  margin-top: 20px;
  padding: 16px;
  border: 2px dashed var(--brand-button);
  border-radius: 22px;
  background: #eff9e8;
}

.download-panel p { margin: 0 0 12px; font-weight: 900; }

.download-panel a {
  width: fit-content;
  padding: 12px 18px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #fff;
  background: var(--brand-red);
  text-decoration: none;
}

.download-panel a:hover { background: var(--brand-red-dark); }

.privacy-card {
  margin-top: 28px;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  border-radius: 24px;
  color: #fff;
  background:
    radial-gradient(circle at right top, rgba(255, 247, 0, .12), transparent 35%),
    linear-gradient(135deg, #4b7226, var(--brand-green-dark));
}

.privacy-icon {
  flex: 0 0 auto;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 15px;
  color: var(--brand-yellow);
  background: rgba(255, 255, 255, .1);
}

.privacy-icon svg { width: 27px; height: 27px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.privacy-card h2 { margin: 0 0 3px; font-size: 18px; font-weight: 900; }
.privacy-card p { margin: 0; color: rgba(255, 255, 255, .8); font-size: 13px; line-height: 1.45; font-weight: 650; }

.preview-card {
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 28px;
  color: #fff;
  background:
    radial-gradient(circle at top right, rgba(255, 247, 0, .16), transparent 28%),
    linear-gradient(145deg, #4d7327, #284416);
  box-shadow: 0 24px 70px rgba(52, 78, 26, .3);
  backdrop-filter: blur(10px);
}

.preview-card > header {
  min-height: 34px;
  padding: 0 8px 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.preview-card header p { margin: 0; color: var(--brand-yellow); font-family: "Knewave", "Baloo 2", sans-serif; font-size: 15px; font-weight: 400; letter-spacing: .04em; }
.preview-card header span { color: rgba(255, 255, 255, .7); font-size: 11px; font-weight: 800; }

.canvas-frame {
  min-height: 430px;
  position: relative;
  overflow: hidden;
  display: grid;
  place-items: center;
  border-radius: 23px;
  background: rgba(0, 0, 0, .22);
}

#invite-canvas {
  width: 100%;
  height: auto;
  display: block;
  opacity: 0;
  transition: opacity .25s ease;
}

#invite-canvas.ready { opacity: 1; }

.canvas-loading {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: grid;
  place-items: center;
  color: #ecfccb;
  font-weight: 850;
}

.canvas-loading[hidden] { display: none; }

@media (min-width: 1024px) {
  .generator { grid-template-columns: minmax(0, 1.04fr) minmax(420px, .96fr); }
  .preview-card { position: sticky; top: 24px; }
}

@media (max-width: 720px) {
  .page-shell { padding: 14px 10px; }
  .form-card { padding: 20px 16px; border-radius: 25px; }
  .brand-bar { margin: -8px -4px 24px; padding: 10px 12px; gap: 12px; }
  .brand-bar img { width: 102px; }
  .brand-bar span { font-size: 10px; letter-spacing: .1em; }
  .brand-bar p { font-size: 14px; line-height: 1.2; }
  .hero { align-items: flex-start; }
  .hero-icon { display: none; }
  .fields-grid { grid-template-columns: 1fr; }
  .actions { flex-direction: column; }
  .secondary-button { width: 100%; }
  .privacy-card { align-items: flex-start; }
  .preview-card { padding: 10px; border-radius: 23px; }
  .canvas-frame { border-radius: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
