:root {
  --ink: #17212b;
  --muted: #66717c;
  --line: #dfe5e9;
  --panel: #f6f8f9;
  --accent: #173b5b;
  --accent-2: #2f6f8f;
  --success: #24734c;
  --danger: #a63a3a;
  --white: #ffffff;
  --shadow: 0 20px 55px rgba(15, 33, 48, 0.1);
}

* {
  box-sizing: border-box;
}
html {
  background: #eef2f4;
}
body {
  margin: 0;
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  color: var(--ink);
  background:
    radial-gradient(
      circle at 20% 0%,
      rgba(47, 111, 143, 0.12),
      transparent 38rem
    ),
    #eef2f4;
}

button,
input {
  font: inherit;
}
a {
  color: var(--accent-2);
}
.hidden {
  display: none !important;
}

.shell {
  width: min(860px, calc(100% - 28px));
  margin: 28px auto 48px;
}
.card {
  background: var(--white);
  border: 1px solid rgba(23, 59, 91, 0.1);
  border-radius: 22px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 28px;
  border-bottom: 1px solid var(--line);
}
.brand-mark {
  width: 110px;
  height: 52px;
  object-fit: contain;
  flex-shrink: 0;
}
.brand-name {
  font-weight: 750;
}
.brand-subtitle {
  color: var(--muted);
  font-size: 13px;
  margin-top: 2px;
}

#guestForm {
  padding: 32px 36px 38px;
}
.hero {
  margin-bottom: 28px;
}
.eyebrow {
  color: var(--accent-2);
  font-weight: 700;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0 0 8px;
}
h1 {
  font-size: clamp(28px, 5vw, 38px);
  line-height: 1.08;
  margin: 0 0 12px;
  letter-spacing: -0.025em;
}
.lead {
  color: var(--muted);
  line-height: 1.55;
  margin: 0;
  max-width: 680px;
}

.field-group {
  margin: 22px 0;
}
.field-group > label:first-child {
  display: block;
  font-weight: 700;
  margin-bottom: 8px;
}
input[type="text"],
input:not([type]) {
  width: 100%;
}
#guestName {
  width: 100%;
  border: 1px solid #cfd8de;
  border-radius: 12px;
  padding: 14px 15px;
  outline: none;
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
}
#guestName:focus {
  border-color: var(--accent-2);
  box-shadow: 0 0 0 3px rgba(47, 111, 143, 0.12);
}

.file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.upload-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 108px;
  border: 1.5px dashed #aebdc6;
  border-radius: 14px;
  background: var(--panel);
  cursor: pointer;
  padding: 18px;
  text-align: center;
}
.upload-box:hover {
  border-color: var(--accent-2);
}
.upload-title {
  font-weight: 750;
}
.upload-help {
  color: var(--muted);
  font-size: 13px;
  margin-top: 6px;
}
.privacy-note {
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.5;
  margin: 9px 2px 0;
}

.rules-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 20px;
  margin: 28px 0 20px;
}
.rules-heading-row {
  display: flex;
  gap: 16px;
  justify-content: space-between;
  align-items: baseline;
}
.rules-heading-row h2 {
  margin: 0;
  font-size: 19px;
}
.text-link {
  font-size: 13px;
  white-space: nowrap;
}
.rules-intro {
  color: #4f5d68;
  font-size: 13.5px;
  line-height: 1.5;
  margin: 12px 0 16px;
}
.rule-item {
  font-size: 13.5px;
  line-height: 1.5;
  margin: 0 0 10px;
  padding-left: 18px;
  position: relative;
}
.rule-item::before {
  content: "•";
  position: absolute;
  left: 3px;
  color: var(--accent-2);
  font-weight: 900;
}
.rule-item strong {
  color: #223340;
}
.rules-version {
  color: #7d8891;
  font-size: 11px;
  margin: 15px 0 0;
}

.acceptance-box {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 12px;
  align-items: start;
  border: 1px solid #cfd8de;
  border-radius: 14px;
  padding: 16px;
  cursor: pointer;
  line-height: 1.5;
  font-size: 14px;
}
.acceptance-box:has(input:checked) {
  border-color: var(--accent-2);
  background: rgba(47, 111, 143, 0.055);
}
.acceptance-box input {
  width: 18px;
  height: 18px;
  margin: 2px 0 0;
  accent-color: var(--accent);
}

.primary-button {
  width: 100%;
  min-height: 52px;
  border: 0;
  border-radius: 13px;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
  cursor: pointer;
  margin-top: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.primary-button:hover {
  filter: brightness(1.05);
}
.primary-button:disabled {
  opacity: 0.62;
  cursor: wait;
}
.submit-note {
  color: var(--muted);
  text-align: center;
  font-size: 12.5px;
  margin: 9px 0 0;
}

.error-box {
  margin-top: 14px;
  border: 1px solid #e1b4b4;
  background: #fff4f4;
  color: #7e2424;
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 13px;
}
.state-panel {
  padding: 60px 34px;
  text-align: center;
}
.state-panel p {
  color: var(--muted);
  line-height: 1.55;
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
}
.state-icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  margin: 0 auto 18px;
  background: #f3dddd;
  color: var(--danger);
  font-size: 26px;
  font-weight: 800;
}
.state-icon.success {
  background: #e2f2e9;
  color: var(--success);
}
.reference-box {
  margin: 24px auto 16px;
  max-width: 440px;
  padding: 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.reference-box span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 4px;
}
.reference-box strong {
  font-size: 16px;
  letter-spacing: 0.02em;
}
.completed-items {
  display: flex;
  justify-content: center;
  gap: 18px;
  flex-wrap: wrap;
  color: var(--success);
  font-size: 13px;
  font-weight: 650;
}
.small-note {
  font-size: 12.5px;
}
.footer {
  color: #7c8790;
  text-align: center;
  font-size: 12px;
  margin-top: 18px;
}

.spinner,
.button-spinner {
  width: 24px;
  height: 24px;
  border: 3px solid rgba(23, 59, 91, 0.18);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto;
}
.button-spinner {
  width: 18px;
  height: 18px;
  border-color: rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  margin: 0;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.admin-shell {
  width: min(1180px, calc(100% - 28px));
  margin: 28px auto 50px;
}
.admin-card {
  background: #fff;
  border-radius: 20px;
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
  overflow: hidden;
}
.admin-content {
  padding: 26px;
}
.admin-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
}
.secondary-button,
.danger-button {
  border: 1px solid #cbd6dc;
  background: #fff;
  border-radius: 10px;
  padding: 9px 12px;
  cursor: pointer;
  font-weight: 650;
}
.danger-button {
  border-color: #dfb4b4;
  color: #8e2f2f;
}
.admin-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 20px 0;
}
.admin-grid .field-group {
  margin: 0;
}
.admin-grid input,
.admin-grid select {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid #cfd8de;
  border-radius: 10px;
  background: #fff;
}
.admin-grid label {
  font-size: 12px;
  color: var(--muted);
  font-weight: 700;
  display: block;
  margin-bottom: 5px;
}
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  margin-top: 20px;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
th,
td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
th {
  background: var(--panel);
  color: #4d5b66;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
tr:last-child td {
  border-bottom: 0;
}
.status {
  display: inline-flex;
  padding: 4px 8px;
  border-radius: 999px;
  background: #edf1f3;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}
.status.accepted {
  background: #e1f2e8;
  color: #1f6844;
}
.status.pending {
  background: #fff4d7;
  color: #85600a;
}
.link-output {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  margin-top: 14px;
}
.link-output input {
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid #cfd8de;
  border-radius: 10px;
}
.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

@media (max-width: 700px) {
  .shell {
    width: min(100% - 18px, 860px);
    margin-top: 10px;
  }
  .card {
    border-radius: 16px;
  }
  .brand {
    padding: 16px 18px;
  }
  #guestForm {
    padding: 24px 18px 28px;
  }
  .rules-heading-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }
  .admin-grid {
    grid-template-columns: 1fr;
  }
  .admin-content {
    padding: 18px;
  }
}

.privacy-content {
  padding: 32px 36px 40px;
  line-height: 1.65;
}
.privacy-content h1 {
  margin-top: 0;
}
.privacy-content h2 {
  font-size: 17px;
  margin: 24px 0 6px;
}
.privacy-content p {
  margin: 0 0 12px;
}
.privacy-meta {
  color: var(--muted);
  font-size: 13px;
}
@media (max-width: 700px) {
  .privacy-content {
    padding: 24px 18px 28px;
  }
}
