@font-face {
  font-family: "Geist";
  src: url("/Geist-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --background: hsl(0 0% 4%);
  --foreground: hsl(0 0% 95%);
  --muted: hsl(0 0% 55%);
  --destructive: hsl(0 72% 51%);
  --valid: #10b981;
  --invalid: #ef4444;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
}

html {
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  color: var(--foreground);
  background-color: var(--background);
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(120, 119, 198, 0.08), transparent),
    radial-gradient(ellipse 60% 40% at 50% 120%, rgba(120, 119, 198, 0.05), transparent);
  font-family: "Geist", ui-sans-serif, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

main {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 16px;
}

.card {
  position: relative;
  overflow: hidden;
  width: 100%;
  max-width: 448px;
  padding: 32px;
  border-radius: 12px;
  background: linear-gradient(to bottom, hsl(0 0% 8%), hsl(0 0% 6%));
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.05),
    0 20px 50px -12px rgba(0, 0, 0, 0.5),
    0 0 80px -20px rgba(120, 119, 198, 0.15);
}

.card::before {
  content: "";
  position: absolute;
  inset: 0;
  padding: 1px;
  border-radius: inherit;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.02));
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

header {
  margin-bottom: 24px;
  text-align: center;
}

h1 {
  margin-bottom: 8px;
  font-size: 20px;
  font-weight: 500;
  line-height: 28px;
  letter-spacing: -0.01em;
  overflow-wrap: anywhere;
}

header p {
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  line-height: 16px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  line-height: 24px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.input-wrap {
  position: relative;
}

input,
textarea {
  display: block;
  width: 100%;
  border: 1px solid hsl(0 0% 16%);
  border-radius: 8px;
  outline: none;
  color: inherit;
  background: hsl(0 0% 8%);
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  font: inherit;
  font-size: 16px;
  transition: all 200ms cubic-bezier(0.4, 0, 0.2, 1);
}

input {
  height: 44px;
  padding: 4px 12px;
}

textarea {
  min-height: 60px;
  padding: 8px 12px;
  line-height: 24px;
  resize: none;
}

@media (min-width: 768px) {
  input,
  textarea {
    font-size: 14px;
  }

  textarea {
    line-height: 20px;
  }
}

input:hover,
textarea:hover {
  border-color: hsl(0 0% 22%);
}

input:focus,
textarea:focus {
  border-color: hsl(0 0% 30%);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.05);
}

input[data-state="valid"] {
  padding-right: 40px;
  border-color: rgba(16, 185, 129, 0.5);
}

input[data-state="valid"]:focus {
  border-color: var(--valid);
}

input[data-state="invalid"] {
  padding-right: 40px;
  border-color: rgba(239, 68, 68, 0.5);
}

input[data-state="invalid"]:focus {
  border-color: var(--invalid);
}

.icon {
  position: absolute;
  top: 50%;
  right: 12px;
  width: 20px;
  height: 20px;
  transform: translateY(-50%);
}

.icon.valid {
  color: var(--valid);
}

.icon.invalid {
  color: var(--invalid);
}

/* The svg `hidden` attribute needs help against the rule above's specificity. */
.icon[hidden] {
  display: none;
}

.field-error {
  color: rgba(239, 68, 68, 0.8);
  font-size: 12px;
  line-height: 16px;
}

.turnstile {
  display: flex;
  justify-content: center;
  padding-top: 4px;
}

/* The Turnstile widget is 300px wide and can't shrink. */
@media (max-width: 400px) {
  .card {
    padding: 24px 12px;
  }
}

.form-error {
  color: var(--destructive);
  font-size: 14px;
  line-height: 20px;
  text-align: center;
}

button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 44px;
  padding: 8px 16px;
  border: 0;
  border-radius: 8px;
  color: var(--background);
  background: linear-gradient(to bottom, hsl(0 0% 95%), hsl(0 0% 88%));
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.4);
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.025em;
  cursor: pointer;
  transition: all 200ms cubic-bezier(0.4, 0, 0.2, 1);
}

button:hover:not(:disabled) {
  background: linear-gradient(to bottom, hsl(0 0% 100%), hsl(0 0% 92%));
  box-shadow:
    0 2px 8px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

button:active:not(:disabled) {
  background: linear-gradient(to bottom, hsl(0 0% 88%), hsl(0 0% 85%));
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.thanks {
  color: var(--muted);
  font-size: 14px;
  line-height: 20px;
  letter-spacing: 0.025em;
  text-align: center;
}
