/* =====================================================================
   POZIVNICA: Melisa i Veljko  (tema Green Garden)
   Dizajn je jedna velika slika (dizajn.webp). Preko nje su providne
   zone za klik (mape, kalendar) i brojevi tajmera, postavljeni u %
   u odnosu na sliku, pa rade na svakoj širini ekrana.
   Ako zamijeniš dizajn.webp slikom ISTIH PROPORCIJA, ništa se ne pomjera.
   ===================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Source+Serif+4:ital,opsz,wght@0,8..60,400;0,8..60,600;0,8..60,700;1,8..60,400&family=Cormorant+Garamond:wght@500;600&display=swap');

::-webkit-scrollbar { display: none; }

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Source Serif 4', Georgia, serif;
    touch-action: pan-x pan-y;
}

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

:root {
    --naslov-color: #6b7355;          /* maslinasta iz dizajna */
    --zelena-tamna: #5f684a;
    --zelena-svijetla: #7f8767;
    --papir: #fdfdfb;                 /* boja papira ispod zelene (isto kao na slici) */
    --tekst: #3a3a37;
}

body {
    overflow-y: scroll;
    scrollbar-width: thin;
    scrollbar-color: transparent transparent;
    background-color: rgba(255, 255, 255, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    touch-action: pan-y;
}

 /* BLOKADA SKROLA DOK JE KOVERTA TU */
html.locked, html.locked body { overflow: hidden; height: 100%; }

/* ---------- KOVERTA (Green Garden, prevlačenje) ---------- */
.kv-open{display:none;position:fixed;inset:0;z-index:100001;-webkit-tap-highlight-color:transparent}
.js .kv-open{display:block}
.kv-open *{box-sizing:border-box;margin:0;padding:0}
#kvStage{position:absolute;left:50%;top:0;width:min(100vw,450px);height:100vh;height:100svh;transform:translateX(-50%);overflow:hidden;opacity:0;background:transparent}
#kvStage.ready{opacity:1}
#kvEnv{position:absolute;inset:0;overflow:hidden}
#kvCanvas{position:absolute;left:50%;top:50%;width:941px;height:1672px;transform-origin:50% 50%;perspective:2600px;perspective-origin:50% 0}
.kv-full{position:absolute;left:0;top:0;width:941px;height:1672px;display:block;pointer-events:none;user-select:none;-webkit-user-drag:none}
#kvFlap,#kvPocketGroup,#kvSeal{will-change:transform}
#kvFlap .kv-face > img{height:967px}
#kvPocket{height:1668px;top:4px}
#kvFlap{transform-origin:50% 0;transform-style:preserve-3d}
.kv-face{position:absolute;inset:0;backface-visibility:hidden;-webkit-backface-visibility:hidden}
#kvFlapBack{transform:rotateX(180deg)}
#kvFlapBack img{transform:scaleY(-1);transform-origin:50% 836px}
#kvLabelClip{position:absolute;left:197px;top:1292px;width:622px;height:130px;overflow:hidden;pointer-events:none;will-change:transform}
#kvLabel{position:absolute;left:-44px;top:0;width:702px;height:130px;will-change:transform;display:flex;align-items:center;justify-content:center;font-family:'Cormorant Garamond',Georgia,serif;font-size:38px;font-weight:500;letter-spacing:.12em;padding-left:.12em;white-space:nowrap;color:#f0f0ec;pointer-events:none;text-shadow:0 1px 2px rgba(0,0,0,.35)}
#kvKnob{position:absolute;pointer-events:auto;left:128px;top:1288px;width:138px;height:138px;touch-action:none;cursor:grab;outline:none;border-radius:50%}
#kvKnob img{width:100%;height:100%;display:block;pointer-events:none;-webkit-user-drag:none}
#kvKnob:active{cursor:grabbing}
#kvKnob:focus-visible{outline:4px solid #fff;outline-offset:4px}
#kvSeal{position:absolute;left:347.6px;top:739px;width:243.4px;height:244.3px;pointer-events:none}

/* lišće koje pada preko pozivnice kad se koverta otvori */
#leaves{position:absolute;left:0;top:0;width:100%;height:100svh;pointer-events:none;overflow:hidden;z-index:50}
.leaf{position:absolute;top:0;left:0;will-change:transform,opacity}
@media (prefers-reduced-motion: reduce){ #leaves{display:none} }

/* ---------- OKVIR POZIVNICE ---------- */
.phone-container {
    position: relative;
    width: 100vw;
    max-width: 450px;
    background-color: white;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

/* ---------- DIZAJN (slika) + zone za klik ---------- */
.section-1 { position: relative; width: 100%; overflow: hidden; }
.section-1 > img { width: 100%; height: auto; display: block; }

.hot {                       /* providna zona za klik preko dugmeta na slici */
    position: absolute;
    border-radius: 40px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    outline: none;
    -webkit-touch-callout: none;
}
.hot:active { background: rgba(255, 255, 255, 0.18); }

/* ---------- TAJMER: brojevi preko praznih kutija na slici ---------- */
.tm {
    position: absolute;
    transform: translate(-50%, -50%);
    color: #fff;
    font-weight: 600;
    font-size: min(7.4vw, 33px);
    line-height: 1;
    font-variant-numeric: tabular-nums;
    text-shadow: 0 1px 3px rgba(40, 46, 28, 0.35);
    pointer-events: none;
    white-space: nowrap;
}
.tl{position:absolute;transform:translate(-50%,-50%);color:rgba(255,255,255,.92);font-size:min(3.3vw,14px);letter-spacing:.04em;pointer-events:none;font-weight:400}
.tm.dugo { font-size: min(6vw, 27px); }   /* tri cifre (dana) */

/* ---------- KALENDAR MENI ---------- */
.calendar-options {
    display: none;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 250px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    z-index: 9999;
    border: 1px solid #ddd;
    overflow: hidden;
}
.calendar-options.show-menu { display: block; }
.calendar-options a {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    text-decoration: none;
    color: #333;
    font-size: 15px;
    border-bottom: 1px solid #eee;
    -webkit-tap-highlight-color: transparent;
}
.calendar-options a:last-child { border-bottom: 0; }
.calendar-options a img { width: 20px; height: auto; margin-right: 12px; }

/* ---------- MUZIKA ---------- */
#mute-kontrola {
    position: fixed;
    bottom: 40px;
    left: max(15px, calc(50vw - 215px));
    width: 45px;
    height: 45px;
    background: linear-gradient(180deg, var(--zelena-svijetla), var(--zelena-tamna));
    border: 1.5px solid rgba(255,255,255,.55);
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100000;
    box-shadow: 0 4px 10px rgba(40,46,28,0.3);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
#mute-kontrola svg { display: block; width: 22px; height: 22px; }

/* ---------- RSVP ---------- */
.rsvp-wrapper {
    width: 100%;
    position: relative;
    overflow-x: clip;
    overflow-y: visible;
}

/* cvijeće gore: spušta se preko prelaza iz slike u zelenu */
.header-floral-box {
    position: relative;
    z-index: 1000;
    width: 100%;
    margin: -150px auto -120px auto;
    line-height: 0;
    pointer-events: none;
}
.header-floral-box img, .footer-floral-box img { width: 100%; height: auto; display: block; }

/* zelena pozadina: isječak slike koji se ponavlja bez šava, pa raste koliko treba
   (više gostiju = duža lista = duža zelena, bez razvlačenja slike) */
.section-rsvp {
    position: relative;
    z-index: 5;
    width: 100%;
    display: flex;
    justify-content: center;
    margin: -1px 0;
    background: #5f6740 url('zelena-pozadina.webp') top center / 100% auto repeat-y;
}
.rsvp-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 110px 30px 150px;
    text-align: center;
}
.rsvp-content { width: 100%; max-width: 350px; text-align: center; }

.rsvp-naslov {
    color: #fff;
    font-weight: 600;
    font-size: clamp(36px, 11vw, 50px);
    letter-spacing: 1px;
    line-height: 1.12;
    margin-bottom: 26px;
}
.rsvp-naslov-italic { font-style: italic; font-weight: 400; }
.rsvp-opis {
    color: #fff;
    font-size: 19px;
    line-height: 1.55;
    font-weight: 400;
    margin-bottom: 44px;
}
.datum-istaknuto { font-weight: 700; display: inline-block; margin-top: 6px; }

.input-group { margin: 0 auto 20px; width: 100%; max-width: 300px; }
.input-group input {
    width: 100%;
    background: #fff;
    border: 1.5px solid #fff;
    border-radius: 12px;
    color: var(--naslov-color);
    text-align: center;
    padding: 12px 14px;
    outline: none;
    font-size: 16px;
    -webkit-appearance: none;
    appearance: none;
    transition: border-color .2s ease, box-shadow .2s ease;
}
.input-group input:focus { border-color: #cfd3bd; box-shadow: 0 0 0 3px rgba(255,255,255,.35); }
.input-group input::placeholder { color: var(--naslov-color); opacity: .75; text-align: center; }

.companion-hint { color: rgba(255,255,255,.92); font-size: 15px; line-height: 1.45; margin-bottom: 4px; }
.companion-add-row { display: flex; gap: 8px; max-width: 300px; margin: 16px auto 0; }
.companion-add-row input {
    flex: 1; min-width: 0;
    background: #fff; border: 1.5px solid #fff; border-radius: 12px;
    color: var(--naslov-color); text-align: center;
    padding: 12px 10px; outline: none; font-size: 16px;
    -webkit-appearance: none; appearance: none;
}
.companion-add-row input::placeholder { color: var(--naslov-color); opacity: .75; }
.companion-add-row button {
    flex: none; width: 92px;
    background: transparent; color: #fff;
    border: 1.5px solid #fff; border-radius: 12px;
    font-size: 16px; font-weight: 600; cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.companion-add-row button:active { background: rgba(255,255,255,.18); }
.companion-list { list-style: none; max-width: 300px; margin: 12px auto 0; text-align: left; }
.companion-list li {
    color: #fff; font-size: 17px; padding: 9px 4px;
    border-bottom: 1px solid rgba(255,255,255,.28);
    display: flex; justify-content: space-between; align-items: center; gap: 10px;
}
.companion-list li button {
    background: none; border: 0; color: #fff; font-size: 22px; line-height: 1;
    cursor: pointer; padding: 0 6px;
}

.potvrda-group { margin: 26px 0 8px; }
.potvrda-group p { color: #fff; font-size: 18px; margin-bottom: 18px; }
.radio-options { display: flex; justify-content: center; gap: 40px; }
.radio-label {
    display: flex; align-items: center; cursor: pointer; color: #fff; font-size: 20px;
    -webkit-tap-highlight-color: transparent;
}
.radio-label input { position: absolute; opacity: 0; }
.checkmark {
    height: 24px; width: 24px; border: 2px solid #fff; border-radius: 50%;
    margin-right: 10px; display: inline-block; position: relative;
}
.radio-label input:checked ~ .checkmark:after {
    content: ""; position: absolute; top: 50%; left: 50%;
    transform: translate(-50%, -50%); width: 10px; height: 10px; border-radius: 50%; background: #fff;
}
.radio-label input:focus-visible ~ .checkmark { box-shadow: 0 0 0 3px rgba(255,255,255,.45); }

.custom-rsvp-btn {
    background-color: #fff;
    color: var(--naslov-color);
    font-size: 18px;
    font-weight: 700;
    padding: 14px 0;
    width: 100%;
    max-width: 300px;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all .3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,.12);
    margin: 30px auto 0;
    display: block;
    position: relative;
    z-index: 20;
}
.custom-rsvp-btn:disabled { opacity: .7; cursor: default; }

/* cvijeće dole: preko donjeg kraja zelene i prelaza u bijelo */
.footer-floral-box {
    position: relative;
    z-index: 10;
    width: 100%;
    margin: -165px auto -150px;
    line-height: 0;
    pointer-events: none;
}
.prelaz-dole { position: relative; z-index: 4; line-height: 0; margin-top: -1px; }
.prelaz-dole img { width: 100%; height: auto; display: block; }

/* ---------- SMJEŠTAJ (bijeli dio ispod RSVP-a) ---------- */
.smestaj {
    background: var(--papir);
    margin-top: -1px;
    padding: 18px 30px 64px;
    text-align: center;
    color: var(--tekst);
    position: relative;
    z-index: 3;
}
.ornament { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 0 auto 20px; width: 190px; }
.ornament i { flex: 1; height: 1px; background: rgba(107,115,85,.45); }
.ornament svg { width: 22px; height: 22px; flex: none; }

.smestaj h2 {
    color: var(--naslov-color);
    font-weight: 700;
    font-size: 27px;
    line-height: 1.22;
    margin-bottom: 22px;
}
.smestaj h2 span { display: block; font-weight: 400; font-style: italic; font-size: 21px; margin-top: 4px; }
.smestaj p { font-size: 17.5px; line-height: 1.6; margin: 0 auto 16px; max-width: 360px; }
.smestaj p b { font-weight: 700; color: #2f332a; }

.kontakt {
    margin: 26px auto 8px;
    max-width: 310px;
    padding: 20px 18px 8px;
    border: 1px solid rgba(107,115,85,.35);
    border-radius: 18px;
    background: rgba(255,255,255,.65);
}
.kontakt-naslov { font-size: 13px; letter-spacing: .28em; text-transform: uppercase; color: var(--naslov-color); font-weight: 600; margin: 0 0 6px !important; }
.kontakt a {
    display: flex; align-items: center; justify-content: center; gap: 10px;
    color: var(--tekst); text-decoration: none; font-weight: 600; font-size: 18px;
    padding: 11px 0; -webkit-tap-highlight-color: transparent;
}
.kontakt a + a { border-top: 1px solid rgba(107,115,85,.22); }
.kontakt a svg { width: 19px; height: 19px; color: var(--naslov-color); flex: none; }

.hotel-dugme {
    display: block;
    width: 100%; max-width: 300px;
    margin: 22px auto 0;
    padding: 15px 10px;
    border-radius: 50px;
    text-decoration: none;
    color: #fff;
    font-weight: 600; font-size: 18px;
    background: linear-gradient(180deg, var(--zelena-svijetla), var(--zelena-tamna));
    border: 2px solid rgba(255,255,255,.7);
    box-shadow: 0 0 0 1px rgba(107,115,85,.5), 0 6px 14px rgba(70,78,50,.28);
    -webkit-tap-highlight-color: transparent;
}
.hotel-dugme:active { filter: brightness(.94); }

.smestaj .hvala { margin-top: 44px; font-weight: 600; font-size: 20px; line-height: 1.4; color: var(--naslov-color); }
.smestaj .hvala-2 { margin-top: 4px; }

/* ---------- POPUP: uspješna prijava ---------- */
.popup-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(255,255,255,.4);
    backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
    display: none; justify-content: center; align-items: center;
    z-index: 9999; animation: fadeIn .3s ease;
}
.popup-content {
    background: #fff; padding: 50px 25px; border-radius: 28px; text-align: center;
    box-shadow: 0 25px 50px rgba(0,0,0,.12); width: 380px; max-width: 92%;
    display: flex; flex-direction: column; align-items: center; gap: 10px;
}
@keyframes fadeIn { from { opacity: 0; transform: scale(.9); } to { opacity: 1; transform: scale(1); } }
.popup-content h3 { font-size: 24px; color: var(--naslov-color); margin: 15px 0 8px; line-height: 1.2; }
.popup-content p { font-size: 16px; color: #666; margin: 0; }
.success-icon { display: flex; justify-content: center; margin-bottom: 10px; }
.checkmark-svg { width: 60px; height: 60px; display: block; stroke-width: 3; stroke: var(--naslov-color); fill: none; }
.checkmark__circle {
    stroke-dasharray: 166; stroke-dashoffset: 166; stroke-miterlimit: 10; stroke: var(--naslov-color); fill: none;
    animation: strokeAnim .6s cubic-bezier(.65,0,.45,1) forwards;
}
.checkmark__check {
    stroke-dasharray: 48; stroke-dashoffset: 48; stroke-linecap: round; stroke-linejoin: round;
    animation: strokeAnim .3s cubic-bezier(.65,0,.45,1) .6s forwards;
}
@keyframes strokeAnim { to { stroke-dashoffset: 0; } }

input::-webkit-outer-spin-button, input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
input[type=number] { -moz-appearance: textfield; }

@media (max-width: 320px) {
    .rsvp-naslov { font-size: 30px; }
    .rsvp-opis { font-size: 16px; }
    .rsvp-container { padding-left: 16px; padding-right: 16px; }
    .smestaj { padding-left: 18px; padding-right: 18px; }
}
