@import url('https://fonts.googleapis.com/css2?family=New+Rocker&family=Playfair+Display:ital,wght@0,400;0,700;1,400&family=Cormorant+Garamond:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400&display=swap');

:root {
  --bg: #f7f1ea;
  --card: #fffaf6;
  --text: #243047;
  --muted: #5f6674;
  --accent: #5f2390;
  --accent-dark: #4a1970;
  --line: #d8b8a4;
  --soft: #f2ece8;
  --tile-blue: #3d6a8e;
  --tile-rust: #c4603a;
  --tile-gold: #c9a24d;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
}

/* ── Screens ── */

.screen {
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 20px;
}

.form-screen {
  padding: 20px 16px;
}

/* Elegant tile border using CSS pattern instead of zoomed background image */
.border-screen {
  background:
    /* Outer warm wash */
    radial-gradient(ellipse at 30% 20%, rgba(196, 96, 58, 0.08) 0%, transparent 60%),
    radial-gradient(ellipse at 70% 80%, rgba(61, 106, 142, 0.08) 0%, transparent 60%),
    var(--bg);
  position: relative;
}

.border-screen::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  /* Decorative border frame using box-shadow insets */
  border: 12px solid transparent;
  border-image: repeating-linear-gradient(
    45deg,
    var(--tile-blue) 0px,
    var(--tile-blue) 4px,
    transparent 4px,
    transparent 8px,
    var(--tile-rust) 8px,
    var(--tile-rust) 12px,
    transparent 12px,
    transparent 16px,
    var(--tile-gold) 16px,
    var(--tile-gold) 20px,
    transparent 20px,
    transparent 24px
  ) 12;
  opacity: 0.35;
}

.border-screen::after {
  content: "";
  position: fixed;
  inset: 14px;
  pointer-events: none;
  z-index: 0;
  border: 2px solid var(--line);
  border-radius: 8px;
  opacity: 0.5;
}

.border-screen > * {
  position: relative;
  z-index: 1;
}

/* ── Cards ── */

.card {
  width: min(100%, 420px);
  background: var(--card);
  border-radius: 28px;
  padding: 18px 18px 22px;
  position: relative;
  box-shadow: 0 12px 40px rgba(36, 48, 71, 0.08);
}

.framed::before {
  content: "";
  position: absolute;
  inset: 10px;
  border: 2px solid var(--line);
  border-radius: 22px;
  pointer-events: none;
}

.intro-card, .compact-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

/* ── Intro page ── */

.hero {
  width: 93%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: 22px;
  margin-bottom: 12px;
}

.names {
  font-family: 'Playfair Display', Georgia, 'Times New Roman', serif;
  font-style: italic;
  font-size: 2.4rem;
  font-weight: 400;
  margin-top: 2px;
  margin-bottom: 10px;
  letter-spacing: 0.01em;
}

.date-block {
  text-align: center;
  padding: 0 8px;
}

.date-save {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  font-size: 1rem;
  font-weight: 400;
  color: var(--text);
  margin: 0 0 10px;
  line-height: 1.45;
}

.date-location {
  font-family: 'New Rocker', Georgia, serif;
  font-size: 1.45rem;
  font-weight: 400;
  color: #7a3cb8;
  margin: 0 0 4px;
  line-height: 1.25;
}

.date-details {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  font-size: 0.95rem;
  font-weight: 400;
  color: var(--muted);
  margin: 12px 0 12px;
  line-height: 1.55;
}

/* ── Buttons ── */

.button {
  display: inline-flex;
  width: 100%;
  justify-content: center;
  align-items: center;
  text-decoration: none;
  border: 0;
  border-radius: 14px;
  min-height: 42px;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: background 0.2s ease;
}

.button.primary {
  background: var(--accent);
  color: white;
}

.button.primary:hover {
  background: var(--accent-dark);
}

/* ── Form page ── */

.mini-date {
  color: var(--muted);
  font-size: 0.95rem;
  margin-bottom: 6px;
}

.form-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.8rem;
  font-weight: 700;
  margin: 0 0 14px;
}

h1 {
  font-size: 2rem;
  line-height: 1.08;
  margin: 0 0 8px;
}

.form-shell {
  background: transparent;
  box-shadow: none;
  padding: 0;
  width: min(100%, 460px);
}

.form-panel {
  width: 100%;
  background: rgba(255, 250, 246, 0.96);
  border-radius: 24px;
  padding: 22px 18px;
  box-shadow: 0 12px 40px rgba(36, 48, 71, 0.10);
}

.contact-form {
  width: 100%;
}

.grid {
  display: grid;
  gap: 10px;
}

.two-up {
  grid-template-columns: 1fr 1fr;
  margin-bottom: 12px;
}

.city-row {
  grid-template-columns: 1fr 1fr;
}

.address-group {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}

.guest-group {
  margin-bottom: 12px;
}

.rsvp-group {
  margin-bottom: 16px;
}

.rsvp-label {
  display: block;
  font-size: 0.88rem;
  color: var(--muted);
  margin-bottom: 6px;
  line-height: 1.4;
}

.rsvp-select {
  width: 100%;
  min-height: 48px;
  border-radius: 12px;
  border: 1px solid #d9d4cf;
  padding: 0 14px;
  font-size: 0.98rem;
  background: white;
  font-family: inherit;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%235f6674' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  cursor: pointer;
}

.rsvp-select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(95, 35, 144, 0.1);
}

input {
  width: 100%;
  min-height: 48px;
  border-radius: 12px;
  border: 1px solid #d9d4cf;
  padding: 0 14px;
  font-size: 0.98rem;
  background: white;
  font-family: inherit;
}

input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(95, 35, 144, 0.1);
}

/* ── Thank you ── */

.thankyou-card {
  min-height: 240px;
  justify-content: center;
}

.thankyou-card h1 {
  font-family: 'Playfair Display', Georgia, serif;
}

/* ── Responsive ── */

@media (max-width: 480px) {
  .screen {
    padding: 6px 10px 10px;
    padding-top: max(6px, env(safe-area-inset-top));
  }
  .form-screen {
    padding: 6px 10px 10px;
    padding-top: max(6px, env(safe-area-inset-top));
  }
  .card { width: 100%; padding: 12px 12px 16px; }
  .framed::before { inset: 7px; }
  .hero { aspect-ratio: 4 / 5; }
  h1 { font-size: 1.8rem; }
  .date-location { font-size: 1.3rem; }
  .form-shell { padding: 0; }
  .form-panel { padding: 18px 14px; }
  .border-screen::before { border-width: 8px; }
  .border-screen::after { inset: 10px; }
}
