:root {
  color-scheme: dark;
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, sans-serif;
  font-feature-settings:
    "rlig" 1,
    "calt" 1;
  --color-background: #0a0a0a;
  --color-foreground: #fafafa;
  --color-primary: #fafafa;
  --color-primary-foreground: #171717;
  --color-secondary: #262626;
  --color-secondary-foreground: #fafafa;
  --color-muted: #262626;
  --color-muted-foreground: #a3a3a3;
  --color-accent: #1e3a8a;
  --color-accent-foreground: #dbeafe;
  --color-border: #262626;
  --color-ring: #d4d4d4;
  --color-destructive: #ef4444;
  --color-destructive-foreground: #fafafa;
  --color-success: #16a34a;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--color-foreground);
  background: linear-gradient(
    to bottom right,
    var(--color-background),
    rgb(38 38 38 / 10%),
    rgb(38 38 38 / 30%)
  );
}

button,
input {
  font: inherit;
}

.shell {
  width: 100%;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 2rem 1rem;
}

.card {
  width: min(25rem, calc(100vw - 2rem));
  overflow: hidden;
  background: rgb(10 10 10 / 80%);
  border: 1px solid color-mix(in srgb, var(--color-border) 60%, transparent);
  border-radius: 1rem;
  box-shadow:
    0 20px 25px -5px rgb(0 0 0 / 20%),
    0 8px 10px -6px rgb(0 0 0 / 20%);
  backdrop-filter: blur(4px);
}

.brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2.5rem 2rem 1.5rem;
  text-align: center;
}

.mark {
  width: 4rem;
  height: 4rem;
  display: block;
  margin-bottom: 1.25rem;
  object-fit: contain;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 2rem;
  letter-spacing: -0.025em;
}

.brand p {
  margin: 0.375rem 0 0;
  color: var(--color-muted-foreground);
  font-size: 0.875rem;
  line-height: 1.25rem;
}

#form-panel {
  padding: 0 2rem 2rem;
}

form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.field {
  display: grid;
  gap: 0.375rem;
}

label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.25rem;
}

input {
  width: 100%;
  height: 2.75rem;
  padding: 0 0.875rem;
  color: var(--color-foreground);
  font-size: 0.875rem;
  line-height: 1.25rem;
  background: rgb(38 38 38 / 40%);
  border: 1px solid color-mix(in srgb, var(--color-border) 60%, transparent);
  border-radius: 0.75rem;
  outline: none;
  transition: all 200ms;
}

input:hover {
  border-color: var(--color-muted-foreground);
}

input:focus-visible {
  background: var(--color-background);
  border-color: rgb(250 250 250 / 50%);
  box-shadow: 0 0 0 2px var(--color-ring);
}

input::placeholder {
  color: var(--color-muted-foreground);
}

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

input[aria-invalid="true"] {
  border-color: var(--color-destructive);
}

.address-input {
  display: flex;
  align-items: stretch;
  border-radius: 0.75rem;
  transition: all 200ms;
}

.address-input input {
  min-width: 0;
  border-right: 0;
  border-radius: 0.75rem 0 0 0.75rem;
}

.address-input input:focus-visible {
  box-shadow: none;
}

.address-input span {
  display: flex;
  align-items: center;
  padding: 0 0.875rem;
  color: var(--color-muted-foreground);
  background: rgb(38 38 38 / 40%);
  border: 1px solid color-mix(in srgb, var(--color-border) 60%, transparent);
  border-left: 0;
  border-radius: 0 0.75rem 0.75rem 0;
  font-size: 0.875rem;
  white-space: nowrap;
  transition: all 200ms;
}

.address-input:hover input,
.address-input:hover span {
  border-color: var(--color-muted-foreground);
}

.address-input:focus-within {
  box-shadow: 0 0 0 2px var(--color-ring);
}

.address-input:focus-within input,
.address-input:focus-within span {
  background: var(--color-background);
  border-color: rgb(250 250 250 / 50%);
}

.address-input:has(input[aria-invalid="true"]) input,
.address-input:has(input[aria-invalid="true"]) span {
  border-color: var(--color-destructive);
}

.hint,
.field-error,
.form-status {
  font-size: 0.6875rem;
  line-height: 1.25;
}

.hint {
  margin: 0;
  color: var(--color-muted-foreground);
}

.field-error {
  margin: 0;
  color: var(--color-destructive);
}

.field-error:empty {
  display: none;
}

.turnstile {
  min-height: 65px;
  overflow: hidden;
  border-radius: 0.75rem;
}

.form-status {
  padding: 0.75rem;
  color: var(--color-destructive);
  font-size: 0.875rem;
  line-height: 1.25rem;
  background: rgb(239 68 68 / 5%);
  border: 1px solid rgb(239 68 68 / 20%);
  border-radius: 0.75rem;
}

.form-status:empty {
  display: none;
}

button,
.button-link {
  width: 100%;
  height: 2.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 1rem;
  color: var(--color-primary-foreground);
  font-size: 0.9375rem;
  font-weight: 500;
  line-height: 1.25rem;
  text-decoration: none;
  background: var(--color-primary);
  border: 0;
  border-radius: 0.75rem;
  box-shadow:
    0 4px 6px -1px rgb(250 250 250 / 15%),
    0 2px 4px -2px rgb(250 250 250 / 15%);
  cursor: pointer;
  transition: all 200ms;
}

#submit-button {
  margin-top: 0.25rem;
}

button:hover:not(:disabled),
.button-link:hover {
  background: rgb(250 250 250 / 90%);
  box-shadow:
    0 10px 15px -3px rgb(250 250 250 / 20%),
    0 4px 6px -4px rgb(250 250 250 / 20%);
}

button:active:not(:disabled),
.button-link:active {
  background: rgb(250 250 250 / 85%);
}

button:focus-visible,
.button-link:focus-visible {
  outline: 2px solid var(--color-ring);
  outline-offset: 2px;
}

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

.success {
  padding: 0 2rem 2rem;
  text-align: center;
  outline: none;
}

.success-icon {
  width: 4rem;
  height: 4rem;
  display: grid;
  place-items: center;
  margin: 0 auto 1.25rem;
  color: var(--color-success);
  background: rgb(22 163 74 / 10%);
  border-radius: 50%;
  font-size: 1.5rem;
  font-weight: 700;
}

.success h2 {
  margin-bottom: 0.5rem;
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.75rem;
}

.success p {
  margin-bottom: 0;
  color: var(--color-muted-foreground);
  font-size: 0.875rem;
  line-height: 1.25rem;
}

.success strong {
  display: block;
  margin: 0.375rem 0 1.5rem;
  color: var(--color-foreground);
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.5rem;
  overflow-wrap: anywhere;
}

.success .button-link {
  margin-bottom: 0.75rem;
}

[hidden] {
  display: none !important;
}

@media (max-width: 359px) {
  .shell {
    padding-inline: 0.75rem;
  }

  .brand {
    padding-inline: 1.5rem;
  }

  .card {
    width: calc(100vw - 1.5rem);
  }

  #form-panel,
  .success {
    padding-inline: 1.5rem;
  }

  .address-input span {
    padding-inline: 0.625rem;
    font-size: 0.8125rem;
  }
}

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