/* assets/css/template-formal.css - tema "Formal / Resmi" (acara kedinasan, diplomatik, korporat) */

:root {
    --accent: #0b4a2f;
    --accent-soft: #b8952f;
    --bg: #fbf9f3;
    --text: #2b2b2b;
    --line: #ddd3b8;
    /* Font default tema (dipakai kalau admin belum pilih preset font lain di tab Layout) */
    --font-heading: 'EB Garamond', 'Georgia', serif;
    --font-body: 'EB Garamond', 'Georgia', serif;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: var(--font-body);
    background: #e9e6df;
    color: var(--text);
}

.invite-wrap {
    max-width: 520px;
    margin: 0 auto;
    background: var(--bg);
    min-height: 100vh;
    box-shadow: 0 0 40px rgba(0,0,0,0.10);
    position: relative;
    overflow: hidden;
    border: 1px solid var(--line);
}

/* BARU: Mode Cover ($coverMode, diatur admin per undangan lewat tab Layout & Tampilan):
   - 'landing' (default, TANPA class "has-cover-gate" di .invite-wrap): section ini ("cover") cuma
     jadi bagian intro/hero biasa paling atas halaman (tinggi menyesuaikan isinya saja), konten di
     bawahnya (.content-section) langsung tampil tanpa perlu diklik dulu.
   - 'gate' (.invite-wrap.has-cover-gate): kembalikan perilaku lama - full-screen (min-height:100vh)
     dgn tombol "View Invitation" (.btn-open) yang harus diklik dulu sebelum konten & navbar
     muncul (lihat aturan .has-cover-gate di bawah & revealInvitation() di templates/formal/
     template.php). */
.cover-screen {
    background: var(--bg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 56px 32px 48px;
    position: relative;
    border-bottom: 3px double var(--accent-soft);
}
.has-cover-gate .cover-screen {
    min-height: 100vh;
    padding: 48px 32px;
}
.btn-open {
    padding: 12px 30px;
    border: 1px solid var(--accent);
    background: transparent;
    color: var(--accent);
    border-radius: 30px;
    cursor: pointer;
    font-size: 13px;
    letter-spacing: 1px;
    margin-top: 26px;
    transition: background 0.25s ease, color 0.25s ease, box-shadow 0.25s ease;
}
.btn-open:hover { background: var(--accent); color: #fff; box-shadow: 0 4px 14px rgba(11,74,47,0.25); }
.btn-open:active { transform: translateY(1px); }
/* BARU: ukuran/perataan/jarak sekarang dikontrol lewat inline style dinamis dari
   $crestLogoSettings (lihat templates/formal/template.php & getCrestLogoSettings() di
   includes/functions.php, diatur admin lewat tab Layout & Tampilan) - aturan di sini jadi
   fallback saja (dipakai kalau untuk alasan apa pun style inline tidak ada). */
.crest-logo {
    max-width: 96px;
    max-height: 96px;
    object-fit: contain;
    margin-bottom: 20px;
}
.kepada
 {
    margin: 127px 1px 1px 1px;
}
.script-heading {
    font-family: 'Tangerine', cursive;
    font-weight: 700;
    font-size: 40px;
    line-height: 1.25;
    color: var(--accent);
    margin-bottom: 18px;
    padding:0px 0px 2px 10px;
}
.cover-screen .kepada {
    font-size: 12px; letter-spacing: 2px; text-transform: uppercase; color: #8a8262; margin-bottom: 10px;
}
.host-lines {
    font-size: 15px;
    line-height: 1.7;
    color: var(--text);
    margin-bottom: 14px;
}
.warmly-invite {
    font-style: italic;
    font-size: 15px;
    color: var(--accent);
    margin-bottom: 0;
}

/* Mode 'landing' (default): konten langsung bagian normal alur halaman, tidak perlu digerbang
   (padding-bottom tetap dijaga spy footer tidak ketutup navbar mobile fixed di bawah).
   Mode 'gate' (.has-cover-gate): konten disembunyikan dulu sampai class ".show" ditambahkan lewat
   revealInvitation() (dipanggil dari tombol .btn-open) di templates/formal/template.php. */
.content-section { padding-bottom: 72px; }
.has-cover-gate .content-section:not(.show) { display: none; }

/* Mode 'gate': navbar mobile juga baru muncul setelah revealInvitation() (JS set style.display
   langsung, override aturan ini) - mode 'landing' tetap pakai default .mobile-navbar (flex) di
   bawah, langsung tampil sejak halaman dibuka. */
.has-cover-gate .mobile-navbar { display: none; }

section {
    padding: calc(40px * var(--section-padding-scale, 1)) calc(28px * var(--section-padding-scale, 1));
    text-align: center; border-bottom: 1px solid var(--line);
}
section h2 {
    font-size: 18px; letter-spacing: 1px; color: var(--accent); margin-bottom: 14px;
    font-family: var(--font-heading); text-transform: uppercase;
}
section h2::after {
    content: ""; display: block; width: 40px; height: 1px; background: var(--accent-soft);
    margin: 10px auto 0;
}
section p { margin: 6px 0; line-height: 1.7; }

/* --- Section "Event Details" (tanggal/lokasi/hitung-mundur/peta) --- */
.event-info { margin: 4px 0 6px; }
.event-info .event-date {
    font-size: 17px; letter-spacing: 0.2px; margin-bottom: 4px;
}
.event-info .event-location {
    color: var(--accent); font-weight: 600; letter-spacing: 0.2px;
}

#countdown { display: flex; justify-content: center; gap: 10px; margin: 20px 0; }
#countdown div {
    background: var(--bg); border-radius: 6px; padding: 12px; min-width: 60px;
    border: var(--chip-border, 1px solid var(--line));
    box-shadow: var(--chip-shadow, 0 2px 8px rgba(11,74,47,0.06));
}
#countdown span { display: block; font-size: 20px; font-weight: bold; color: var(--accent); }

.gallery-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.gallery-grid img { width: 100%; height: 110px; object-fit: cover; border-radius: var(--photo-radius, 4px); transition: transform 0.3s ease, box-shadow 0.3s ease; cursor: pointer; }
.gallery-grid img:hover { transform: scale(1.06); box-shadow: 0 6px 16px rgba(0,0,0,0.18); position: relative; z-index: 1; }
.guestbook-photo { max-width: 160px; margin-top: 6px; border-radius: var(--photo-radius, 4px); }

.map-frame {
    border-radius: 8px; overflow: hidden; margin-top: 8px;
    border: var(--chip-border, 1px solid var(--line));
    box-shadow: var(--chip-shadow, 0 2px 8px rgba(11,74,47,0.06));
}
.map-frame iframe { width: 100%; height: 240px; border: 0; display: block; }

/* font-size:16px (bukan cuma font-family:inherit) SENGAJA ditetapkan eksplisit di sini - kalau
   dibiarkan pakai ukuran bawaan browser utk elemen form (biasanya di bawah 16px), Safari di
   iPhone otomatis nge-zoom in setiap kali field ini di-tap, cukup mengganggu saat isi form RSVP
   di HP. 16px adalah batas aman minimum supaya Safari iOS tidak memicu auto-zoom itu. */
.rsvp-form input, .rsvp-form select, .rsvp-form textarea {
    width: 100%; padding: 10px; margin-bottom: 10px; border: 1px solid var(--line); border-radius: 4px;
    font-family: inherit; font-size: 16px;
}
.btn-primary {
    background: var(--accent); color: #fff; border: none; padding: 12px 24px; border-radius: 30px; cursor: pointer;
    font-size: 15px;
    transition: background 0.25s ease, box-shadow 0.25s ease, transform 0.1s ease;
    box-shadow: 0 3px 10px rgba(11,74,47,0.18);
}
.btn-primary:hover { background: #0d5c3a; box-shadow: 0 5px 16px rgba(11,74,47,0.28); }
.btn-primary:active { transform: translateY(1px); }

.guestbook-list { text-align: left; max-height: 300px; overflow-y: auto; margin-top: 10px; }
.guestbook-item { border-bottom: 1px dashed var(--line); padding: 10px 0; }
.guestbook-item .nama { font-weight: bold; color: var(--accent); }
.guestbook-item .waktu { font-size: 11px; color: #999; }

.gift-box {
    background: var(--bg); border-radius: 6px; padding: 16px; margin-bottom: 12px; text-align: left;
    border: var(--chip-border, 1px solid var(--line));
    box-shadow: var(--chip-shadow, 0 2px 8px rgba(11,74,47,0.06));
}
.gift-box img { max-width: 180px; display: block; margin: 10px auto; }

.flash-msg { padding: 10px; border-radius: 4px; margin: 16px 0; font-size: 14px; }
.flash-msg.success { background: #e6f4ea; color: #1e7e34; }
.flash-msg.error { background: #fdecea; color: #c0392b; }

.music-toggle {
    position: fixed; bottom: 76px; right: calc(50% - 260px + 16px);
    background: var(--accent); color: #fff; width: 44px; height: 44px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center; border: none; cursor: pointer; z-index: 10;
}

/* --- Navbar mobile (Home/Event/RSVP/My QR), muncul setelah undangan dibuka --- */
.mobile-navbar {
    position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
    width: 100%; max-width: 520px;
    background: rgba(255,253,248,0.97); backdrop-filter: blur(6px);
    border-top: 1px solid var(--line); border-top: 2px solid var(--accent-soft);
    box-shadow: 0 -6px 20px rgba(11,74,47,0.10);
    display: flex; justify-content: space-around; align-items: center;
    padding: 8px 4px calc(8px + env(safe-area-inset-bottom, 0px));
    z-index: 100;
}
.nav-item {
    display: flex; flex-direction: column; align-items: center; gap: 3px;
    color: #8a8262; text-decoration: none; font-size: 11px; letter-spacing: 0.3px;
    background: none; border: none; cursor: pointer; padding: 6px 10px;
    border-radius: 10px; transition: color 0.2s ease, background 0.2s ease;
}
.nav-item:hover, .nav-item:focus { color: var(--accent); background: rgba(11,74,47,0.06); outline: none; }
.nav-item:active { transform: scale(0.95); }
.nav-item svg { display: block; transition: transform 0.2s ease; }
.nav-item:hover svg { transform: translateY(-1px); }

/* --- Modal "My QR" (verifikasi HP -> QR tiket masuk) - reuse .rsvp-modal-overlay/.rsvp-modal-box
   dari assets/css/form-styles.css, cuma tambah style utk input & tombol close di dalamnya. --- */
.rsvp-checkin-input {
    width: 100%; padding: 10px; margin: 12px 0; border: 1px solid var(--line); border-radius: 4px; font-family: inherit;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.rsvp-checkin-input:focus {
    outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(11,74,47,0.12);
}

/* Animasi masuk halus khusus modal My QR di tema formal (tidak menyentuh CSS bersama form-styles.css) */
#checkinModalOverlay .rsvp-modal-box { animation: modalPopIn 0.25s ease; }
@keyframes modalPopIn {
    from { opacity: 0; transform: scale(0.96) translateY(8px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-close-btn {
    float: right; width: 30px; height: 30px; border-radius: 50%;
    border: none; background: #f1efe5; color: #888;
    font-size: 18px; line-height: 1; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: background 0.2s ease, color 0.2s ease, transform 0.15s ease;
}
.modal-close-btn:hover { background: var(--accent); color: #fff; }
.modal-close-btn:active { transform: scale(0.9); }

.checkin-qr-img {
    width: 190px; height: 190px; border: 1px solid var(--line); padding: 8px; background: #fff;
    border-radius: 8px; box-shadow: 0 4px 14px rgba(11,74,47,0.10);
}

/* --- Kartu "Thank You" penuh (RSVP sudah diisi) - restyle .rsvp-success-card default (form-styles.css)
   jadi lebih besar/formal, meniru gaya halaman Thank You berdiri sendiri (rsvp_thanks.php), tapi
   tetap tampil inline di section RSVP halaman utama (bukan pindah halaman). --- */
.rsvp-success-card.thank-you-full {
    padding: 44px 28px 38px;
}
.rsvp-success-card.thank-you-full .rsvp-success-icon {
    width: 72px; height: 72px; margin-bottom: 20px;
}
.rsvp-success-card.thank-you-full .rsvp-success-icon svg {
    width: 32px; height: 32px;
}
.rsvp-success-title {
    font-family: var(--font-heading, 'EB Garamond', serif);
    font-size: 24px; font-weight: 700; color: #1f2937;
    text-align: center; margin-bottom: 14px;
}

/* --- BARU: dulu "Modal My QR" (popup dibuka dari navbar) - sekarang section biasa yang tampil
   LANGSUNG inline di atas Event Details (section#myqr-inline, lihat $myQrInlineHtml di
   templates/formal/template.php), bukan lagi di dalam popup. Class .myqr-state-icon/msg/
   action-btn dst di bawah ini dipakai apa adanya (sama persis), cukup rely pada CSS generic
   "section"/"section h2" yang sudah ada utk heading+padding+separator - konsisten dgn section
   lain (Event Details/Gallery/dst). Lihat juga resolveMyQrStatus() di includes/functions.php. --- */
.myqr-inline-section .myqr-state-icon {
    margin-top: 4px;
}
/* BARU: QR pribadi tamu dipindah lagi - sekarang tampil LANGSUNG DI DALAM cover/hero
   (.cover-screen), diposisikan di bawah judul perayaan (.script-heading) dan DI ATAS garis
   pemisah cover (border-bottom double line milik .cover-screen sendiri). Class ini menimpa
   aturan generic "section" (padding besar + border-bottom garis) karena di sini section itu
   jadi anak flex dari .cover-screen, bukan section halaman biasa - kalau dibiarkan pakai
   border-bottom generic maka akan muncul 2 garis pemisah bertumpuk (satu dari section ini,
   satu lagi dari .cover-screen). Selector class (.myqr-inline-in-hero) otomatis menang atas
   selector element (section) soal specificity, jadi urutan taruh di CSS tidak masalah. */
.myqr-inline-in-hero {
    width: 100%;
    border-bottom: none;
    padding: 0 0 30px;
}
.myqr-inline-in-hero h2 {
    margin-bottom: 12px;
}
.myqr-state-icon {
    width: 56px; height: 56px; margin: 0 auto 16px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center; color: #fff;
}
.myqr-state-icon.pending { background: linear-gradient(145deg, #e8a33d, #d68a1f); }
.myqr-state-icon.ready { background: linear-gradient(145deg, #34a06a, #2e8b57); }
.myqr-state-icon.error { background: linear-gradient(145deg, #d9534f, #b23a34); }
.myqr-state-icon svg { width: 26px; height: 26px; }
.myqr-state-title { font-size: 16px; font-weight: 700; color: #1f2937; text-align: center; margin-bottom: 8px; }
.myqr-state-msg { font-size: 13px; color: #666; text-align: center; line-height: 1.6; margin-bottom: 4px; }
.myqr-action-btn {
    display: inline-flex; align-items: center; gap: 6px; margin-top: 14px; padding: 10px 22px;
    background: var(--accent); color: #fff; border: none; border-radius: 999px;
    font-size: 13px; font-weight: 600; cursor: pointer; letter-spacing: 0.03em;
}
.myqr-action-btn.secondary { background: #fff; color: var(--accent); border: 1px solid var(--accent-soft); }
.myqr-action-row { text-align: center; margin-top: 4px; }

/* BARU: preview kartu ID langsung di halaman (background + QR + nama + tanggal), sama persis
   proporsinya dgn hasil Download QR (lihat drawIdCardAndDownload() di blok skrip bawah) - murni
   HTML/CSS (bukan <canvas>), jadi tidak kena isu CORS/tainted sama sekali. */
.myqr-idcard { position: relative; width: 100%; max-width: 280px; margin: 0 auto 4px; border-radius: 14px; overflow: hidden; box-shadow: 0 6px 20px rgba(0,0,0,0.14); }
.myqr-idcard-bg { display: block; width: 100%; height: auto; }
.myqr-idcard-box {
    position: absolute; top: 27%; left: 50%; transform: translateX(-50%);
    width: 50%; background: #ffffffcc; border-radius: 10px;
    box-shadow: 0 6px 16px rgba(0,0,0,0.18);
    padding: 6% 6% 8%; text-align: center;
}
.myqr-idcard-qr { width: 100%; height: auto; display: block; margin-top: 10px; }
.myqr-idcard-name { font-weight: 700; font-size: clamp(9px, 3vw, 12px); color: #1f2937; margin-top: 8px; font-family: Georgia, serif; }
.myqr-idcard-date { font-size: clamp(7px, 2.2vw, 10px); color: #6b7280; margin-top: 2px; font-family: Georgia, serif; }
.myqr-idcard-vip { display: inline-block; font-size: clamp(8px, 2.6vw, 11px); font-weight: 700; letter-spacing: 0.12em; color: #92400e; background: #fef3c7; border-radius: 999px; padding: 3px 10px; margin-top: 6px; }
.myqr-idcard-event { font-size: clamp(10px, 3.4vw, 13.5px); color: #9ca3af; margin-top: 0; font-style: italic; font-family: Georgia, serif; line-height: 1.35; }

.footer-notes {
    text-align: center; font-size: 13px; color: #555; line-height: 1.8;
    padding: 24px 28px; border-bottom: 1px solid var(--line);
}

.rsvp-qr-block {
    text-align: center; padding: 24px 28px;
}
.rsvp-qr-block img { width: 150px; height: 150px; border: 1px solid var(--line); padding: 6px; background: #fff; }
.rsvp-qr-block p { font-size: 12px; color: #777; margin-top: 8px; }

footer.credit { text-align: center; padding: 24px; font-size: 12px; color: #999; }

/* Integrasi tamu personal (uid) + QR check-in */
.vip-badge {
    display: inline-block; background: var(--accent-soft); color: #fff; font-size: 11px; font-weight: bold;
    letter-spacing: 1px; padding: 4px 12px; border-radius: 20px; margin-top: 8px; text-transform: uppercase;
}
.qr-box {
    background: var(--bg); border-radius: 6px; padding: 20px; margin: 0 0 12px;
    border: var(--chip-border, 1px solid var(--line));
    box-shadow: var(--chip-shadow, 0 2px 8px rgba(11,74,47,0.06));
}
.qr-box img { max-width: 220px; width: 100%; display: block; margin: 12px auto 0; }
.qr-box p { font-size: 13px; color: #777; margin: 0; }
.rsvp-form input[readonly] { background: #f0ece0; color: #777; cursor: not-allowed; }
