* {
  box-sizing: border-box;
}

.page-loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  background: rgba(10, 14, 22, 0.62);
  backdrop-filter: blur(4px);
  transition: opacity 0.35s ease, visibility 0.35s ease;
}

.page-loader.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loader-card {
  width: min(280px, calc(100% - 40px));
  border: 1px solid #cfd7e4;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 12px 28px rgba(17, 31, 60, 0.22);
  padding: 18px 16px 14px;
  text-align: center;
}

.loader-emblem {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  margin: 0 auto 10px;
  border: 4px solid #dce4f3;
  border-top-color: #244a96;
  animation: spin-loader 0.8s linear infinite;
}

.loader-card p {
  margin: 0;
  color: #20242b;
  font-weight: 700;
  letter-spacing: 0.2px;
}

@keyframes spin-loader {
  to {
    transform: rotate(360deg);
  }
}

body {
  margin: 0;
  font-family: "Roboto", sans-serif;
  color: #1f2430;
  min-height: 100vh;
  position: relative;
  background: none;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    linear-gradient(rgba(0, 0, 0, 0.14), rgba(0, 0, 0, 0.14)),
    url("./site-bg.png")
      center / cover no-repeat fixed;
  filter: blur(10px);
  transform: scale(1.03);
  z-index: -1;
  pointer-events: none;
}

.container {
  width: min(1120px, calc(100% - 48px));
  margin-inline: auto;
}

.top-header {
  position: relative;
  overflow: hidden;
  border-top: none;
  border-bottom: none;
  background: #000;
}

.header-bg-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  z-index: 0;
  pointer-events: none;
}

.top-header::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 58%;
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0) 0%,
    rgba(0, 0, 0, 0.45) 45%,
    rgba(0, 0, 0, 0.78) 100%
  );
  z-index: 1;
  pointer-events: none;
}

.header-content {
  position: relative;
  z-index: 2;
}

.header-row {
  min-height: auto;
  padding: 10px 0 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.header-logos {
  display: flex;
  align-items: center;
  gap: 6px;
}

.logo-item {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: #fff;
  font-size: 20px;
  font-weight: 500;
  text-decoration: none;
  max-width: 420px;
  line-height: 1.15;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.65);
}

.logo-image {
  height: 84px;
  width: auto;
  max-width: 130px;
  object-fit: contain;
  flex-shrink: 0;
  display: block;
}

.nav-row {
  min-height: auto;
  padding: 10px 0 14px;
  display: flex;
  align-items: center;
  gap: 44px;
  position: relative;
}

.nav-row a {
  text-decoration: none;
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.65);
}

.main-grid {
  display: grid;
  grid-template-columns: 320px 410px;
  justify-content: center;
  align-items: start;
  gap: 24px;
  width: fit-content;
  margin: 42px auto 56px;
}

.memorial-card {
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid #cfd7e4;
  border-radius: 10px;
  box-shadow: 0 12px 28px rgba(17, 31, 60, 0.18);
  overflow: hidden;
}

.memorial-media {
  position: relative;
  overflow: hidden;
}

.memorial-card #memorial-photo {
  width: 100%;
  display: block;
  object-fit: cover;
  aspect-ratio: 3 / 4;
  filter: grayscale(100%) contrast(1.03);
}

.memorial-top-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  transform: none;
  width: min(43%, 150px);
  height: auto;
  pointer-events: none;
}

.memorial-caption {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 10px;
  z-index: 2;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(242, 246, 253, 0.96));
  border: 1px solid #cfd7e4;
  border-radius: 8px;
  padding: 10px 10px 9px;
  box-shadow: 0 8px 16px rgba(17, 31, 60, 0.16);
}

.memorial-caption-label {
  margin: 0;
  color: #244a96;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.2px;
}

.memorial-caption-name {
  margin: 4px 0 0;
  color: #20242b;
  font-weight: 700;
  font-size: clamp(14px, 2.3vw, 24px);
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.memorial-ribbon {
  position: absolute;
  right: -58px;
  bottom: 34px;
  z-index: 1;
  width: 250px;
  height: 30px;
  background: #0e0e10;
  transform: rotate(-45deg);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.35);
  pointer-events: none;
}

.form-wrap {
  margin: 0;
  width: 410px;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid #cfd7e4;
  border-radius: 10px;
  padding: 24px 24px;
  box-shadow: 0 12px 28px rgba(17, 31, 60, 0.18);
}

.form-wrap h1,
.form-title {
  margin: 0 0 20px;
  color: #20242b;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.form-title-main {
  font-size: 27px;
  font-weight: 700;
  text-transform: uppercase;
  line-height: 1.15;
}

.form-title-sub {
  font-size: 18px;
  font-weight: 700;
  text-transform: uppercase;
  line-height: 1.2;
  letter-spacing: 0.2px;
}

.invite-form {
  display: grid;
  gap: 14px;
}

.field span {
  display: block;
  margin-bottom: 6px;
  color: #494f58;
  font-size: 14px;
  font-weight: 700;
}

.field input,
.field select {
  width: 100%;
  height: 43px;
  border: 1px solid #c5cede;
  border-radius: 6px;
  padding: 0 12px;
  font-size: 15px;
  color: #1f2430;
  background: #fff;
}

.field input:focus,
.field select:focus {
  outline: 0;
  border-color: #2f5fb0;
  box-shadow: 0 0 0 2px rgba(47, 95, 176, 0.14);
}

.field.is-invalid > span:first-child,
.guest-block.is-invalid legend {
  color: #c53030;
}

.field.is-invalid input,
.field.is-invalid select,
.guest-block.is-invalid input,
.guest-block.is-invalid select {
  border-color: #c53030;
  background: #fff5f5;
  box-shadow: 0 0 0 2px rgba(197, 48, 48, 0.14);
}

.field-error {
  display: block;
  margin-top: 6px;
  color: #c53030;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
}

.invite-form button {
  margin-top: 6px;
  height: 43px;
  border: 0;
  border-radius: 6px;
  background: linear-gradient(180deg, #2f60b2 0%, #244a96 100%);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}

.invite-form .secondary-btn {
  background: #eef3fb;
  color: #244a96;
  border: 1px solid #c5d2ea;
}

.invite-form .secondary-btn:disabled {
  background: #f2f2f2;
  color: #8c8f96;
  border-color: #d7d9de;
  cursor: not-allowed;
}

.guest-block {
  margin: 2px 0 0;
  padding: 10px 10px 6px;
  border: 1px dashed #c7d0df;
  border-radius: 8px;
  background: rgba(247, 250, 255, 0.9);
}

.guest-block-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.guest-block legend {
  padding: 0;
  font-size: 13px;
  font-weight: 700;
  color: #244a96;
}

.remove-guest-btn {
  border: 1px solid #d7a0a0;
  background: #fff5f5;
  color: #9b2c2c;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.form-status {
  min-height: 20px;
  margin: 2px 0 0;
  font-size: 14px;
  color: #2f5fb0;
}

.ceremony-info {
  margin: 0 auto 28px;
  padding: 18px 20px;
  border: 1px solid #d3dbe9;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 8px 20px rgba(17, 31, 60, 0.12);
}

.ceremony-info h2 {
  margin: 0 0 12px;
  font-size: 22px;
  color: #20242b;
}

.ceremony-info p {
  margin: 0 0 10px;
  font-size: 15px;
  line-height: 1.45;
  color: #2a2f36;
}

.site-footer {
  margin-top: 26px;
  background: linear-gradient(120deg, rgba(17, 22, 33, 0.94), rgba(26, 33, 47, 0.94));
  color: #fff;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr 1fr;
  gap: 26px;
  padding: 24px 0;
}

.footer-col h3 {
  margin: 0 0 10px;
  font-size: 15px;
  text-transform: uppercase;
  font-weight: 700;
  color: #dde6f8;
}

.footer-col a {
  display: block;
  margin-bottom: 8px;
  color: #ffffff;
  text-decoration: none;
  font-size: 14px;
  line-height: 1.3;
}

.footer-col a:hover {
  text-decoration: underline;
}

.footer-brand-link {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.footer-brand-link img {
  width: 42px;
  height: 42px;
  object-fit: contain;
}

.footer-brand-link span {
  max-width: 190px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
}

.footer-brand p {
  margin: 0 0 8px;
  color: #c5cfdf;
  font-size: 13px;
  line-height: 1.4;
}

.footer-social {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
}

.footer-social a {
  margin: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.5);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
}

@media (prefers-reduced-motion: reduce) {
  .header-bg-video {
    display: none;
  }

  .top-header {
    background: rgba(255, 255, 255, 0.92);
  }

  .top-header::after {
    display: none;
  }

  .logo-item,
  .nav-row a {
    color: #494f58;
    text-shadow: none;
  }
}

@media (max-width: 800px) {
  .container {
    width: calc(100% - 24px);
  }

  .header-row {
    padding: 12px 0;
    align-items: flex-start;
    flex-direction: column;
  }

  .header-logos {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .nav-row {
    min-height: auto;
    padding: 12px 0 14px;
    flex-wrap: wrap;
    gap: 14px;
  }

  .main-grid {
    grid-template-columns: 1fr;
    width: 100%;
    justify-content: stretch;
    gap: 14px;
    margin-top: 26px;
  }

  .form-wrap {
    width: 100%;
    margin: 0;
    padding: 20px 16px;
  }

  .memorial-card #memorial-photo {
    aspect-ratio: 16 / 10;
  }

  .memorial-top-badge {
    width: min(72%, 240px);
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 18px 0;
  }
}
