:root {
  --page-padding-x: 20px;
  color: #24211f;
  background: #e6dfd4;
  font-family: "Cormorant Garamond", "Times New Roman", Times, serif;
}

* {
  box-sizing: border-box;
}

html {
  overflow-x: clip;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Site chrome / banners */
.site-banner {
  width: 100%;
  height: 36px;
  overflow: hidden;
  flex-shrink: 0;
  background-image: url("/assets/header_and_footer.png");
  background-repeat: repeat-x;
  background-position: left bottom;
  background-size: auto 24px;
}

.site-banner--header {
  transform: scaleY(-1);
}

.site-doodles {
  display: block;
  width: min(100%, 250px);
  margin: 0 auto;
  flex-shrink: 0;
}

/* Main card layout for standalone pages (travel, rsvp, login) */
main {
  width: min(100%, 760px);
  margin: 0 auto;
  padding: 48px var(--page-padding-x) 56px;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.card {
  width: 100%;
  max-width: 580px;
  margin: 0 auto;
  padding: 48px 36px;
  border-radius: 22px;
  background: rgba(255, 252, 248, 0.85);
  box-shadow: 0 18px 60px rgba(96, 70, 54, 0.12);
  text-align: center;
}

.card:has(.auth-form) {
  max-width: 520px;
}

.couple-title {
  margin: 0 0 8px;
  font-size: 1.1rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #706256;
  font-weight: 500;
}

h1 {
  margin: 0 0 16px;
  font-family: "Parisienne", "Brush Script MT", "Segoe Script", cursive;
  font-size: clamp(2.6rem, 7vw, 4rem);
  font-weight: 400;
  color: #24211f;
  line-height: 1.1;
}

.tagline {
  font-size: clamp(1.3rem, 4vw, 1.8rem);
  font-style: italic;
  color: #554a41;
  margin: 0 0 24px;
}

.divider {
  width: 60px;
  height: 1px;
  background: rgba(36, 33, 31, 0.2);
  margin: 20px auto 28px;
}

.message {
  font-size: 1.2rem;
  line-height: 1.6;
  color: #4a4038;
  margin: 0 0 32px;
  max-width: 440px;
  margin-left: auto;
  margin-right: auto;
}

/* Buttons */
.button-container {
  margin-bottom: 24px;
}

.submit-button,
.back-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 13px 28px;
  border: 1px solid #24211f;
  border-radius: 999px;
  background: #24211f;
  color: #fffaf4;
  text-decoration: none;
  font: inherit;
  font-size: 0.95rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease, opacity 160ms ease;
}

.submit-button:not(:disabled):hover,
.back-button:hover {
  background: transparent;
  color: #24211f;
}

.submit-button:disabled {
  cursor: not-allowed;
  opacity: 0.65;
}

.submit-button.is-loading {
  cursor: wait;
  opacity: 0.85;
}

.submit-button.is-loading::after {
  content: "";
  width: 0.9em;
  height: 0.9em;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}

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

/* Forms & Fields */
.auth-form {
  display: grid;
  gap: 20px;
  max-width: 360px;
  margin: 0 auto 28px;
}

.auth-form .submit-button {
  width: 100%;
}

.form-field {
  display: grid;
  gap: 8px;
  text-align: left;
}

.form-field label {
  font-size: 0.85rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #554a41;
}

.form-field input,
.form-field textarea {
  width: 100%;
  border: 1px solid rgba(28, 26, 24, 0.25);
  border-radius: 12px;
  background: #fffaf4;
  color: #24211f;
  font: inherit;
  font-size: 1.15rem;
  padding: 13px 16px;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.form-field input:focus,
.form-field textarea:focus {
  outline: none;
  border-color: #24211f;
  box-shadow: 0 0 0 3px rgba(36, 33, 31, 0.12);
}

.form-field input.has-error {
  border-color: #a83232;
  background: #fff7f7;
}

.form-field textarea {
  min-height: 120px;
  resize: vertical;
}

.form-field input:disabled,
.form-field textarea:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  background: rgba(255, 250, 244, 0.7);
}

.form-field input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: #24211f;
  cursor: pointer;
}

/* Feedback & Status */
.error-banner {
  display: none;
  padding: 10px 14px;
  border-radius: 8px;
  background: rgba(168, 50, 50, 0.08);
  border: 1px solid rgba(168, 50, 50, 0.25);
  color: #922222;
  font-size: 0.95rem;
  text-align: center;
}

.error-banner.visible {
  display: block;
}

.form-status {
  min-height: 1.5em;
  margin: 0;
  text-align: center;
  color: #3f3933;
  font-size: 0.92rem;
  line-height: 1.5;
}

.form-status.error {
  color: #8a2f25;
}

.form-status.success {
  color: #3c6644;
}

/* Links & Notes */
.links-container {
  margin-bottom: 20px;
}

.back-link {
  color: #554a41;
  text-decoration: none;
  font-size: 0.95rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-bottom: 1px solid transparent;
  transition: border-color 160ms ease, color 160ms ease;
}

.back-link:hover {
  color: #24211f;
  border-color: #24211f;
}

.contact-note {
  margin: 0;
  text-align: center;
  color: #5f5148;
  font-size: 0.95rem;
  line-height: 1.5;
}

.contact-note a {
  color: inherit;
  text-decoration: underline;
}

/* Responsive Rules */
@media (max-width: 736px) {
  :root {
    --page-padding-x: 14px;
  }

  main {
    padding-top: 32px;
    padding-bottom: 40px;
  }

  .card {
    padding: 36px 22px;
  }

  .message {
    font-size: 1.15rem;
  }

  .form-field label {
    font-size: 0.95rem;
  }

  .form-field input,
  .form-field textarea {
    font-size: 1.2rem;
    padding: 16px 18px;
  }

  .submit-button {
    font-size: 1.05rem;
  }

  .form-status,
  .contact-note {
    font-size: 1.05rem;
  }
}

@media (min-width: 737px) {
  .site-banner {
    height: 48px;
  }
}
