/* ============ Royal Hearts — digitalna pozivnica ============ */

:root {
  --bg: #f6f0ea;
  --panel: #f0ebe5;
  --field: #eee9e3;
  --ink: #222222;
  --muted: #5f5954;
  --wine: #7d2731;
  --wine-soft: rgba(125, 39, 49, 0.18);
  --line: #2b2724;
  --font-script: "Imperial Script", cursive;
  --font-serif: "Cormorant Garamond", Georgia, serif;
  --font-sans: "Montserrat", Arial, sans-serif;
  --font-number: "Jost", Arial, sans-serif;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  background: #ffffff;
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.page-wrapper {
  max-width: 430px;
  margin: 0 auto;
  background: var(--bg);
  min-height: 100vh;
  overflow-x: hidden;
  box-shadow: 0 0 40px rgba(34, 34, 34, 0.08);
}

/* ============ Hero ============ */

.hero-section {
  padding: 68px 0 62px;
  text-align: center;
}

.hero-kicker {
  font-size: 14px;
  letter-spacing: 0.38em;
  text-transform: uppercase;
  color: var(--ink);
  margin-bottom: 28px;
}

.hero-art {
  position: relative;
  width: min(378px, calc(100% - 52px));
  margin: 0 auto;
  aspect-ratio: 390 / 640;
}

.hero-photo {
  position: absolute;
  top: 5.5%;
  left: 8%;
  width: 84%;
  height: 78%;
  object-fit: cover;
  border-radius: 4px;
}

.hero-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.couple-names {
  font-family: var(--font-script);
  font-weight: 400;
  font-size: 58px;
  color: var(--wine);
  margin-top: 18px;
  line-height: 1.05;
  text-align: center;
}

.couple-names span {
  display: block;
}

.couple-names .couple-amp {
  font-size: 0.6em;
  line-height: 1.2;
}

.wedding-date {
  font-size: 15px;
  letter-spacing: 0.32em;
  color: var(--muted);
  margin-top: 10px;
}

.hero-lead {
  font-size: 14px;
  color: var(--ink);
  letter-spacing: 0.08em;
  margin-top: 6px;
  margin-bottom: 34px;
}

.hero-final-message {
  display: none;
  font-family: var(--font-script);
  font-size: 48px;
  color: var(--wine);
  margin: 18px 0 30px;
}

body.wedding-day .hero-final-message {
  display: block;
}

body.wedding-day .countdown {
  display: none;
}

/* ============ Countdown ============ */

.countdown {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin: 0 52px;
}

.time-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 102px;
  background: var(--panel);
  border-radius: 7px;
}

.time-box span {
  font-family: var(--font-number);
  font-size: 28px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1;
}

.time-box small {
  font-size: 8px;
  letter-spacing: 0.42em;
  text-indent: 0.42em;
  color: var(--wine);
  text-transform: uppercase;
}

/* ============ Raspored ============ */

.schedule-panel {
  padding: 38px 0 86px;
}

.schedule-panel h2,
.rsvp-panel h2 {
  font-family: var(--font-script);
  font-weight: 400;
  font-size: 72px;
  color: var(--wine);
  text-align: center;
  line-height: 1.15;
  margin-bottom: 26px;
}

.schedule-list {
  display: grid;
  gap: 6px;
}

.schedule-item {
  display: grid;
  align-items: center;
  gap: 16px;
  padding: 0 26px;
}

.event-right {
  grid-template-columns: 150px 1fr;
}

.event-left {
  grid-template-columns: 1fr 150px;
}

.event-right .event-copy {
  text-align: left;
}

.event-left .event-copy {
  text-align: right;
}

.event-illustration {
  width: 150px;
  height: 150px;
  object-fit: contain;
}

.event-copy h3 {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink);
}

.event-time {
  font-family: var(--font-number);
  font-size: 20px;
  font-weight: 500;
  color: var(--muted);
  margin-top: 2px;
}

.event-location {
  font-size: 13px;
  color: var(--ink);
  margin-top: 4px;
}

.map-link {
  display: inline-block;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  border-bottom: 1px solid var(--wine-soft);
  padding-bottom: 2px;
  margin-top: 8px;
  transition: color 0.25s ease, border-color 0.25s ease;
}

.map-link:hover {
  color: var(--wine);
  border-color: var(--wine);
}

.love-arrow {
  width: 250px;
  height: 100px;
  object-fit: contain;
  margin-left: 34px;
}

.arrow-flip-x {
  transform: scaleX(-1) rotate(8deg);
}

.arrow-rotate-left {
  transform: rotate(-14deg);
}

.arrow-mirror-x {
  transform: scaleX(-1);
}

.arrow-mirror-x.arrow-rotate-right {
  transform: scaleX(-1) rotate(-10deg);
}

/* ============ RSVP ============ */

.rsvp-panel {
  padding: 42px 19px;
}

.rsvp-lead {
  font-size: 14px;
  line-height: 2.15;
  text-align: center;
  margin-bottom: 30px;
}

.rsvp-lead b {
  color: var(--wine);
}

#rsvpForm {
  display: grid;
  gap: 6px;
}

.field-label {
  font-size: 14px;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--ink);
  margin-top: 18px;
}

#rsvpForm input[type="text"],
#rsvpForm select,
#rsvpForm textarea {
  width: 100%;
  height: 48px;
  background: transparent;
  border: none;
  border-bottom: 1.6px solid var(--line);
  border-radius: 0;
  font-family: var(--font-sans);
  font-size: 15px;
  color: var(--ink);
  outline: none;
  transition: border-color 0.25s ease;
}

#rsvpForm textarea {
  height: auto;
  min-height: 96px;
  padding-top: 12px;
  resize: vertical;
}

#rsvpForm input[type="text"]:focus,
#rsvpForm select:focus,
#rsvpForm textarea:focus {
  border-bottom-color: var(--wine);
}

#rsvpForm select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9'%3E%3Cpath d='M1 1l6 6 6-6' fill='none' stroke='%237d2731' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  cursor: pointer;
}

.attendance-options {
  margin-top: 8px;
}

.guest-options-row {
  display: flex;
  gap: 42px;
  margin-top: 14px;
}

.guest-options-row label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  letter-spacing: 0.1em;
  cursor: pointer;
}

.guest-options-row input[type="radio"] {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border: 1.6px solid var(--line);
  border-radius: 50%;
  display: grid;
  place-content: center;
  cursor: pointer;
}

.guest-options-row input[type="radio"]::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--wine);
  transform: scale(0);
  transition: transform 0.2s ease;
}

.guest-options-row input[type="radio"]:checked::before {
  transform: scale(1);
}

.guest-options {
  display: grid;
  gap: 6px;
}

.guest-options.hidden {
  display: none;
}

.guest-options-title {
  font-size: 14px;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  margin-top: 18px;
}

.rsvp-note {
  font-size: 12px;
  color: var(--muted);
  text-align: center;
  margin-top: 26px;
}

#submitBtn {
  height: 48px;
  margin-top: 6px;
  background: var(--wine);
  color: #fff8f4;
  border: none;
  border-radius: 4px;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.32em;
  text-indent: 0.32em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.25s ease, transform 0.15s ease;
}

#submitBtn:hover {
  background: #641f27;
}

#submitBtn:active {
  transform: scale(0.985);
}

#submitBtn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Poruke stanja forme */

#successMessage,
#expiredMessage,
#errorMessage,
#guestErrorMessage,
#sendErrorMessage {
  display: none;
  text-align: center;
  font-size: 14px;
  margin-top: 18px;
}

#successMessage {
  font-family: var(--font-serif);
  font-size: 22px;
  color: var(--wine);
}

#expiredMessage {
  color: var(--muted);
}

#errorMessage,
#guestErrorMessage,
#sendErrorMessage {
  color: var(--wine);
}

/* ============ Zavrsni citat ============ */

.closing-panel {
  padding: 30px 26px 76px;
  text-align: center;
}

.quote-frame p {
  font-family: var(--font-script);
  font-size: 43px;
  color: var(--wine);
  line-height: 1.3;
}

/* ============ Overlay / spinner ============ */

#overlay {
  position: fixed;
  inset: 0;
  background: rgba(246, 240, 234, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
}

.spinner {
  width: 44px;
  height: 44px;
  border: 3px solid var(--wine-soft);
  border-top-color: var(--wine);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* ============ Reveal animacije ============ */

.reveal,
.scale-reveal {
  opacity: 1;
}

.reveal-delay-1 { --reveal-delay: 90ms; }
.reveal-delay-2 { --reveal-delay: 180ms; }
.reveal-delay-3 { --reveal-delay: 270ms; }
.reveal-delay-4 { --reveal-delay: 360ms; }
.reveal-delay-5 { --reveal-delay: 450ms; }
.reveal-delay-6 { --reveal-delay: 540ms; }

body.reveal-ready .reveal,
body.reveal-ready .scale-reveal {
  opacity: 0;
  transition: opacity 760ms ease, transform 760ms cubic-bezier(0.22, 1, 0.36, 1),
    filter 760ms ease;
  transition-delay: var(--reveal-delay, 0ms);
  will-change: opacity, transform;
}

body.reveal-ready .reveal {
  transform: translate3d(0, 18px, 0);
}

body.reveal-ready .scale-reveal {
  transform: scale(0.96);
  transform-origin: center center;
}

body.reveal-ready .hero-art.scale-reveal {
  filter: blur(1px);
  transform: translate3d(0, 20px, 0) scale(0.94);
}

body.reveal-ready .reveal.visible,
body.reveal-ready .scale-reveal.visible {
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1);
  filter: none;
}

@media (prefers-reduced-motion: reduce) {
  body.reveal-ready .reveal,
  body.reveal-ready .scale-reveal {
    opacity: 1;
    transform: none;
    filter: none;
    transition: none;
  }
}

/* ============ Sitni ekrani ============ */

@media (max-width: 360px) {
  .countdown {
    margin: 0 26px;
  }

  .event-right {
    grid-template-columns: 120px 1fr;
  }

  .event-left {
    grid-template-columns: 1fr 120px;
  }

  .event-illustration {
    width: 120px;
    height: 120px;
  }

  .couple-names {
    font-size: 48px;
  }

  .schedule-panel h2,
  .rsvp-panel h2 {
    font-size: 58px;
  }
}
