:root {
  --nf-canvas: 8 8 10;
  --nf-surface: 16 14 16;
  --nf-elevated: 28 22 26;
  --nf-ink: 255 255 255;
  --nf-muted: 180 168 172;
  --nf-soft: 120 110 116;
  --nf-line: 48 36 42;
  --nf-accent: 165 33 46;
  --nf-accent-soft: 196 48 62;
  --nf-radius: 0.625rem;
  --nf-radius-lg: 1rem;
  --nf-shadow: 0 4px 24px rgb(0 0 0 / 0.5);
  --font-sans: "Manrope", system-ui, sans-serif;
  --font-display: "Fraunces", Georgia, serif;
  --duration: 180ms;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-smooth;
}

body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--font-sans);
  color: rgb(var(--nf-ink));
  background: rgb(var(--nf-canvas));
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

img {
  display: block;
  max-width: 100%;
}

::selection {
  background: rgb(var(--nf-accent) / 0.3);
}

:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgb(var(--nf-accent) / 0.5);
}

.nf-atmosphere {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(ellipse 80% 60% at 50% -10%, rgb(var(--nf-accent) / 0.14), transparent 60%),
    radial-gradient(ellipse 50% 40% at 90% 80%, rgb(var(--nf-accent-soft) / 0.08), transparent 50%),
    linear-gradient(180deg, rgb(var(--nf-canvas)), rgb(var(--nf-surface)));
  animation: glow-drift 16s ease-in-out infinite alternate;
}

.nf-pattern {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.4;
  background-image: radial-gradient(rgb(var(--nf-line) / 0.35) 1px, transparent 1px);
  background-size: 24px 24px;
}

.nf-orb {
  position: fixed;
  top: -6rem;
  left: 50%;
  width: 28rem;
  height: 28rem;
  transform: translateX(-50%);
  border-radius: 50%;
  background: rgb(var(--nf-accent) / 0.07);
  filter: blur(64px);
  pointer-events: none;
  z-index: 0;
  animation: orb-pulse 10s ease-in-out infinite alternate;
}

@keyframes glow-drift {
  from { transform: translateY(0) scale(1); }
  to { transform: translateY(1.5%) scale(1.03); }
}

@keyframes orb-pulse {
  from { opacity: 0.7; transform: translateX(-50%) scale(1); }
  to { opacity: 1; transform: translateX(-50%) scale(1.08); }
}

@keyframes enter-up {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.page {
  position: relative;
  z-index: 1;
  max-width: 36rem;
  margin: 0 auto;
  padding: 2rem 1rem 3rem;
}

@media (min-width: 640px) {
  .page {
    padding: 3rem 1.5rem 4rem;
  }
}

.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  animation: enter-up 0.7s ease-out both;
}

.brand {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 1.5rem;
  text-decoration: none;
  color: rgb(var(--nf-ink));
  font-weight: 700;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
  transition: transform 0.5s ease;
}

.brand:hover {
  transform: scale(1.03);
}

.brand img {
  width: 3.5rem;
  height: 3.5rem;
  object-fit: contain;
}

.brand .accent {
  color: rgb(var(--nf-accent-soft));
}

.hero h1 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.75rem, 5vw, 2.35rem);
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.lead {
  margin: 0.85rem 0 0;
  max-width: 28rem;
  color: rgb(var(--nf-muted));
  font-size: 0.95rem;
}

.topics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  margin-top: 2rem;
  animation: enter-up 0.7s ease-out 0.1s both;
}

.topic {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
  padding: 0.85rem 0.5rem;
  border-radius: var(--nf-radius-lg);
  border: 1px solid rgb(var(--nf-line) / 0.8);
  background: rgb(var(--nf-surface) / 0.55);
  color: rgb(var(--nf-muted));
  transition:
    color var(--duration) ease,
    border-color var(--duration) ease,
    background var(--duration) ease,
    transform var(--duration) ease;
}

.topic:hover {
  color: rgb(var(--nf-ink));
  border-color: rgb(var(--nf-accent) / 0.35);
  transform: translateY(-1px);
}

.topic.is-active {
  color: rgb(var(--nf-ink));
  border-color: rgb(var(--nf-accent) / 0.55);
  background: linear-gradient(180deg, rgb(var(--nf-accent) / 0.16), rgb(var(--nf-elevated) / 0.7));
  box-shadow: 0 0 0 1px rgb(var(--nf-accent) / 0.12);
}

.topic-icon {
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 999px;
  background: rgb(var(--nf-accent) / 0.1);
  color: rgb(var(--nf-accent-soft));
}

.topic.is-active .topic-icon {
  background: rgb(var(--nf-accent) / 0.2);
}

.topic-label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-align: center;
  line-height: 1.2;
}

.form-shell {
  margin-top: 1.25rem;
  padding: 1.25rem 1.15rem 1.35rem;
  border-radius: var(--nf-radius-lg);
  border: 1px solid rgb(var(--nf-line) / 0.8);
  background: rgb(var(--nf-surface) / 0.9);
  backdrop-filter: blur(12px);
  box-shadow: 0 20px 50px -28px rgb(var(--nf-ink) / 0.35);
  animation: enter-up 0.7s ease-out 0.2s both;
}

@media (min-width: 640px) {
  .form-shell {
    padding: 1.5rem;
  }
}

.form-head {
  margin-bottom: 1.25rem;
}

.form-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
}

.form-head p {
  margin: 0.35rem 0 0;
  color: rgb(var(--nf-muted));
  font-size: 0.875rem;
}

.field-group {
  display: grid;
  gap: 1rem;
  margin-bottom: 1rem;
}

.field-group[hidden] {
  display: none;
}

.field-row {
  display: grid;
  gap: 0.85rem;
}

@media (min-width: 520px) {
  .field-row {
    grid-template-columns: 1fr 1fr;
  }
}

.field {
  display: grid;
  gap: 0.4rem;
}

.field > span {
  font-size: 0.875rem;
  font-weight: 500;
  color: rgb(var(--nf-ink));
}

.field > span em {
  font-style: normal;
  font-weight: 400;
  color: rgb(var(--nf-soft));
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border-radius: var(--nf-radius);
  border: 1px solid rgb(var(--nf-line));
  background: rgb(var(--nf-canvas) / 0.65);
  padding: 0.7rem 0.85rem;
  transition: border-color var(--duration) ease, background var(--duration) ease;
}

.field textarea {
  resize: vertical;
  min-height: 6rem;
}

.field input::placeholder,
.field textarea::placeholder {
  color: rgb(var(--nf-soft));
}

.field input:hover,
.field select:hover,
.field textarea:hover {
  border-color: rgb(var(--nf-accent) / 0.35);
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: rgb(var(--nf-accent) / 0.55);
  box-shadow: 0 0 0 2px rgb(var(--nf-accent) / 0.25);
}

.segmented {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.4rem;
}

.seg {
  position: relative;
  cursor: pointer;
}

.seg input {
  position: absolute;
  opacity: 0;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
}

.seg span {
  display: block;
  text-align: center;
  padding: 0.65rem 0.4rem;
  border-radius: var(--nf-radius);
  border: 1px solid rgb(var(--nf-line));
  background: rgb(var(--nf-canvas) / 0.5);
  color: rgb(var(--nf-muted));
  font-size: 0.85rem;
  font-weight: 600;
  transition:
    color var(--duration) ease,
    border-color var(--duration) ease,
    background var(--duration) ease;
}

.seg:hover span {
  color: rgb(var(--nf-ink));
}

.seg input:checked + span {
  color: rgb(var(--nf-ink));
  border-color: rgb(var(--nf-accent) / 0.55);
  background: rgb(var(--nf-accent) / 0.18);
}

.seg input:focus-visible + span {
  box-shadow: 0 0 0 2px rgb(var(--nf-accent) / 0.5);
}

.btn-submit {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: center;
  margin-top: 0.35rem;
  padding: 0.9rem 1rem;
  border-radius: var(--nf-radius);
  background: linear-gradient(180deg, rgb(var(--nf-accent-soft)), rgb(var(--nf-accent)));
  color: #fff;
  font-weight: 700;
  letter-spacing: 0.01em;
  box-shadow: 0 10px 28px -12px rgb(var(--nf-accent) / 0.8);
  transition: transform var(--duration) ease, filter var(--duration) ease, opacity var(--duration) ease;
}

.btn-submit:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
}

.btn-submit:active {
  transform: translateY(0);
}

.btn-submit:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
  filter: none;
}

.footnote {
  margin: 1.25rem 0 0;
  text-align: center;
  color: rgb(var(--nf-soft));
  font-size: 0.78rem;
  animation: enter-up 0.7s ease-out 0.3s both;
}

.toasts {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 50;
  display: grid;
  gap: 0.5rem;
  max-width: min(22rem, calc(100vw - 2rem));
}

.toast {
  padding: 0.85rem 1rem;
  border-radius: var(--nf-radius);
  border: 1px solid rgb(var(--nf-line) / 0.9);
  background: rgb(var(--nf-elevated) / 0.95);
  backdrop-filter: blur(10px);
  box-shadow: var(--nf-shadow);
  animation: toast-in 0.35s ease-out both;
}

.toast strong {
  display: block;
  font-size: 0.9rem;
}

.toast p {
  margin: 0.2rem 0 0;
  color: rgb(var(--nf-muted));
  font-size: 0.8rem;
}

.toast.success {
  border-color: rgb(80 170 120 / 0.45);
}

.toast.error {
  border-color: rgb(220 70 80 / 0.45);
}

.field.is-invalid input,
.field.is-invalid select,
.field.is-invalid textarea {
  border-color: rgb(220 70 80 / 0.7);
}
