/* EventPay - antarmuka admin. CSS murni (tanpa framework/CDN) agar CSP tetap ketat. */

:root {
    --bg: #c9cee6;
    --surface: #ffffff;
    --surface-soft: #f6f7fd;
    --ink: #26254a;
    --muted: #8085a8;
    --line: #e4e6f5;
    --primary: #6f5fd6;
    --primary-dark: #5545b8;
    --primary-deep: #40338f;
    --pink: #f3739f;
    --pink-dark: #e0507f;
    --success: #1f9d55;
    --success-bg: #e3f6ea;
    --warn: #b7791f;
    --warn-bg: #fff4d6;
    --danger: #d64559;
    --danger-bg: #fde8eb;
    --info-bg: #e8e9fb;
    --radius: 20px;
    --radius-sm: 12px;
    --shadow: 0 10px 30px rgba(84, 70, 170, .10), 0 2px 6px rgba(84, 70, 170, .06);
    --font: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Roboto, Arial, sans-serif;
}

* { box-sizing: border-box; }

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

body {
    margin: 0;
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.5;
    color: var(--ink);
    background: linear-gradient(160deg, #c9cee6 0%, #d7dbf0 100%);
    min-height: 100vh;
}

a { color: var(--primary-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { color: var(--ink); line-height: 1.25; margin: 0 0 12px; }
h1 { font-size: 1.65rem; font-weight: 700; letter-spacing: -.01em; }
h2 { font-size: 1.1rem; font-weight: 700; margin-top: 28px; }
h3 { font-size: 1rem; font-weight: 700; }
p { margin: 0 0 12px; }
small { color: var(--muted); }
hr { border: 0; border-top: 1px solid var(--line); margin: 24px 0; }
em { color: var(--muted); }

/* ---------------------------------------------------------------- shell */
.app-shell {
    display: grid;
    grid-template-columns: 104px minmax(0, 1fr);
    gap: 0;
    margin: 22px;
    min-height: calc(100vh - 44px);
    background: var(--surface);
    border-radius: 34px;
    box-shadow: 0 30px 70px rgba(70, 60, 150, .18);
    border: 6px solid rgba(255, 255, 255, .55);
    overflow: hidden;
    /* clip (bukan hidden) agar .sidebar sticky tetap jalan; hidden = cadangan browser lama */
    overflow: clip;
}

.sidebar {
    background: linear-gradient(180deg, #7b6be3 0%, #5a49bf 100%);
    margin: 18px 0 18px 18px;
    border-radius: 28px;
    padding: 18px 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    position: sticky;
    top: 18px;
    align-self: start;
    min-height: calc(100vh - 44px - 36px - 12px);
    max-height: calc(100vh - 36px);
    overflow-y: auto;
}

.brand {
    width: 46px; height: 46px;
    border-radius: 16px;
    background: rgba(255, 255, 255, .18);
    color: #fff;
    display: grid; place-items: center;
    font-weight: 800; font-size: 1.15rem; letter-spacing: -.02em;
    margin-bottom: 14px;
}

.sidebar nav { display: flex; flex-direction: column; gap: 6px; width: 100%; flex: 1; }

.nav-link {
    display: flex; flex-direction: column; align-items: center; gap: 3px;
    padding: 10px 4px;
    border-radius: 18px;
    color: rgba(255, 255, 255, .78);
    font-size: .68rem; font-weight: 600; line-height: 1.15; text-align: center;
    text-decoration: none;
    transition: background .15s, color .15s;
}
.nav-link svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.nav-link:hover { background: rgba(255, 255, 255, .12); color: #fff; text-decoration: none; }
.nav-link.active { background: rgba(35, 20, 110, .35); color: #fff; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12); }

.sidebar .logout { width: 100%; margin-top: 10px; }
.sidebar .logout button {
    all: unset; box-sizing: border-box; cursor: pointer; width: 100%;
    display: flex; flex-direction: column; align-items: center; gap: 3px;
    padding: 10px 4px; border-radius: 18px;
    color: rgba(255, 255, 255, .78); font-size: .68rem; font-weight: 600;
}
.sidebar .logout button:hover { background: rgba(255, 255, 255, .12); color: #fff; }
.sidebar .logout svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sidebar .logout button:focus-visible, .nav-link:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

.main { padding: 26px 34px 40px; min-width: 0; }

.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.crumb small { display: block; font-size: .75rem; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.crumb strong { font-size: 1.05rem; }
.user-chip {
    display: flex; align-items: center; gap: 10px;
    background: var(--surface-soft); border-radius: 999px; padding: 6px 16px 6px 6px;
}
.avatar {
    width: 36px; height: 36px; border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--pink));
    color: #fff; display: grid; place-items: center; font-weight: 700;
}
.user-chip .who { line-height: 1.15; }
.user-chip .who strong { display: block; font-size: .85rem; }
.user-chip .who span { font-size: .72rem; color: var(--muted); text-transform: capitalize; }

.page { max-width: 1180px; }

/* ----------------------------------------------------------------- tabs */
.tabs { display: inline-flex; gap: 4px; background: var(--surface-soft); border-radius: 999px; padding: 5px; margin-bottom: 20px; flex-wrap: wrap; }
.tab { padding: 8px 18px; border-radius: 999px; font-weight: 600; font-size: .88rem; color: var(--muted); text-decoration: none; }
.tab:hover { color: var(--ink); text-decoration: none; }
.tab.active { background: var(--primary); color: #fff; box-shadow: 0 4px 12px rgba(111, 95, 214, .35); }

/* ---------------------------------------------------------------- alerts */
.alert, .flash { padding: 12px 16px; border-radius: var(--radius-sm); margin: 0 0 16px; font-weight: 500; }
.alert-success { background: var(--success-bg); color: #14703c; }
.alert-error { background: var(--danger-bg); color: #a3202f; }
.alert-warn { background: var(--warn-bg); color: #8a5a10; }
.text-error { color: var(--danger); font-size: .88rem; }
p.text-error, div.text-error { margin: 4px 0 8px; }
.text-success { color: #14703c; font-weight: 500; }

/* ------------------------------------------------------------ forms/btn */
label { font-weight: 600; font-size: .88rem; color: var(--ink); }
label small { font-weight: 400; }

input[type=text], input[type=email], input[type=password], input[type=number], input[type=date],
input[type=search], input[type=tel], input[type=url], select, textarea {
    font: inherit; color: var(--ink);
    padding: 10px 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface-soft);
    transition: border-color .15s, box-shadow .15s, background .15s;
}
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); background: #fff; box-shadow: 0 0 0 4px rgba(111, 95, 214, .15); }
input[type=checkbox], input[type=radio] { accent-color: var(--primary); width: 17px; height: 17px; vertical-align: middle; }
input[type=file] { font: inherit; font-size: .88rem; }

.view > form:not([style]) {
    background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow);
    padding: 24px; max-width: 680px; margin-bottom: 20px;
}
.view > form:not([style]) input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=hidden]),
.view > form:not([style]) select, .view > form:not([style]) textarea { width: 100%; }
.view > form:not([style]) > div { margin-bottom: 16px; }
.view > form:not([style]) > div > label { display: inline-block; margin-bottom: 6px; }

form[method=GET], form[method=get] { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 18px; }
form[method=GET] label { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }

button, .btn {
    font: inherit; font-weight: 600; font-size: .9rem; cursor: pointer;
    border: 0; border-radius: var(--radius-sm); padding: 10px 18px;
    background: linear-gradient(135deg, #7d6de6, #5a49bf); color: #fff;
    box-shadow: 0 6px 16px rgba(111, 95, 214, .28);
    transition: transform .1s, box-shadow .15s, filter .15s;
}
button:hover, .btn:hover { filter: brightness(1.06); text-decoration: none; }
button:active { transform: translateY(1px); }
button:focus-visible, .btn:focus-visible { outline: 3px solid rgba(111, 95, 214, .4); outline-offset: 2px; }
button[disabled] { opacity: .5; cursor: not-allowed; }
td button, td .btn, .actions button { padding: 6px 12px; font-size: .8rem; box-shadow: none; border-radius: 10px; }
.btn-danger, button.btn-danger { background: linear-gradient(135deg, #e5566a, #c73349); box-shadow: 0 6px 16px rgba(214, 69, 89, .28); }
.btn-ghost, button.btn-ghost { background: var(--info-bg); color: var(--primary-deep); box-shadow: none; }
a.btn { display: inline-block; color: #fff; }
a.btn.btn-ghost { color: var(--primary-deep); }

/* ---------------------------------------------------------------- tables */
table {
    width: 100%; border-collapse: separate; border-spacing: 0;
    background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow);
    overflow: hidden; margin-bottom: 20px; border: 0;
}
th {
    background: var(--surface-soft); color: var(--muted);
    font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; font-weight: 700;
    text-align: left; padding: 13px 16px;
}
td { padding: 13px 16px; border-top: 1px solid var(--line); vertical-align: middle; }
tbody tr:hover td { background: #fafaff; }
table[cellpadding] td, table[cellpadding] th { padding: 13px 16px; }
td form { display: inline; margin: 0; }
td a { font-weight: 600; }

.table-detail th { width: 34%; background: transparent; text-transform: none; letter-spacing: 0; font-size: .88rem; color: var(--muted); font-weight: 600; }

/* --------------------------------------------------------------- badges */
.pagination { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 16px 0 0; }
.pagination a, .pagination-current, .pagination-gap {
    min-width: 36px; padding: 7px 12px; border-radius: var(--radius-sm); text-align: center; font-size: .88rem; font-weight: 600;
}
.pagination a { background: var(--surface); border: 1px solid var(--line); }
.pagination a:hover { background: var(--info-bg); text-decoration: none; }
.pagination-current { background: var(--primary); color: #fff; }
.pagination-gap { color: var(--muted); padding-left: 4px; padding-right: 4px; min-width: 0; }

.badge { display: inline-block; padding: 3px 12px; border-radius: 999px; font-size: .75rem; font-weight: 700; text-transform: capitalize; background: var(--info-bg); color: var(--primary-deep); }
.badge-lunas, .badge-aktif, .badge-active { background: var(--success-bg); color: #14703c; }
.badge-pending, .badge-draft { background: var(--warn-bg); color: #8a5a10; }
.badge-gagal, .badge-error { background: var(--danger-bg); color: #a3202f; }
.badge-expired, .badge-nonaktif, .badge-inactive, .badge-archived, .badge-diarsipkan, .badge-arsip { background: #ececf4; color: #5b5f80; }
.badge-dibatalkan, .badge-warning { background: #ffe9d6; color: #9a4b10; }
.badge-info { background: var(--info-bg); color: var(--primary-deep); }

/* ------------------------------------------------------------ dashboard */
.stat-hero { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr); gap: 18px; margin-bottom: 18px; }
.stat-card { border-radius: var(--radius); padding: 22px 24px; color: #fff; position: relative; overflow: hidden; box-shadow: var(--shadow); }
.stat-card.purple { background: linear-gradient(135deg, #7767e0 0%, #4c3c9f 100%); }
.stat-card.pink { background: linear-gradient(135deg, #f78fb0 0%, #e2517f 100%); }
.stat-card.teal { background: linear-gradient(135deg, #4cc3d4 0%, #1f8799 100%); }
.stat-card .note a { color: #fff; text-decoration: underline; position: relative; z-index: 1; }
.stat-card::after { content: ""; position: absolute; right: -40px; bottom: -60px; width: 190px; height: 190px; border-radius: 50%; background: rgba(255, 255, 255, .10); }
.stat-card .label { font-size: .8rem; opacity: .85; font-weight: 600; letter-spacing: .03em; }
.stat-card .value { font-size: 2.2rem; font-weight: 800; line-height: 1.15; margin-top: 6px; letter-spacing: -.02em; }
.stat-card .note { font-size: .78rem; opacity: .8; margin-top: 8px; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat-tile { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 18px 16px; position: relative; }
.stat-tile .dot { width: 38px; height: 38px; border-radius: 13px; display: grid; place-items: center; margin-bottom: 12px; font-weight: 800; color: #fff; }
.stat-tile .label { font-size: .78rem; color: var(--muted); font-weight: 600; }
.stat-tile .value { font-size: 1.6rem; font-weight: 800; letter-spacing: -.02em; }
.dot.total { background: linear-gradient(135deg, #7d6de6, #5a49bf); }
.dot.lunas { background: linear-gradient(135deg, #34c17a, #1f9d55); }
.dot.pending { background: linear-gradient(135deg, #f6c453, #e0a020); }
.dot.gagal { background: linear-gradient(135deg, #ef6b7d, #d64559); }
.dot.expired { background: linear-gradient(135deg, #a3a7c6, #7c80a3); }
.dot.dibatalkan { background: linear-gradient(135deg, #f59b5f, #e07a30); }

.panel { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px 22px; margin-bottom: 18px; }
.panel h2 { margin-top: 0; }
.distribution { display: flex; height: 12px; border-radius: 999px; overflow: hidden; background: var(--surface-soft); margin: 10px 0 12px; }
.distribution span { display: block; height: 100%; }
.distribution .lunas { background: #1f9d55; } .distribution .pending { background: #e0a020; }
.distribution .gagal { background: #d64559; } .distribution .expired { background: #8b8fb0; }
.distribution .dibatalkan { background: #e07a30; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: .8rem; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; }

.progress { height: 8px; background: var(--line); border-radius: 999px; overflow: hidden; min-width: 90px; }
.progress span { display: block; height: 100%; background: linear-gradient(90deg, #34c17a, #1f9d55); border-radius: 999px; }

.toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.toolbar h1 { margin: 0; }
.pager { display: flex; gap: 10px; align-items: center; margin: 4px 0 18px; }
.pager a { background: var(--info-bg); padding: 7px 14px; border-radius: 999px; font-weight: 600; text-decoration: none; }

/* ----------------------------------------------------------------- auth */
.auth-body { display: grid; place-items: center; padding: 24px; }
.auth-card { width: 100%; max-width: 420px; background: var(--surface); border-radius: 30px; box-shadow: 0 30px 70px rgba(70, 60, 150, .2); overflow: hidden; border: 6px solid rgba(255, 255, 255, .55); }
.auth-head { background: linear-gradient(135deg, #7d6de6, #4c3c9f); color: #fff; padding: 30px 32px; position: relative; overflow: hidden; }
.auth-head::after { content: ""; position: absolute; right: -50px; top: -50px; width: 170px; height: 170px; border-radius: 50%; background: rgba(255, 255, 255, .12); }
.auth-head .brand { position: relative; margin-bottom: 14px; }
.auth-head h1 { color: #fff; margin: 0; font-size: 1.5rem; }
.auth-head p { margin: 4px 0 0; opacity: .85; font-size: .9rem; }
.auth-form { padding: 28px 32px 32px; }
.auth-form form > div { margin-bottom: 16px; }
.auth-form label { display: block; margin-bottom: 6px; }
.auth-form input { width: 100%; }
.auth-form button { width: 100%; padding: 12px; font-size: 1rem; }

/* ---------------------------------------------------------- responsive */
@media (max-width: 980px) {
    .stat-hero { grid-template-columns: 1fr; }
    .main { padding: 20px 20px 32px; }
}

@media (max-width: 820px) {
    .app-shell { grid-template-columns: 1fr; margin: 0; border-radius: 0; border-width: 0; min-height: 100vh; }
    .sidebar {
        position: static; margin: 12px; min-height: 0; flex-direction: row; align-items: center;
        padding: 8px; border-radius: 22px; overflow-x: auto; gap: 4px;
    }
    .brand { margin: 0 6px 0 2px; flex: 0 0 auto; width: 40px; height: 40px; }
    .sidebar nav { flex-direction: row; flex: 1; width: auto; gap: 2px; }
    .nav-link { flex: 0 0 auto; min-width: 66px; padding: 8px 6px; }
    .sidebar .logout { width: auto; margin: 0; flex: 0 0 auto; }
    .sidebar .logout button { width: 66px; padding: 8px 6px; }
    .topbar { flex-wrap: wrap; }
    .main { padding: 8px 14px 28px; }
    table { display: block; overflow-x: auto; white-space: nowrap; }
    .view > form:not([style]) { padding: 18px; }
    h1 { font-size: 1.4rem; }
    .stat-card .value { font-size: 1.8rem; }
}

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ----------------------------------------------------------- utilities */
.btn-sm, a.btn-sm { padding: 6px 12px; font-size: .8rem; border-radius: 10px; box-shadow: none; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.actions form { display: inline; margin: 0; }
.actions a.btn { font-weight: 600; }
.quick-links { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 18px; }
a.btn-ghost, .btn-ghost { text-decoration: none; }
a.btn-ghost:hover { background: #dcdef8; text-decoration: none; }
.muted { color: var(--muted); }
.mono { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: .85rem; }
.view > .toolbar + p, .view > p:first-of-type { margin-top: 0; }
/* form pembungkus tabel / aksi tunggal: bukan kartu */
.view > form.bulk-form:not([style]) { background: none; box-shadow: none; padding: 0; max-width: none; border-radius: 0; }
.view > form[data-confirm]:not([style]) { background: none; box-shadow: none; padding: 0; max-width: none; margin: 0 0 18px; display: inline-block; }
.bulk-form > p { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin: 0 0 14px; }

/* tabel detail: kolom label (th di dalam tbody) */
tbody th { width: 34%; background: var(--surface-soft); color: var(--muted); font-size: .8rem; text-transform: none; letter-spacing: 0; font-weight: 600; border-top: 1px solid var(--line); }
tbody tr:first-child th { border-top: 0; }

.view > p > a:only-child { font-weight: 600; }
/* daftar yang bisa diurutkan (drag & drop) */
.sortable-list { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 10px; }
.sortable-item {
    display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
    background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 12px 16px;
    box-shadow: 0 4px 14px rgba(84, 70, 170, .06); cursor: grab;
}
.sortable-item:hover { border-color: #cfd1f1; }
.sortable-item > span:last-child { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.sortable-item form { display: inline; margin: 0; }
.sortable-item button { padding: 6px 12px; font-size: .8rem; box-shadow: none; border-radius: 10px; }
.row-form { display: flex; flex: 1 1 62%; gap: 8px; align-items: center; flex-wrap: wrap; margin: 0; }
.row-form input[type=text], .row-form input[type=number] { flex: 1 1 130px; width: auto; min-width: 110px; }
.sortable-item.locked { background: var(--surface-soft); cursor: default; }
.sortable-item > div { flex: 1 1 100%; color: var(--muted); font-size: .9rem; }

/* =====================================================================
   Halaman publik (pendaftaran peserta) - mobile-first
   ===================================================================== */
.pub-body { padding: 0; }
.pub-wrap { max-width: 600px; margin: 0 auto; padding: 14px 14px 30px; }

.pub-hero {
    background: linear-gradient(135deg, #7d6de6 0%, #4c3c9f 100%);
    border-radius: 30px; color: #fff; overflow: hidden; position: relative;
    box-shadow: 0 24px 50px rgba(70, 60, 150, .22);
}
.pub-hero::after { content: ""; position: absolute; right: -60px; top: -60px; width: 200px; height: 200px; border-radius: 50%; background: rgba(255, 255, 255, .10); pointer-events: none; }
.pub-hero .banner img { display: block; width: 100%; height: auto; }
.pub-hero-body { padding: 26px 26px 44px; position: relative; z-index: 1; }
.pub-hero .logo img { width: auto; max-width: 96px; max-height: 64px; background: #fff; border-radius: 16px; padding: 8px; display: block; margin-bottom: 16px; }
.pub-hero h1 { color: #fff; font-size: 1.6rem; margin: 0 0 6px; }
.pub-hero .organizer { opacity: .85; font-size: .92rem; }

.pub-card {
    background: var(--surface); border-radius: 28px; box-shadow: var(--shadow);
    padding: 24px 22px 26px; margin-top: -22px; position: relative; z-index: 2;
}
.pub-section { margin: 22px 0 14px; font-size: 1.05rem; }
.description { color: #3d3c63; line-height: 1.6; margin-bottom: 8px; }
.description p { margin: 0 0 12px; }
.description img { max-width: 100%; height: auto; border-radius: 14px; }
.description ul, .description ol { padding-left: 22px; margin: 0 0 12px; }
.description a { text-decoration: underline; }

.notice { padding: 13px 16px; border-radius: 14px; margin: 0 0 16px; font-size: .92rem; font-weight: 500; }
.notice-closed { background: var(--danger-bg); color: #a3202f; }
.notice-maintenance, .notice-warn { background: var(--warn-bg); color: #8a5a10; }
.notice-pending, .notice-status { background: var(--info-bg); color: var(--primary-deep); }
.notice-preview { background: #26254a; color: #fff; text-align: center; margin: 0 0 12px; }

.pub-form .field { margin-bottom: 18px; }
.field-label { display: block; font-weight: 700; font-size: .9rem; margin-bottom: 7px; }
.req { color: var(--danger); }
.pub-form input[type=text], .pub-form input[type=email], .pub-form input[type=tel], .pub-form input[type=number],
.pub-form select, .pub-form textarea { width: 100%; font-size: 1rem; padding: 12px 14px; }
.pub-form input[type=file] { width: 100%; padding: 12px; border: 1.5px dashed #c9cbee; border-radius: 14px; background: var(--surface-soft); }
.help { color: var(--muted); font-size: .8rem; margin-top: 6px; }
.err { color: var(--danger); font-size: .85rem; margin-top: 6px; font-weight: 600; }

.choices, .price-list { display: grid; gap: 8px; }
.choice, .price-option {
    display: flex; align-items: center; gap: 12px; cursor: pointer;
    border: 1.5px solid var(--line); border-radius: 16px; padding: 12px 14px; background: var(--surface);
    font-weight: 500; transition: border-color .15s, background .15s, box-shadow .15s;
}
.choice:hover, .price-option:hover { border-color: #c3c6ec; }
.choice:has(input:checked), .price-option:has(input:checked) { border-color: var(--primary); background: #f3f1ff; box-shadow: 0 0 0 3px rgba(111, 95, 214, .14); }
.choice input, .price-option input { flex: 0 0 auto; }
.price-option .price-name { flex: 1; font-weight: 700; }
.price-option .price-amount { font-weight: 800; color: var(--primary-deep); text-align: right; }
.price-old { color: var(--muted); font-weight: 500; font-size: .82rem; margin-right: 6px; }

.total-box {
    display: flex; justify-content: space-between; align-items: center; gap: 12px;
    background: linear-gradient(135deg, #7d6de6, #4c3c9f); color: #fff;
    border-radius: 20px; padding: 16px 20px; margin: 22px 0 16px; font-weight: 600;
}
.total-box strong { font-size: 1.45rem; font-weight: 800; letter-spacing: -.01em; }
.discount-info { display: flex; justify-content: flex-end; align-items: center; gap: 8px; margin: 22px 4px 0; }
.discount-info[hidden] { display: none; }
.discount-info .price-old { font-size: .95rem; margin-right: 0; }
.discount-info + .total-box { margin-top: 8px; }
.discount-badge { background: #ffe8e8; color: #c62828; font-weight: 800; font-size: .8rem; border-radius: 999px; padding: 3px 10px; }

.pub-submit {
    width: 100%; padding: 15px 18px; font-size: 1.05rem; border-radius: 16px;
    background: linear-gradient(135deg, #34c77b, #1a8f52); box-shadow: 0 8px 20px rgba(31, 157, 85, .3);
}
.pub-submit:focus-visible { outline-color: rgba(31, 157, 85, .45); }
.pub-note { text-align: center; color: var(--muted); font-size: .8rem; margin: 12px 0 0; }
.pub-foot { text-align: center; color: #6c7096; font-size: .78rem; margin-top: 18px; }

/* halaman home publik */
.home-tagline { margin: 12px 0 0; opacity: .92; font-size: 1rem; }
.home-title { margin-top: 4px; }
.home-steps { list-style: none; margin: 0 0 20px; padding: 0; display: grid; gap: 14px; }
.home-steps li { display: flex; gap: 14px; align-items: flex-start; background: var(--surface-soft); border-radius: 18px; padding: 14px 16px; }
.home-steps strong { display: block; font-size: .95rem; margin-bottom: 2px; }
.home-steps p { margin: 0; color: var(--muted); font-size: .86rem; line-height: 1.5; }
.home-step-icon {
    flex: 0 0 auto; width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center;
    background: linear-gradient(135deg, #7d6de6, #5a49bf); box-shadow: 0 6px 14px rgba(111, 95, 214, .25);
}
.home-step-icon svg { width: 22px; height: 22px; stroke: #fff; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.home-contact { margin-bottom: 0; line-height: 1.55; }

/* halaman sukses / 404 */
.pub-success { text-align: center; padding-top: 34px; margin-top: 0; }
.success-icon { width: 76px; height: 76px; border-radius: 50%; margin: 0 auto 16px; display: grid; place-items: center; background: linear-gradient(135deg, #3ccf85, #1f9d55); box-shadow: 0 12px 26px rgba(31, 157, 85, .32); }
.success-icon svg { width: 38px; height: 38px; stroke: #fff; fill: none; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.success-icon.muted-icon { background: linear-gradient(135deg, #a9adcf, #7c80a3); box-shadow: 0 12px 26px rgba(124, 128, 163, .3); }
.success-icon.muted-icon svg { stroke-width: 2.2; }
.success-icon.pending-icon { background: linear-gradient(135deg, #ffc15a, #f08c1a); box-shadow: 0 12px 26px rgba(240, 140, 26, .32); }
.success-icon.pending-icon svg { stroke-width: 2.2; }
.success-icon.warn-icon { background: linear-gradient(135deg, #ff7a6b, #d9364a); box-shadow: 0 12px 26px rgba(217, 54, 74, .3); }
.success-icon.warn-icon svg { stroke-width: 2.8; }

/* animasi pembayaran sukses (dipicu onSuccess Snap) */
.success-icon.is-celebrating { position: relative; animation: pay-pop .55s cubic-bezier(.2, 1.5, .4, 1) both; }
.success-icon.is-celebrating::after {
    content: ""; position: absolute; inset: 0; border-radius: 50%; border: 3px solid #3ccf85;
    animation: pay-ring 1s ease-out .3s both;
}
.check-draw { stroke-dasharray: 22; stroke-dashoffset: 22; animation: pay-draw .45s ease-out .35s forwards; }
.confetti {
    position: absolute; left: 50%; top: 50%; width: 8px; height: 8px; border-radius: 2px;
    background: var(--c); opacity: 0; animation: pay-burst .9s ease-out .35s forwards;
}
.confetti:nth-child(odd) { width: 6px; height: 10px; }
.pay-done h1, .pay-done .success-message { animation: pay-fade-up .5s ease-out .55s both; }

@keyframes pay-pop { 0% { transform: scale(.3); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
@keyframes pay-ring { 0% { transform: scale(1); opacity: .8; } 100% { transform: scale(1.9); opacity: 0; } }
@keyframes pay-draw { to { stroke-dashoffset: 0; } }
@keyframes pay-burst {
    0% { transform: translate(-50%, -50%) scale(.4); opacity: 1; }
    100% { transform: translate(calc(-50% + var(--x)), calc(-50% + var(--y))) rotate(var(--r)) scale(1); opacity: 0; }
}
@keyframes pay-fade-up { 0% { transform: translateY(8px); opacity: 0; } 100% { transform: none; opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
    .success-icon.is-celebrating, .success-icon.is-celebrating::after, .confetti,
    .pay-done h1, .pay-done .success-message { animation: none; }
    .success-icon.is-celebrating::after, .confetti { display: none; }
    .check-draw { animation: none; stroke-dashoffset: 0; }
}
.pub-success h1 { font-size: 1.5rem; margin-bottom: 6px; }
.success-message { color: #3d3c63; margin-bottom: 4px; }
.success-event { color: var(--muted); font-size: .9rem; margin-bottom: 18px; }
.box { background: var(--surface-soft); border-radius: 20px; padding: 16px 18px; margin: 0 0 18px; text-align: left; }
.box p { display: flex; justify-content: space-between; align-items: baseline; gap: 14px; margin: 0; padding: 9px 0; border-top: 1px solid var(--line); color: var(--muted); font-size: .88rem; }
.box p:first-child { border-top: 0; }
.box strong { color: var(--ink); font-size: .92rem; text-align: right; word-break: break-all; font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; }
.box .box-total strong { font-family: var(--font); font-size: 1.4rem; font-weight: 800; color: var(--primary-deep); word-break: normal; }
.pub-success .notice { text-align: left; }

/* pembayaran Snap embed: ringkasan + form bayar */
.pub-wrap-pay { max-width: 1080px; }
.pay-layout { display: grid; gap: 18px; }
.pay-card { margin-top: 0; padding: 20px 10px 12px; }
.pay-title { font-size: 1.15rem; margin: 0 12px 14px; }
.pay-card .notice { margin: 0 12px 14px; }
/* snap.js memberi iframe width/height "inherit": ukuran eksplisit di sini yang menentukan ukuran form
   (tanpa ini iframe jatuh ke minimum 320x560 bawaan Snap). Iframe lintas-domain tidak bisa diukur
   otomatis, jadi tinggi dibuat cukup untuk daftar metode pembayaran tanpa scroll internal. */
.snap-container { width: 100%; height: 900px; border-radius: 16px; overflow: hidden; }
.snap-loading { color: var(--muted); text-align: center; padding: 80px 0; margin: 0; }

@media (min-width: 640px) {
    .pub-wrap { padding-top: 32px; }
    .pub-hero h1 { font-size: 1.9rem; }
    .pub-card { padding: 30px 32px 32px; }
    .pay-card { padding: 26px 20px 16px; }
}
@media (min-width: 900px) {
    .pub-wrap-pay .pay-layout { grid-template-columns: minmax(300px, 380px) 1fr; align-items: start; }
    .pub-wrap-pay .pub-success { position: sticky; top: 24px; }
}
/* ---------------------------------------------------------- link publik */
.public-link { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.public-link .mono { word-break: break-all; }
.public-link-box {
    display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
    background: var(--info-bg); border-radius: var(--radius-sm); padding: 14px 18px; margin: 0 0 18px;
}
.public-link-box .label { display: block; font-size: .75rem; font-weight: 700; color: var(--primary-deep); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 4px; }
.public-link-box a.mono { word-break: break-all; font-weight: 600; }

/* ------------------------------------------------------------ form builder */
.builder-grid { display: grid; grid-template-columns: minmax(280px, 400px) minmax(0, 1fr); gap: 22px; align-items: start; }
.builder-col > form:not([style]) { margin-bottom: 0; }
@media (max-width: 900px) {
    .builder-grid { grid-template-columns: 1fr; }
}

/* ------------------------------------------------------ langkah pengaturan event */
.next-steps { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; margin: 0 0 20px; }
.next-steps-title { display: block; font-size: .75rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 12px; }
.next-steps-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.next-step {
    display: flex; align-items: flex-start; gap: 12px; text-decoration: none; color: var(--ink);
    background: var(--surface-soft); border-radius: var(--radius-sm); padding: 14px 16px; transition: background .15s, box-shadow .15s;
}
.next-step:hover { background: var(--info-bg); text-decoration: none; box-shadow: 0 4px 12px rgba(111, 95, 214, .16); }
.next-step-num {
    flex: 0 0 auto; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
    background: linear-gradient(135deg, var(--primary), var(--pink)); color: #fff; font-weight: 700; font-size: .85rem;
}
.next-step strong { display: block; font-size: .92rem; margin-bottom: 2px; }
.next-step small { display: block; color: var(--muted); font-size: .78rem; line-height: 1.4; }
.next-steps-note { margin: 14px 0 0; font-size: .85rem; color: var(--muted); }
.next-steps-note a { font-weight: 600; }
