@font-face {
  font-family: "Flowmery";
  src: url("../fonts/Flowmery-Regular.ttf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

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

:root {
  --paper: rgba(255, 252, 248, 0.92);
  --ink: #1d3a4f;
  --muted: #4d6576;
  --line: rgba(29, 58, 79, 0.24);
  --accent: #1d3a4f;
  --accent-deep: #13293a;
  --sage: #527187;
  --shadow: 0 18px 45px rgba(29, 58, 79, 0.14);
  --title: "Allura", "Brush Script MT", cursive;
  --script: "Flowmery", "Brush Script MT", cursive;
  --body: "Cormorant Garamond", Roboto, "Segoe UI", Helvetica, Arial, serif;
  --input: Roboto, "Segoe UI", Helvetica, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font-size: 1.15rem;
  font-family: var(--body);
  line-height: 1.55;
  background:
    linear-gradient(rgba(255, 250, 244, 0.72), rgba(255, 250, 244, 0.78)),
    url("../images/background.svg") center / cover fixed;
}

input,
select,
textarea {
  font-family: var(--input);
}

.corner-floral {
  position: fixed;
  z-index: 0;
  width: clamp(120px, 20vw, 260px);
  pointer-events: none;
  user-select: none;
}

.corner-floral-top {
  top: 0;
  right: 0;
}

.corner-floral-bottom {
  bottom: 0;
  left: 0;
}

.page-shell {
  position: relative;
  z-index: 1;
  width: min(100% - 32px, 980px);
  margin: 0 auto;
  padding: 40px 0 56px;
}

.site-header {
  padding: 24px 0 16px;
  text-align: center;
}

.date-line {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  color: var(--accent-deep);
  font-weight: 400;
  line-height: 1;
}

h1 {
  font-family: var(--title);
  font-size: clamp(3.2rem, 8vw, 5.4rem);
}

h1 a {
  color: inherit;
  text-decoration: none;
}

h1 a:focus-visible {
  outline: 3px solid rgba(29, 58, 79, 0.34);
  outline-offset: 6px;
}

h2 {
  font-family: var(--script);
  font-size: clamp(1.2rem, 2.88vw, 1.92rem);
}

.rsvp-section {
  margin-top: 24px;
  padding: clamp(20px, 4vw, 36px);
  border: 1px solid rgba(29, 58, 79, 0.36);
  border-radius: 8px;
  background: transparent;
  box-shadow: var(--shadow);
  backdrop-filter: blur(5px);
}

.section-heading {
  max-width: 680px;
  margin-right: auto;
  margin-bottom: 24px;
  margin-left: auto;
  text-align: center;
}

.section-heading p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 1rem;
}

.section-heading .date-line {
  margin-top: 4px;
}

.rsvp-form {
  display: grid;
  gap: 22px;
}

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

.field,
.dynamic-area {
  display: grid;
  gap: 8px;
}

.field-wide {
  grid-column: 1 / -1;
}

.is-hidden {
  display: none !important;
}

label,
.dynamic-title {
  color: var(--accent-deep);
  font-size: 0.95rem;
  font-weight: 700;
}

small,
.empty-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 13px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.72);
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--sage);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(29, 58, 79, 0.16);
}

.dynamic-fields {
  display: grid;
  gap: 14px;
}

.person-card {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 250, 243, 0.68);
}

.person-card h3 {
  margin: 0;
  color: var(--ink);
  font-size: 1.05rem;
}

.choice-set {
  display: grid;
  gap: 8px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.choice-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.info-tooltip {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 19px;
  height: 19px;
  border: 1px solid rgba(29, 58, 79, 0.38);
  border-radius: 50%;
  color: var(--accent);
  font-family: var(--input);
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1;
  cursor: help;
}

.info-tooltip::after {
  position: absolute;
  bottom: calc(100% + 9px);
  left: 50%;
  z-index: 2;
  width: min(240px, 78vw);
  padding: 8px 10px;
  border-radius: 8px;
  color: #fff;
  background: var(--accent);
  content: attr(data-tooltip);
  font-family: var(--input);
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.35;
  opacity: 0;
  pointer-events: none;
  text-align: left;
  transform: translateX(-50%) translateY(4px);
  transition: opacity 140ms ease, transform 140ms ease;
}

.info-tooltip:hover::after,
.info-tooltip:focus-visible::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.choice-options {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
}

.choice-options label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 32px;
  color: var(--ink);
  font-size: 0.94rem;
  font-weight: 500;
}

.choice-options input[type="radio"] {
  width: auto;
  margin: 0;
  accent-color: var(--accent);
}

.address-block {
  display: grid;
  gap: 2px;
  margin: 2px 0 0;
  padding: 14px 16px;
  border-left: 4px solid var(--sage);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.56);
  font-style: normal;
}

.address-block strong {
  font-size: 1.1rem;
}

.address-block span {
  color: var(--muted);
  font-size: 0.98rem;
}

.primary-button {
  justify-self: center;
  min-height: 46px;
  border: 0;
  border-radius: 8px;
  padding: 12px 20px;
  color: #fff;
  font-weight: 800;
  background: var(--accent);
  cursor: pointer;
  transition: background 160ms ease, transform 160ms ease;
}

.primary-button:hover {
  background: var(--accent-deep);
  transform: translateY(-1px);
}

.primary-button:focus-visible {
  outline: 3px solid rgba(29, 58, 79, 0.42);
  outline-offset: 3px;
}

.primary-button:disabled {
  cursor: wait;
  opacity: 0.7;
}

.form-status {
  min-height: 1.4em;
  margin: -8px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
  text-align: center;
}

.form-status[data-state="success"] {
  color: var(--sage);
}

.form-status[data-state="error"] {
  color: var(--accent-deep);
}

@media (max-width: 720px) {
  body {
    background-attachment: scroll;
  }

  .page-shell {
    width: min(100% - 20px, 980px);
    padding: 24px 0 40px;
  }

  .site-header {
    padding-top: 18px;
  }

  .rsvp-section {
    padding: 18px;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .choice-options {
    display: grid;
    gap: 8px;
  }

  .corner-floral {
    width: clamp(96px, 32vw, 150px);
    opacity: 0.78;
  }

  .primary-button {
    width: 100%;
  }
}
