:root {
  color-scheme: dark;
  --bg: #101116;
  --card: #1b1c24;
  --surface: #282a35;
  --text: #f5f5f7;
  --muted: #a8a9b4;
  --line: rgba(255, 255, 255, 0.14);
  --accent: #bea8fa;
  --on-accent: #1b142a;
  --danger: #ffb7b7;
}

@media (prefers-color-scheme: light) {
  :root {
    color-scheme: light;
    --bg: #f5f5f7;
    --card: #ffffff;
    --surface: #f0eff5;
    --text: #1d1d1f;
    --muted: #62636d;
    --line: rgba(0, 0, 0, 0.12);
    --accent: #6d42bd;
    --on-accent: #ffffff;
    --danger: #a32735;
  }
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: max(20px, env(safe-area-inset-top)) 20px max(20px, env(safe-area-inset-bottom));
  background: var(--bg);
  color: var(--text);
  font:
    1.0625rem/1.45 system-ui,
    -apple-system,
    BlinkMacSystemFont,
    'Segoe UI',
    sans-serif;
}

.card {
  width: 100%;
  max-width: 480px;
  padding: 32px 24px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 24px;
}

.logo {
  display: block;
  margin: 0 0 20px;
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.brand-row .logo {
  flex: none;
  margin: 0;
}

.eyebrow {
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 12px;
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

h2 {
  margin-bottom: 8px;
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.25;
}

p {
  margin-bottom: 16px;
}

.muted {
  color: var(--muted);
  font-size: 0.9375rem;
}

.meta {
  margin: 0 0 20px;
  padding: 0;
  list-style: none;
}

.meta li {
  margin: 0 0 6px;
}

.desc {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.action-section {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.segmented-control {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin: 20px 0;
  padding: 4px;
  background: var(--surface);
  border-radius: 14px;
}

.segment-button {
  min-height: 44px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
}

.segment-button[aria-pressed='true'] {
  background: var(--card);
  color: var(--text);
}

.form-field {
  margin-bottom: 16px;
}

.form-field label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.9375rem;
  font-weight: 600;
}

.form-field input {
  display: block;
  width: 100%;
  min-height: 48px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
}

.form-field input::placeholder {
  color: var(--muted);
}

.button {
  display: block;
  width: 100%;
  min-height: 48px;
  padding: 12px 20px;
  border: 0;
  border-radius: 13px;
  background: var(--accent);
  color: var(--on-accent);
  text-align: center;
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.button:disabled,
.text-button:disabled {
  opacity: 0.55;
  cursor: wait;
}

.feedback:empty {
  display: none;
}

.feedback {
  margin-top: 12px;
  margin-bottom: 0;
}

.feedback[data-tone='error'] {
  color: var(--danger);
}

.app-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-top: 12px;
  color: var(--accent);
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none;
}

.app-link:hover {
  text-decoration: underline;
}

.text-button {
  min-height: 44px;
  padding: 8px 0;
  border: 0;
  background: transparent;
  color: var(--accent);
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
}

#rsvp-cancel {
  display: block;
  width: 100%;
  margin-top: 8px;
}

.account-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  overflow-wrap: anywhere;
}

.account-row .muted {
  min-width: 0;
}

:is(button, a, input):focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

@media (max-width: 480px) {
  .card {
    padding: 24px 20px;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .button,
  .segment-button {
    transition: transform 150ms cubic-bezier(0.32, 0.72, 0, 1);
  }

  .button:active,
  .segment-button:active {
    transform: scale(0.97);
  }
}
