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

/* ══ POZADINA NA html – iOS Safari fix ══ */
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  color-scheme: only light;
  background: url("Pozivnica.png") center center / cover no-repeat fixed;
  margin: 0;
  padding: 0;
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  padding: 0;
  background: transparent;
  font-family: "Cormorant Garamond", Georgia, serif;
  color: #111;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  /* Scroll JE dopušten, ali sadržaj je kompaktan */
  overflow-x: hidden;
}

/* ══════════════════════════════════════════════════
   SPLASH / Vrata
   ══════════════════════════════════════════════════ */
.splash {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  background: transparent;
  perspective: 1200px;
  transform-style: preserve-3d;
}

.doorImage {
  width: 50%;
  height: 100%;
  object-fit: inherit;
  transform-origin: left top;
  transition: all 2s ease-in-out;
  position: fixed;
  top: 0;
  left: 0;
}

.doorImageLEFT {
  transform-origin: left top;
  z-index: 2;
}

.doorImageRIGHT {
  transform-origin: right top;
  left: 50%;
  z-index: 1;
}

.doorOpenR {
  transform: perspective(1200px) translateZ(0px) translateX(0px) translateY(0px) rotateY(105deg);
}

.doorOpenL {
  transform: perspective(1200px) translateZ(0px) translateX(0px) translateY(0px) rotateY(-105deg);
}

/* desktop smjer */
.doorOpenL {
  transform: rotateY(-105deg);
}

.doorOpenR {
  transform: rotateY(105deg);
}

/* mobitel: manji kut za ljepši efekt */
@media (max-width: 600px) {
  .doorOpenL {
    transform: rotateY(-85deg) !important;
  }
  .doorOpenR {
    transform: rotateY(85deg) !important;
  }
}

/* ══ WRAPPER ══ */
.form-container {
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  /* Vertikalno centriranje: min 100dvh, ali može rasti */
  min-height: 100dvh;
  justify-content: center;
  padding: 24px 16px;

  opacity: 0;
  visibility: hidden;
  transition: opacity 0.7s ease;
  pointer-events: none;
}

body.opened .form-container {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* ══ KARTICA ══ */
.content {
  width: min(96vw, 560px);
  display: flex;
  flex-direction: column;
}

/* ══ TEKST POZIVNICE ══ */
.invitation-text { text-align: center; }

.invitation-text p {
  margin: 0 0 0.5em;
  font-weight: 600;
  color: #0a0a0a;
  line-height: 1.6;
  text-shadow:
    0 1px 0 rgba(255,255,255,0.8),
    0 -1px 0 rgba(255,255,255,0.8),
    1px 0 0 rgba(255,255,255,0.8),
    -1px 0 0 rgba(255,255,255,0.8),
    0 2px 8px rgba(0,0,0,0.15);
}

.invitation-text strong { color: #000; font-weight: 700; }

/* ══ RSVP ══ */
.rsvp {
  text-align: center;
  margin-top: 0.6rem;
}

.rsvp h2 {
  font-family: "Great Vibes", cursive;
  font-weight: 400;
  color: #0a0a0a;
  margin: 0 0 0.5rem;
  text-shadow:
    0 1px 0 rgba(255,255,255,0.8),
    0 -1px 0 rgba(255,255,255,0.8),
    1px 0 0 rgba(255,255,255,0.8),
    -1px 0 0 rgba(255,255,255,0.8),
    0 2px 8px rgba(0,0,0,0.15);
}

form {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  text-align: left;
}

label {
  font-weight: 700;
  color: #0a0a0a;
  display: flex;
  flex-direction: column;
  gap: 3px;
  text-shadow:
    0 1px 0 rgba(255,255,255,0.8),
    0 -1px 0 rgba(255,255,255,0.8),
    1px 0 0 rgba(255,255,255,0.8),
    -1px 0 0 rgba(255,255,255,0.8);
}

input, textarea {
  width: 100%;
  border-radius: 12px;
  border: 1.5px solid rgba(40,40,40,0.25);
  background: rgba(255,255,255,0.6);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  font-family: "Cormorant Garamond", Georgia, serif;
  color: #111;
  box-shadow: 0 4px 14px rgba(0,0,0,0.1);
  -webkit-appearance: none;
  appearance: none;
}

input:focus, textarea:focus {
  outline: none;
  border-color: rgba(34,68,62,0.55);
}

textarea { resize: none; }

button[type="submit"] {
  align-self: stretch;
  border-radius: 999px;
  border: none;
  background: rgba(34,68,62,0.92);
  color: #fff;
  font-weight: 700;
  letter-spacing: 0.4px;
  cursor: pointer;
  font-family: "Cormorant Garamond", Georgia, serif;
  box-shadow: 0 10px 24px rgba(0,0,0,0.18);
  -webkit-appearance: none;
  appearance: none;
}

button[type="submit"]:active { background: rgba(34,68,62,1); }
button:disabled { opacity: 0.6; cursor: not-allowed; }

.status-msg {
  margin-top: 0.5rem;
  padding: 0.7rem 1rem;
  border-radius: 10px;
  text-align: center;
  display: none;
}
.status-msg.success {
  background: rgba(34,68,62,0.12);
  color: rgba(34,68,62,1);
  border: 1px solid rgba(34,68,62,0.3);
}
.status-msg.error {
  background: rgba(180,40,40,0.1);
  color: rgba(160,30,30,1);
  border: 1px solid rgba(180,40,40,0.3);
}

/* ══════════════════════════════════════════════════
   DESKTOP (≥ 601px)
   ══════════════════════════════════════════════════ */
@media (min-width: 601px) {
  .invitation-text p    { font-size: clamp(17px, 2vw, 21px); }
  .rsvp h2              { font-size: clamp(2.4rem, 5vw, 3.2rem); }
  label                 { font-size: clamp(15px, 1.6vw, 18px); }
  input, textarea       { font-size: 17px; padding: 0.75rem 1rem; }
  textarea              { min-height: 90px; }
  button[type="submit"] { font-size: 1.1rem; padding: 0.9rem 1.2rem; margin-top: 0.3rem; }
  .status-msg           { font-size: 1rem; }
}

/* ══════════════════════════════════════════════════
   MOBITEL PORTRAIT  ≤ 600px
   Cilj: sve vidljivo uz minimalni scroll
   iPhone 15 Pro: 393 × 852 pt  (stvarni ekran)
   Samsung S25 Ultra: 384 × 820 pt
   ══════════════════════════════════════════════════ */
@media (max-width: 600px) {

  .form-container {
    padding: 20px 14px 28px;
    justify-content: flex-start;   /* sadržaj krenuti od vrha, ne centra */
    padding-top: max(20px, env(safe-area-inset-top, 20px));
  }

  .invitation-text p {
    font-size: 19px;
    line-height: 1.55;
    margin-bottom: 0.35em;
  }

  .rsvp          { margin-top: 0.5rem; }
  .rsvp h2       { font-size: 2.4rem; margin-bottom: 0.4rem; }

  label          { font-size: 16px; gap: 2px; }
  input, textarea { font-size: 16px; padding: 0.6rem 0.85rem; }
  textarea       { min-height: 64px; }

  form           { gap: 0.5rem; }

  button[type="submit"] {
    font-size: 1.05rem;
    padding: 0.8rem 1rem;
    margin-top: 0.25rem;
  }

  .status-msg { font-size: 0.9rem; }
}

/* ══════════════════════════════════════════════════
   JAKO KRATKI EKRANI  (visina < 700px, npr. iPhone SE)
   ══════════════════════════════════════════════════ */
@media (max-width: 600px) and (max-height: 700px) {
  .invitation-text p    { font-size: 16px; line-height: 1.45; margin-bottom: 0.25em; }
  .rsvp h2              { font-size: 2rem; }
  label                 { font-size: 14px; }
  input, textarea       { font-size: 16px; padding: 0.5rem 0.75rem; }
  textarea              { min-height: 52px; }
  button[type="submit"] { font-size: 0.95rem; padding: 0.7rem 1rem; }
  form                  { gap: 0.35rem; }
  .rsvp                 { margin-top: 0.3rem; }
}