/* SnapWall — halaman tamu & halaman hasil
   Warna diambil dari CSS variable per event (--sw-*), lihat App\Support\Themes. */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
    background: var(--sw-bg, #F7F2EA);
    color: var(--sw-ink, #1F1A16);
    -webkit-tap-highlight-color: transparent;
}
button, input { font: inherit; color: inherit; }
img { max-width: 100%; }
[hidden] { display: none !important; }

/* ---------- latar & ornamen ---------- */
.sw-bg {
    position: fixed; inset: 0; z-index: 0;
    background-size: cover; background-position: center;
}
.sw-bg::after {
    content: ''; position: absolute; inset: 0;
    background: var(--sw-bg); opacity: .82;
}
.sw-ornament { position: absolute; inset: 0 0 auto 0; height: 190px; z-index: 0; pointer-events: none; }
.sw-ornament--elegant-gold {
    background:
        linear-gradient(var(--sw-ornament), var(--sw-ornament)) 24px 24px / calc(100% - 48px) 1px no-repeat,
        linear-gradient(var(--sw-ornament), var(--sw-ornament)) 24px 30px / calc(100% - 48px) 1px no-repeat;
    opacity: .9;
}
.sw-ornament--floral-pastel {
    height: 150px;
    background: url('../frames/ornament-floral.png') top center / 460px auto no-repeat;
    opacity: .95;
}
.sw-ornament--jawa-klasik {
    height: 36px;
    background-color: var(--sw-surface);
    background-image:
        radial-gradient(ellipse 5px 6px at 10px 5px, var(--sw-ornament) 98%, transparent),
        radial-gradient(ellipse 5px 6px at 10px 15px, var(--sw-ornament) 98%, transparent),
        radial-gradient(ellipse 6px 5px at 5px 10px, var(--sw-ornament) 98%, transparent),
        radial-gradient(ellipse 6px 5px at 15px 10px, var(--sw-ornament) 98%, transparent);
    background-size: 20px 20px;
    border-bottom: 2px solid var(--sw-ornament);
}
.sw-ornament--modern-dark {
    height: 4px;
    background: var(--sw-accent);
}

/* ---------- kerangka ---------- */
.sw-app {
    position: relative; z-index: 1;
    width: 100%; max-width: 460px; margin: 0 auto;
    min-height: 100vh; min-height: 100dvh;
    display: flex; flex-direction: column;
    padding: 46px 20px calc(18px + env(safe-area-inset-bottom));
}
body.sw-dark .sw-app { padding-top: 16px; }
.sw-step { display: flex; flex-direction: column; gap: 18px; flex: 1; }
.sw-grow { flex: 1; }
.sw-center { text-align: center; }

.sw-banner {
    font-size: 13px; line-height: 1.45;
    background: var(--sw-surface); border: 1px solid var(--sw-line);
    border-radius: 12px; padding: 10px 12px; margin-bottom: 12px;
}
.sw-banner--warn { border-color: #D9A441; }

/* ---------- hero ---------- */
.sw-hero {
    display: flex; flex-direction: column; align-items: center; text-align: center;
    gap: 6px; padding-top: 24px;
}
.sw-monogram {
    width: 64px; height: 64px; border-radius: 50%;
    display: grid; place-items: center;
    border: 1.5px solid var(--sw-ornament); color: var(--sw-accent);
    font-family: var(--sw-serif); font-weight: 600; font-size: 22px; letter-spacing: .04em;
    margin-bottom: 6px;
}
.sw-hero__sub { margin: 0; font-family: var(--sw-serif); font-style: italic; font-size: 20px; color: var(--sw-muted); }
.sw-hero__title {
    margin: 0; font-family: var(--sw-display); font-weight: 400;
    text-transform: var(--sw-display-transform);
    font-size: clamp(44px, 15vw, 64px); line-height: 1.08; color: var(--sw-accent);
    overflow-wrap: anywhere;
}
.sw-ornament--jawa-klasik ~ .sw-app .sw-hero__title,
body[style*="Cinzel"] .sw-hero__title { font-size: clamp(32px, 10vw, 44px); font-weight: 700; letter-spacing: .04em; }
.sw-divider { color: var(--sw-ornament); margin: 4px 0; }
.sw-hero__date {
    margin: 0; font-family: var(--sw-serif); font-weight: 600; font-size: 17px;
    letter-spacing: .08em; text-transform: uppercase;
}
.sw-hero__venue { margin: 0; font-size: 13px; color: var(--sw-muted); }

/* ---------- kartu & form ---------- */
.sw-card {
    margin-top: 18px; display: flex; flex-direction: column; gap: 16px;
    background: var(--sw-surface); border: 1px solid var(--sw-line);
    border-radius: 20px; padding: 22px 20px;
}
.sw-card__intro { display: flex; flex-direction: column; gap: 6px; }
.sw-card__title { margin: 0; font-size: 18px; font-weight: 700; }
.sw-card__text { margin: 0; font-size: 14px; line-height: 1.5; color: var(--sw-muted); }

.sw-field { display: flex; flex-direction: column; gap: 8px; }
.sw-label { font-size: 13px; font-weight: 600; }
.sw-optional { font-weight: 400; color: var(--sw-muted); }
.sw-input {
    width: 100%; height: 52px; border-radius: 14px;
    border: 1.5px solid var(--sw-line); background: var(--sw-bg);
    padding: 0 16px; font-size: 16px; color: var(--sw-ink); outline: none;
}
.sw-input:focus { border-color: var(--sw-accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--sw-accent) 22%, transparent); }
.sw-input::placeholder { color: color-mix(in srgb, var(--sw-muted) 75%, transparent); }
.sw-input-wrap { position: relative; }
.sw-input-wrap .sw-input { padding-right: 52px; }
.sw-counter {
    position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
    font-size: 12px; font-weight: 600; color: var(--sw-muted);
}
.sw-counter.is-low { color: #C2410C; }
.sw-hint { margin: 0; font-size: 12.5px; line-height: 1.45; color: var(--sw-muted); }
.sw-hint.is-error, .sw-error { color: #B42318; font-weight: 600; }
.sw-error { margin: 0; font-size: 13.5px; line-height: 1.45; text-align: center; }

.sw-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.sw-chip-btn {
    min-height: 36px; padding: 6px 14px; border-radius: 999px; cursor: pointer;
    border: 1px solid var(--sw-line); background: var(--sw-surface);
    font-size: 13px; font-weight: 600;
}
.sw-chip-btn.is-selected { background: var(--sw-btn); color: var(--sw-btn-ink); border-color: var(--sw-btn); }

/* ---------- tombol ---------- */
.sw-btn {
    min-height: 54px; border-radius: 14px; border: 0; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center; gap: 10px;
    padding: 0 18px; font-weight: 700; font-size: 16px; text-decoration: none;
    transition: transform .12s ease, opacity .2s;
}
.sw-btn:active { transform: scale(.98); }
.sw-btn:disabled { opacity: .55; cursor: default; }
.sw-btn--primary { background: var(--sw-btn); color: var(--sw-btn-ink); }
.sw-btn--ghost { background: transparent; color: var(--sw-ink); border: 1.5px solid var(--sw-ink); }
.sw-btn--small { min-height: 46px; font-size: 14px; }
.sw-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.sw-grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }

.sw-iconbtn {
    flex-shrink: 0; width: 44px; height: 44px; border-radius: 22px; cursor: pointer;
    border: 1px solid var(--sw-line); background: var(--sw-surface);
    display: grid; place-items: center;
}
.sw-iconbtn--dark { background: #2A2521; border-color: #2A2521; color: #F7F2EA; }

.sw-dots { display: flex; justify-content: center; gap: 8px; padding-top: 4px; }
.sw-dots span { width: 6px; height: 6px; border-radius: 3px; background: var(--sw-line); }
.sw-dots span.is-active { width: 22px; background: var(--sw-ink); }

.sw-powered {
    text-align: center; font-size: 11px; color: var(--sw-muted);
    letter-spacing: .04em; padding-top: 16px;
}
.sw-powered strong { color: var(--sw-ink); }

/* ---------- pilih bingkai ---------- */
.sw-topbar { display: flex; align-items: center; gap: 12px; }
.sw-topbar__hello { margin: 0; font-size: 13px; color: var(--sw-muted); }
.sw-topbar__title { margin: 0; font-size: 19px; font-weight: 700; }
.sw-frames { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.sw-frame {
    display: flex; flex-direction: column; gap: 10px; padding: 10px; cursor: pointer; text-align: left;
    border-radius: 16px; border: 2px solid var(--sw-line); background: var(--sw-surface);
}
.sw-frame.is-selected { border-color: var(--sw-ink); box-shadow: 0 6px 18px rgba(0,0,0,.14); }
.sw-frame__img {
    display: block; width: 100%; aspect-ratio: 4 / 5; border-radius: 10px;
    background: var(--sw-line) center / cover no-repeat;
}
.sw-frame__name { font-weight: 600; font-size: 14px; }
.sw-frame.is-selected .sw-frame__name::after { content: '  ✓'; }

/* ---------- kamera ---------- */
body.sw-dark { background: #0F0D0B; color: #F7F2EA; }
body.sw-dark .sw-bg, body.sw-dark .sw-ornament { display: none; }
body.sw-dark .sw-powered { color: #9C9188; }
body.sw-dark .sw-powered strong { color: #F7F2EA; }
.sw-step--camera { gap: 14px; }
.sw-cam-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.sw-chip {
    min-height: 40px; padding: 0 16px; border-radius: 20px; background: #2A2521;
    display: inline-flex; align-items: center; font-weight: 600; font-size: 14px;
    max-width: 60%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
}
.sw-stage {
    position: relative; width: 100%; aspect-ratio: 4 / 5; overflow: hidden;
    border-radius: 6px; background: #000;
}
.sw-stage__video { position: absolute; object-fit: cover; background: #1d1915; }
.sw-stage__overlay, .sw-stage__text {
    position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none;
}
.sw-stage__count {
    position: absolute; inset: 0; display: grid; place-items: center;
    font-size: 34vw; font-weight: 800; color: rgba(255,255,255,.9);
    text-shadow: 0 4px 24px rgba(0,0,0,.45); pointer-events: none;
}
@media (min-width: 460px) { .sw-stage__count { font-size: 150px; } }
.sw-stage__count.is-pop { animation: sw-pop 1s ease-out; }
@keyframes sw-pop { from { transform: scale(1.4); opacity: 0; } 25% { opacity: 1; } to { transform: scale(.9); opacity: .2; } }
.sw-stage__flash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; }
.sw-stage__flash.is-on { animation: sw-flash .5s ease-out; }
@keyframes sw-flash { from { opacity: .95; } to { opacity: 0; } }
.sw-stage__error {
    position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 16px; padding: 24px; text-align: center; background: rgba(15,13,11,.92);
    font-size: 14.5px; line-height: 1.5;
}
.sw-stage__error p { margin: 0; }
.sw-cam-hint { margin: 0; text-align: center; font-size: 13px; color: #C9BFB3; }
.sw-strip { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }
.sw-strip__item {
    width: 44px; height: 55px; border-radius: 8px; padding: 0; cursor: pointer;
    border: 2px solid #3A332D; background: #2A2521 center / cover no-repeat;
}
.sw-strip__item.is-selected { border-color: #E2C27A; }
.sw-cam-controls { display: flex; align-items: center; justify-content: space-between; padding: 0 12px 6px; }
.sw-ctrl {
    width: 72px; display: flex; flex-direction: column; align-items: center; gap: 6px;
    border: 0; background: transparent; color: #F7F2EA; font-size: 12px; cursor: pointer;
}
.sw-ctrl__icon {
    width: 48px; height: 48px; border-radius: 24px; background: #2A2521;
    display: grid; place-items: center;
}
.sw-ctrl[aria-pressed="true"] .sw-ctrl__icon, .sw-ctrl.is-on .sw-ctrl__icon { color: #E2C27A; }
.sw-shutter {
    width: 84px; height: 84px; border-radius: 50%; padding: 5px; cursor: pointer;
    border: 4px solid #F7F2EA; background: transparent;
}
.sw-shutter span { display: block; width: 100%; height: 100%; border-radius: 50%; background: #F7F2EA; transition: transform .1s; }
.sw-shutter:active span { transform: scale(.88); }

/* ---------- preview & hasil ---------- */
.sw-step__title { margin: 0 0 4px; font-size: 21px; font-weight: 700; }
.sw-result {
    display: block; align-self: center; width: min(100%, 340px); aspect-ratio: 4 / 5;
    height: auto; border-radius: 8px; box-shadow: 0 14px 36px rgba(0,0,0,.22); background: var(--sw-line);
    object-fit: cover;
}
.sw-progress { display: flex; flex-direction: column; gap: 8px; }
.sw-progress__row { display: flex; justify-content: space-between; font-size: 13px; font-weight: 600; }
.sw-progress__bar { height: 8px; border-radius: 4px; background: var(--sw-line); overflow: hidden; }
.sw-progress__bar div { height: 100%; width: 0; background: var(--sw-ink); border-radius: 4px; transition: width .2s; }

.sw-badge {
    align-self: center; display: inline-flex; align-items: center; gap: 8px;
    border-radius: 999px; padding: 6px 14px; font-size: 13px; font-weight: 700;
    background: #E7F0E3; color: #2F5A2A;
}
.sw-badge--pending { background: #FDF0D5; color: #7A4A0B; }
.sw-quote {
    margin: 0; text-align: center; font-family: 'Caveat', cursive; font-size: 26px; line-height: 1.2;
    color: var(--sw-ink);
}
.sw-quote small { display: block; font-family: 'Plus Jakarta Sans', sans-serif; font-size: 13px; color: var(--sw-muted); margin-top: 4px; }
.sw-share-main { min-height: 60px; }
.sw-share-main span { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.2; }
.sw-share-main small { font-size: 12px; font-weight: 500; opacity: .8; }
.sw-tile {
    min-height: 64px; border-radius: 14px; cursor: pointer; text-decoration: none;
    border: 1px solid var(--sw-line); background: var(--sw-surface); color: var(--sw-ink);
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px;
    font-size: 12.5px; font-weight: 600;
}
.sw-linkbox {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    border: 1px dashed var(--sw-line); border-radius: 12px; padding: 10px 14px;
    font-size: 13px; color: var(--sw-muted); overflow: hidden;
}
.sw-linkbox span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sw-linkbox strong { color: var(--sw-ink); }
.sw-toast {
    position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%);
    background: var(--sw-ink); color: var(--sw-bg); padding: 10px 18px; border-radius: 999px;
    font-size: 14px; font-weight: 600; z-index: 10; box-shadow: 0 8px 24px rgba(0,0,0,.25);
}
.sw-link { align-self: center; color: var(--sw-ink); font-weight: 700; font-size: 15px; text-decoration: none; display: inline-flex; gap: 8px; align-items: center; padding: 10px; }

/* ---------- halaman tertutup / home ---------- */
.sw-closed { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 22px; text-align: center; }
.sw-closed .sw-hero { padding-top: 0; }
.sw-closed__note { margin: 0; font-size: 15px; line-height: 1.55; color: var(--sw-muted); }

/* ---------- galeri klien ---------- */
.gl { position: relative; z-index: 1; max-width: 1120px; margin: 0 auto; padding: 46px 20px 24px; display: flex; flex-direction: column; gap: 22px; }
.gl-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 0; border-top: 1px solid var(--sw-line); border-bottom: 1px solid var(--sw-line); }
.gl-count { margin: 0; font-size: 14px; color: var(--sw-muted); }
.gl-count strong { color: var(--sw-ink); }
.gl-tabs { display: flex; gap: 4px; background: var(--sw-surface); border: 1px solid var(--sw-line); border-radius: 12px; padding: 4px; }
.gl-tabs button { min-height: 38px; padding: 0 16px; border: 0; border-radius: 9px; background: transparent; font-weight: 600; font-size: 14px; color: var(--sw-muted); cursor: pointer; }
.gl-tabs button[aria-selected="true"] { background: var(--sw-btn); color: var(--sw-btn-ink); }
.gl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; }
@media (min-width: 720px) { .gl-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 18px; } }
.gl-item { display: flex; flex-direction: column; gap: 4px; padding: 8px 8px 10px; border: 0; border-radius: 4px; background: #FFFDF9; color: #3A3029; text-align: center; cursor: zoom-in; box-shadow: 0 6px 18px rgba(0,0,0,.14); transition: transform .2s; }
.gl-item:hover { transform: translateY(-2px) rotate(-.4deg); }
.gl-item img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; background: #e9e3da; }
.gl-item__name { font-family: 'Caveat', cursive; font-weight: 700; font-size: 21px; line-height: 1.1; padding-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gl-item__msg { font-family: 'Caveat', cursive; font-size: 17px; line-height: 1.15; color: #6E5F52; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.gl-notes { columns: 280px; column-gap: 16px; }
.gl-note { break-inside: avoid; margin: 0 0 16px; background: var(--sw-surface); border: 1px solid var(--sw-line); border-radius: 16px; padding: 18px 18px 14px; }
.gl-note blockquote { margin: 0; font-family: 'Caveat', cursive; font-size: 26px; line-height: 1.2; color: var(--sw-ink); }
.gl-note figcaption { margin-top: 8px; font-size: 13px; font-weight: 600; color: var(--sw-muted); }
.gl-note figcaption span { font-weight: 400; }
.gl-empty { text-align: center; color: var(--sw-muted); padding: 40px 0; }
.gl-box { border: 0; padding: 0; background: transparent; max-width: 100vw; max-height: 100vh; width: 100%; height: 100%; }
.gl-box::backdrop { background: rgba(10,8,6,.88); }
.gl-box__inner { position: relative; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 56px 16px 20px; color: #F7F2EA; }
.gl-box img { max-width: min(100%, 560px); max-height: calc(100vh - 220px); width: auto; height: auto; aspect-ratio: 4 / 5; object-fit: contain; box-shadow: 0 20px 60px rgba(0,0,0,.6); }
.gl-box__meta { text-align: center; }
.gl-box__name { margin: 0; font-family: 'Caveat', cursive; font-weight: 700; font-size: 30px; }
.gl-box__msg { margin: 2px 0 0; font-family: 'Caveat', cursive; font-size: 24px; color: #D8CDBF; }
.gl-box__actions { display: flex; align-items: center; gap: 12px; }
.gl-box .sw-iconbtn { background: #2A2521; border-color: #3A332D; color: #F7F2EA; }
.gl-box .sw-btn--primary { background: #F7F2EA; color: #1F1A16; }
.gl-box__close { position: absolute; top: 12px; right: 12px; }
