:root {
  --paper: #f6e8d9;
  --paper-line: rgba(255, 255, 255, 0.55);
  --card: #fff9f0;
  --card-soft: #fffdf8;
  --ink: #2d201d;
  --ink-soft: #65504a;
  --muted: #8a746b;
  --orange: #ec5a1a;
  --orange-dark: #bf4011;
  --yellow: #f5c327;
  --red: #e91d42;
  --blue: #158fc8;
  --green: #09973f;
  --line: rgba(45, 32, 29, 0.14);
  --line-strong: rgba(45, 32, 29, 0.26);
  --danger: #a72e1f;
  --shadow: 0 30px 80px rgba(79, 48, 31, 0.18);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "Work Sans", sans-serif;
  background:
    linear-gradient(90deg, var(--paper-line) 2px, transparent 2px) 0 0 / 270px 100%,
    linear-gradient(var(--paper-line) 2px, transparent 2px) 0 0 / 100% 205px,
    radial-gradient(circle at 10% 20%, rgba(233, 29, 66, 0.08), transparent 30%),
    radial-gradient(circle at 92% 82%, rgba(9, 151, 63, 0.1), transparent 32%),
    radial-gradient(circle at 48% 12%, rgba(245, 195, 39, 0.15), transparent 30%),
    var(--paper);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle, rgba(101, 80, 74, 0.14) 0 2px, transparent 3px) 32px 42px / 188px 168px,
    radial-gradient(circle, rgba(236, 90, 26, 0.18) 0 2px, transparent 3px) 128px 98px / 248px 224px;
}

button,
input {
  font: inherit;
}

.site-shell {
  width: min(1040px, calc(100% - 32px));
  min-height: 100vh;
  margin: 0 auto;
  display: grid;
  place-items: center;
  padding: 32px 0;
}

.invite-card {
  position: relative;
  width: 100%;
  min-height: min(720px, calc(100vh - 64px));
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
  padding: clamp(28px, 5vw, 58px);
  border: 1px solid rgba(255, 255, 255, 0.74);
  border-radius: 10px;
  background:
    linear-gradient(135deg, rgba(255, 253, 248, 0.96), rgba(255, 246, 235, 0.92)),
    var(--card);
  box-shadow: var(--shadow);
}

.invite-card::before {
  content: "";
  position: absolute;
  inset: 18px;
  border: 1px solid rgba(45, 32, 29, 0.08);
  border-radius: 6px;
  pointer-events: none;
}

.invite-card::after {
  content: "";
  position: absolute;
  right: -120px;
  bottom: -150px;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  background:
    radial-gradient(circle, transparent 0 33%, rgba(236, 90, 26, 0.1) 34% 36%, transparent 37%),
    repeating-conic-gradient(from -8deg, rgba(236, 90, 26, 0.24) 0 7deg, transparent 7deg 21deg);
  pointer-events: none;
}

.invite-header {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: clamp(34px, 6vw, 64px);
}

.brand-mark {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 50%;
  color: var(--card-soft);
  background: var(--ink);
  font-family: "Oswald", sans-serif;
  font-size: 1.02rem;
  font-weight: 700;
  letter-spacing: 0;
  box-shadow: inset 0 -5px 0 rgba(236, 90, 26, 0.45);
}

.kicker,
.subtitle {
  margin: 0;
}

.kicker {
  color: var(--ink);
  font-family: "Oswald", sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.subtitle {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.98rem;
}

.color-rail {
  position: absolute;
  left: clamp(28px, 5vw, 58px);
  right: clamp(28px, 5vw, 58px);
  top: 20px;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr 1fr 0.8fr 1.2fr;
  gap: 8px;
}

.color-rail span {
  height: 7px;
  border-radius: 999px;
}

.color-rail span:nth-child(1) { background: var(--yellow); }
.color-rail span:nth-child(2) { background: var(--red); }
.color-rail span:nth-child(3) { background: var(--blue); }
.color-rail span:nth-child(4) { background: var(--green); }
.color-rail span:nth-child(5) { background: var(--orange); }

.step {
  position: relative;
  z-index: 1;
  display: none;
}

.step.is-active {
  display: block;
  animation: reveal 260ms ease both;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--orange-dark);
  font-family: "Oswald", sans-serif;
  font-size: 1.02rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  max-width: 780px;
  margin: 0;
  color: var(--ink);
  font-family: "Oswald", sans-serif;
  font-size: 4.6rem;
  font-weight: 700;
  line-height: 0.95;
  letter-spacing: 0;
  text-transform: uppercase;
}

.section-title {
  font-size: 3.45rem;
}

.lead {
  max-width: 680px;
  margin: 22px 0 0;
  color: var(--ink-soft);
  font-size: 1.08rem;
  line-height: 1.7;
}

.access-note {
  max-width: 760px;
}

.primary-action,
.secondary-action {
  min-height: 56px;
  border-radius: 999px;
  padding: 0 25px;
  margin-top: 32px;
  font-family: "Oswald", sans-serif;
  font-size: 1.04rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, background-color 160ms ease, border-color 160ms ease, color 160ms ease;
}

.primary-action {
  border: 2px solid var(--orange);
  color: var(--card-soft);
  background: var(--orange);
  box-shadow: 0 14px 24px rgba(191, 64, 17, 0.22);
}

.secondary-action {
  border: 2px solid rgba(45, 32, 29, 0.16);
  color: var(--ink);
  background: rgba(255, 255, 255, 0.54);
}

.primary-action:hover,
.secondary-action:hover {
  transform: translateY(-1px);
}

.primary-action:hover {
  border-color: var(--ink);
  background: var(--ink);
}

.secondary-action:hover {
  border-color: var(--ink);
  background: rgba(255, 255, 255, 0.78);
}

.primary-action:disabled {
  cursor: wait;
  opacity: 0.72;
  transform: none;
}

.field-label {
  display: block;
  margin: 32px 0 10px;
  color: var(--ink);
  font-family: "Oswald", sans-serif;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

input {
  width: min(560px, 100%);
  height: 58px;
  padding: 0 16px;
  border: 2px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.76);
  outline: 0;
}

input[readonly] {
  width: min(760px, 100%);
  cursor: text;
}

input:focus {
  border-color: var(--orange);
  box-shadow: 0 0 0 4px rgba(236, 90, 26, 0.13);
}

.form-message {
  min-height: 22px;
  margin: 12px 0 0;
  color: var(--danger);
  font-family: "Oswald", sans-serif;
  font-size: 0.98rem;
  font-weight: 700;
  letter-spacing: 0;
}

.form-message:not(.is-visible) {
  visibility: hidden;
}

.gift-heading {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(260px, 0.82fr);
  gap: 24px;
  align-items: end;
}

.selected-strip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 24px 0 14px;
  padding: 9px 14px;
  border: 2px solid rgba(236, 90, 26, 0.18);
  border-radius: 999px;
  color: var(--orange-dark);
  background: rgba(236, 90, 26, 0.08);
  font-family: "Oswald", sans-serif;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.gift-list {
  width: 100%;
  max-height: 360px;
  overflow: auto;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 2px 8px 4px 0;
  scrollbar-color: var(--orange) rgba(255, 255, 255, 0.48);
}

.gift-item {
  position: relative;
  min-height: 60px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 14px;
  border: 2px solid rgba(45, 32, 29, 0.1);
  border-radius: 8px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.56);
  cursor: pointer;
  text-align: left;
}

.gift-item:hover {
  border-color: rgba(236, 90, 26, 0.42);
  background: rgba(255, 255, 255, 0.84);
  box-shadow: 0 8px 18px rgba(79, 48, 31, 0.08);
}

.gift-item.is-selected {
  color: var(--card-soft);
  border-color: var(--ink);
  background: var(--ink);
}

.gift-item.is-unavailable {
  cursor: not-allowed;
  color: rgba(45, 32, 29, 0.46);
  border-color: rgba(45, 32, 29, 0.08);
  background: rgba(220, 201, 187, 0.46);
}

.gift-item.is-unavailable::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  top: 50%;
  height: 2px;
  background: rgba(45, 32, 29, 0.48);
  transform: rotate(-1deg);
}

.gift-item.is-unavailable .gift-name {
  text-decoration: line-through;
  text-decoration-thickness: 2px;
}

.gift-name {
  min-width: 0;
  overflow-wrap: anywhere;
  font-weight: 700;
}

.gift-status {
  flex: 0 0 auto;
  color: inherit;
  font-family: "Oswald", sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.empty-state {
  grid-column: 1 / -1;
  margin: 0;
  padding: 20px;
  color: var(--ink-soft);
  border: 2px dashed var(--line-strong);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.46);
}

.actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.admin-shell {
  align-items: start;
}

.admin-card {
  min-height: auto;
  justify-content: flex-start;
}

.admin-topbar {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 28px;
}

.admin-header {
  margin-bottom: 0;
}

.admin-logout {
  margin-top: 0;
}

.admin-hero {
  position: relative;
  z-index: 1;
}

.admin-flash {
  position: relative;
  z-index: 1;
  margin: 22px 0 0;
  padding: 14px 16px;
  border-radius: 10px;
  font-weight: 600;
}

.admin-flash-success {
  color: #0f5f2f;
  background: rgba(9, 151, 63, 0.12);
  border: 1px solid rgba(9, 151, 63, 0.22);
}

.admin-flash-error {
  color: var(--danger);
  background: rgba(233, 29, 66, 0.08);
  border: 1px solid rgba(233, 29, 66, 0.16);
}

.admin-stats-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: 28px;
}

.admin-menu {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 22px;
}

.admin-menu-button {
  min-height: 52px;
  padding: 0 24px;
  border: 1px solid rgba(45, 32, 29, 0.12);
  border-radius: 999px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.6);
  font-family: "Oswald", sans-serif;
  font-size: 1rem;
  text-transform: uppercase;
  cursor: pointer;
  transition: background-color 160ms ease, color 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.admin-menu-button:hover {
  transform: translateY(-1px);
  border-color: rgba(236, 90, 26, 0.32);
}

.admin-menu-button.is-active {
  color: var(--card-soft);
  border-color: var(--ink);
  background: var(--ink);
}

.admin-stat-card,
.admin-panel,
.reservation-card,
.admin-gift-row {
  border: 1px solid rgba(45, 32, 29, 0.1);
  background: rgba(255, 255, 255, 0.62);
  box-shadow: 0 10px 24px rgba(79, 48, 31, 0.06);
}

.admin-stat-card {
  padding: 18px;
  border-radius: 12px;
}

.admin-stat-value {
  margin: 0;
  color: var(--ink);
  font-family: "Oswald", sans-serif;
  font-size: 2rem;
  font-weight: 700;
}

.admin-stat-label {
  margin: 8px 0 0;
  color: var(--ink-soft);
  font-size: 0.96rem;
}

.admin-views {
  position: relative;
  z-index: 1;
  margin-top: 24px;
}

.admin-view[hidden] {
  display: none;
}

.admin-panel {
  padding: 22px;
  border-radius: 14px;
}

.admin-panel-header,
.admin-panel-header-spread {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
}

.admin-panel-header h2,
.admin-panel-header-spread h2 {
  margin: 0 0 18px;
  font-family: "Oswald", sans-serif;
  font-size: 1.8rem;
  text-transform: uppercase;
}

.admin-panel-header-spread h2 {
  margin-bottom: 0;
}

.admin-inline-button {
  min-height: 44px;
  margin-top: 0;
  padding: 0 18px;
  font-size: 0.94rem;
}

.reservation-list {
  display: grid;
  gap: 14px;
}

.admin-search-wrap {
  margin: 18px 0 22px;
}

.admin-search-input {
  width: 100%;
  height: 54px;
  padding: 0 18px;
  border: 1px solid rgba(45, 32, 29, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.76);
}

.reservation-card {
  padding: 18px;
  border-radius: 12px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(255, 247, 236, 0.82)),
    rgba(255, 255, 255, 0.62);
}

.reservation-card-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.reservation-card-header h3 {
  margin: 0;
  font-family: "Oswald", sans-serif;
  font-size: 1.55rem;
}

.reservation-card-header p {
  margin: 8px 0 0;
  color: var(--ink-soft);
}

.reservation-meta-list {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 18px;
  margin-top: 10px;
}

.reservation-meta-list p {
  margin: 0;
}

.reservation-release {
  margin-top: 0;
  white-space: nowrap;
}

.reservation-gifts {
  margin-top: 16px;
}

.reservation-gifts-label {
  margin: 0 0 8px;
  color: var(--orange-dark);
  font-family: "Oswald", sans-serif;
  text-transform: uppercase;
}

.reservation-gifts ul {
  margin: 0;
  padding-left: 18px;
  color: var(--ink);
}

.reservation-gifts li + li {
  margin-top: 6px;
}

.admin-gifts-table {
  display: grid;
  gap: 16px;
  margin-top: 24px;
}

.admin-gift-card {
  border: 1px solid rgba(45, 32, 29, 0.1);
  border-radius: 16px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.92), rgba(255, 245, 232, 0.82)),
    rgba(255, 255, 255, 0.62);
  box-shadow: 0 12px 28px rgba(79, 48, 31, 0.07);
  padding: 18px;
}

.admin-gift-card-main {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.admin-gift-card-copy {
  min-width: 0;
  flex: 1 1 auto;
}

.admin-gift-card-side {
  min-width: 180px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: flex-end;
}

.admin-gift-name {
  margin: 0;
  font-family: "Oswald", sans-serif;
  font-size: 1.45rem;
  line-height: 1.05;
  text-transform: uppercase;
}

.admin-gift-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.admin-gift-metrics span,
.admin-gift-meta {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  color: var(--ink-soft);
  font-size: 0.9rem;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(45, 32, 29, 0.08);
}

.admin-gift-actions {
  display: flex;
  gap: 10px;
}

.admin-gift-submit,
.admin-gift-delete {
  margin-top: 0;
}

.admin-gift-delete-form {
  display: flex;
  justify-content: flex-end;
  margin-top: 14px;
}

.admin-gift-status {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  color: #0f5f2f;
  background: rgba(9, 151, 63, 0.12);
  font-family: "Oswald", sans-serif;
  font-size: 0.86rem;
  text-transform: uppercase;
}

.admin-gift-status.is-reserved {
  color: var(--danger);
  background: rgba(233, 29, 66, 0.1);
}

.admin-modal {
  width: min(560px, calc(100% - 24px));
  padding: 0;
  border: 0;
  border-radius: 18px;
  background: transparent;
}

.admin-modal::backdrop {
  background: rgba(45, 32, 29, 0.42);
  backdrop-filter: blur(4px);
}

.admin-modal-card {
  padding: 26px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 18px;
  background:
    linear-gradient(145deg, rgba(255, 252, 247, 0.98), rgba(255, 244, 230, 0.95)),
    var(--card);
  box-shadow: 0 24px 60px rgba(55, 31, 20, 0.22);
}

.admin-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.admin-modal-header h2 {
  margin: 0;
  font-family: "Oswald", sans-serif;
  font-size: 2.2rem;
  text-transform: uppercase;
  line-height: 0.98;
}

.admin-modal-close {
  min-height: 40px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  color: var(--ink);
  background: rgba(45, 32, 29, 0.08);
  font-family: "Oswald", sans-serif;
  text-transform: uppercase;
  cursor: pointer;
}

.admin-modal-body {
  margin-top: 20px;
}

.admin-modal-body .field-label:first-child {
  margin-top: 0;
}

.admin-modal-body input {
  width: 100%;
}

.admin-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 22px;
}

@keyframes reveal {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 860px) {
  .invite-card {
    min-height: calc(100vh - 64px);
  }

  .gift-heading {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .admin-stats-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .site-shell {
    width: min(100% - 16px, 1040px);
    padding: 8px 0;
  }

  .invite-card {
    min-height: calc(100vh - 16px);
    padding: 30px 18px;
    border-radius: 8px;
  }

  .invite-card::before {
    inset: 10px;
  }

  .invite-card::after {
    right: -190px;
    bottom: -210px;
  }

  .invite-header {
    gap: 12px;
    margin-bottom: 34px;
  }

  .brand-mark {
    width: 50px;
    height: 50px;
    font-size: 0.9rem;
  }

  .color-rail {
    left: 18px;
    right: 18px;
    top: 12px;
    gap: 5px;
  }

  .color-rail span {
    height: 5px;
  }

  h1 {
    font-size: 2.8rem;
  }

  .section-title {
    font-size: 2.2rem;
  }

  .lead {
    font-size: 0.98rem;
  }

  .gift-list {
    grid-template-columns: 1fr;
    max-height: 48vh;
  }

  .admin-topbar,
  .reservation-card-header,
  .admin-gift-card-main,
  .admin-panel-header-spread,
  .admin-modal-header {
    flex-direction: column;
    align-items: stretch;
  }

  .admin-gift-card-side,
  .admin-gift-delete-form {
    align-items: stretch;
    justify-content: stretch;
  }

  .admin-stat-card,
  .admin-panel,
  .reservation-card {
    padding: 16px;
  }

  .actions-row .primary-action,
  .actions-row .secondary-action,
  .reservation-release,
  .admin-logout,
  .admin-gift-submit,
  .admin-gift-delete,
  .admin-inline-button,
  .admin-menu-button {
    width: 100%;
  }

  .admin-modal {
    width: calc(100% - 16px);
  }

  .admin-modal-card {
    padding: 18px;
  }

  .admin-modal-actions {
    flex-direction: column;
  }
}
