/* ==========================================================================
   Pendaftaran Event
   - body.public : halaman peserta (dioptimalkan untuk usia 50+)
   - body.admin  : halaman admin
   ========================================================================== */

:root {
    /* Variabel tema di bawah ini bisa diganti admin (Admin > Tampilan); nilai berikut adalah bawaan. */
    --brand: #1d4c63;        /* warna tema: header, tombol */
    --brand-rgb: 29, 76, 99;
    --on-brand: #ffffff;     /* teks di atas warna tema (otomatis hitam/putih) */
    --brand-hover: #12394c;
    --brand-soft: #e6eef2;
    --brand-text: #1d4c63;   /* judul & tautan di kartu putih (otomatis digelapkan bila kurang kontras) */
    --bg: #f1f5f7;           /* warna background halaman */
    --on-bg: #16212a;        /* teks yang langsung di atas background */

    --ink: #16212a;          /* teks utama, kontras > 15:1 di atas putih */
    --muted: #46555f;        /* teks sekunder, kontras > 7:1 */
    --line: #5b6b73;         /* garis isian, kontras >= 3:1 */
    --card: #ffffff;
    --danger: #a8001c;       /* kontras > 7:1 di atas putih */
    --danger-bg: #fdecef;
    --ok: #17653a;
    --ok-bg: #e7f5ec;
}

/* ---------------------------------------------------------------- */
/* Halaman publik                                                    */
/* ---------------------------------------------------------------- */

body.public {
    background: var(--bg);
    color: var(--ink);
    font-size: 1.25rem;      /* 20px (ikut pengaturan zoom/ukuran huruf browser) */
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-text-size-adjust: 100%;
}

.public .wrap {
    width: 100%;
    max-width: 780px;
    margin: 0 auto;
    padding-left: 16px;
    padding-right: 16px;
}

.public main.wrap {
    flex: 1 0 auto;
    padding-top: 8px;
    padding-bottom: 32px;
}

.public .site-header {
    background: var(--brand);
    padding: 14px 0;
}

.public .site-header .brand {
    color: var(--on-brand);
    font-weight: 700;
    font-size: 1.15rem;
    letter-spacing: .03em;
    text-decoration: none;
}

.public .site-footer {
    color: var(--on-bg);
    font-size: .9rem;
    padding: 18px 0 26px;
    text-align: center;
}

.public a {
    color: var(--brand-text);
}

.public .on-bg {
    color: var(--on-bg);
}

/* Fokus yang jelas bagi pengguna keyboard / pembaca layar */
.public a:focus-visible,
.public button:focus-visible,
.public .form-control:focus {
    outline: 4px solid #f2a900;
    outline-offset: 2px;
}

.public .card-block {
    background: var(--card);
    border-radius: 16px;
    padding: 24px 22px;
    margin: 20px 0;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .14);
}

.public h2.section-title,
.public h1.section-title {
    color: var(--brand-text);
    font-size: 1.5rem;
    font-weight: 800;
    margin: 0 0 6px;
}

.public .lead-text {
    color: var(--muted);
    margin-bottom: 20px;
}

/* ----- Informasi event ----- */

.public .pill {
    display: inline-block;
    background: var(--brand);
    color: var(--on-brand);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .1em;
    font-size: .85rem;
    padding: 6px 20px;
    border-radius: 999px;
}

.public .event-title {
    color: var(--brand-text);
    font-weight: 800;
    font-size: 1.85rem;
    line-height: 1.25;
    margin: 14px 0 18px;
}

.public dl.details {
    margin: 0;
}

.public dl.details .item {
    display: flex;
    flex-wrap: wrap;
    gap: 0 16px;
    padding: 12px 0;
    border-top: 1px solid #d3dce1;
}

.public dl.details dt {
    flex: 0 0 8.5rem;
    color: var(--muted);
    font-weight: 600;
}

.public dl.details dd {
    flex: 1 1 14rem;
    margin: 0;
    font-weight: 700;
}

.public dl.details dd small {
    display: block;
    font-weight: 400;
    color: var(--muted);
    font-size: .95rem;
}

.public .event-note {
    margin: 16px 0 0;
    padding-top: 14px;
    border-top: 1px solid #d3dce1;
    color: var(--muted);
}

/* ----- Formulir pendaftaran ----- */

.public .reg-form .field-group {
    margin-bottom: 28px;
}

.public .reg-form label.form-label {
    display: block;
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--ink);
    margin: 0 0 2px;
}

.public .reg-form .form-text {
    display: block;
    font-size: 1rem;
    color: var(--muted);
    margin: 0 0 8px;
}

.public .reg-form .form-control {
    font-size: 1.25rem;
    min-height: 3.6rem;
    padding: 12px 16px;
    color: var(--ink);
    background-color: #fff;
    border: 2px solid var(--line);
    border-radius: 12px;
}

.public .reg-form textarea.form-control {
    min-height: 8.5rem;
    line-height: 1.45;
}

.public .reg-form .form-control:focus {
    border-color: var(--brand-text);
    box-shadow: 0 0 0 4px rgba(var(--brand-rgb), .28);
}

.public .reg-form .form-control.is-invalid {
    border-color: var(--danger);
    border-width: 3px;
    background-image: none;
    padding-right: 16px;
}

.public .reg-form .invalid-feedback {
    display: block;
    margin-top: 8px;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--danger);
}

.public .reg-form .invalid-feedback:empty {
    display: none;
}

/* Kolom jebakan bot: tidak terlihat, tidak bisa di-tab */
.public .hp-field {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.public .error-box {
    background: var(--danger-bg);
    border: 3px solid var(--danger);
    border-radius: 12px;
    color: var(--danger);
    padding: 14px 18px;
    margin-bottom: 24px;
    font-weight: 700;
}

.public .error-box ul {
    margin: 6px 0 0;
    padding-left: 1.2rem;
}

.public .btn-big {
    display: block;
    width: 100%;
    min-height: 4.2rem;
    padding: 12px 20px;
    font-size: 1.45rem;
    font-weight: 800;
    letter-spacing: .02em;
    text-align: center;
    text-decoration: none;
    color: var(--on-brand);
    background: var(--brand);
    border: 0;
    border-radius: 14px;
    cursor: pointer;
}

.public .btn-big:hover,
.public .btn-big:focus {
    background: var(--brand-hover);
    color: var(--on-brand);
}

.public .btn-big[disabled] {
    background: #5f7480;
    color: #fff;
    cursor: wait;
}

.public .btn-big.outline {
    background: #fff;
    color: var(--brand-text);
    border: 3px solid var(--brand-text);
}

.public .btn-big.outline:hover,
.public .btn-big.outline:focus {
    background: var(--brand-soft);
    color: var(--brand-text);
}

/* ----- Cover event ----- */

.public .cover-img {
    display: block;
    width: 100%;
    height: auto;
    max-height: 30rem;
    object-fit: contain;
    margin: 0 0 18px;
    border-radius: 12px;
    background: var(--brand-soft);
}

.public .btn-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.public .btn-row .btn-big {
    flex: 1 1 12rem;
    font-size: 1.2rem;
}

/* ----- Pemberitahuan ----- */

.public .notice-closed {
    text-align: center;
    border: 3px solid var(--line);
}

.public .notice-closed h2 {
    color: var(--ink);
    font-weight: 800;
    font-size: 1.6rem;
}

.public .alert {
    font-size: 1.1rem;
    border-width: 2px;
}

/* ----- Halaman sukses ----- */

.public .success-card {
    text-align: center;
    border-top: 8px solid var(--ok);
}

.public .success-icon {
    width: 96px;
    height: 96px;
    margin: 4px auto 12px;
}

.public .success-card h1 {
    color: var(--ok);
    font-size: 1.9rem;
    font-weight: 800;
    margin-bottom: 8px;
}

.public .success-card .details {
    text-align: left;
    margin-top: 22px;
}

.public .info-box {
    background: var(--ok-bg);
    border: 2px solid var(--ok);
    color: var(--ok);
    border-radius: 12px;
    padding: 12px 16px;
    margin: 16px 0 0;
    font-weight: 700;
    text-align: left;
}

/* ----- Daftar event di beranda ----- */

.public .event-link-card h2 {
    color: var(--brand-text);
    font-size: 1.5rem;
    font-weight: 800;
    margin: 10px 0 8px;
}

.public .event-link-card p {
    margin: 0 0 14px;
}

/* ----- Halaman error ----- */

.public .error-page h1 {
    color: var(--brand-text);
    font-weight: 800;
    font-size: 1.8rem;
}

/* Layar kecil */
@media (max-width: 480px) {
    .public .card-block {
        padding: 20px 16px;
        border-radius: 14px;
    }

    .public .event-title {
        font-size: 1.6rem;
    }

    .public dl.details dt {
        flex-basis: 100%;
        font-size: .95rem;
    }
}

/* ---------------------------------------------------------------- */
/* Halaman admin                                                     */
/* ---------------------------------------------------------------- */

body.admin {
    background: #f4f6f8;
}

.admin .navbar .logout {
    padding: 0.5rem 0;
    text-decoration: none;
    color: rgba(255, 255, 255, .55);
}

.admin .navbar .logout:hover {
    color: rgba(255, 255, 255, .85);
}

.admin .page-title {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.admin .page-title h1 {
    font-size: 1.6rem;
    margin: 0;
}

.admin .detail-list dt {
    font-weight: 600;
    color: #566;
}

.admin .detail-list dd {
    margin-bottom: .6rem;
}

.admin .wa-preview {
    background: #e7f7d8;
    border-radius: 12px;
    padding: 14px 16px;
    white-space: pre-wrap;
    word-wrap: break-word;
    font-size: .95rem;
    line-height: 1.45;
    min-height: 12rem;
    border: 1px solid #c8e3b0;
}

.admin textarea.template-input {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: .9rem;
    line-height: 1.45;
}

.admin .ph-chip {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: .85rem;
}

.admin .grid-view td,
.admin .grid-view th {
    vertical-align: top;
}

.admin .addr-cell {
    white-space: pre-line;
}

/* Pratinjau tema (Admin > Tampilan): memakai variabel yang sama dengan halaman peserta */
.admin .theme-preview {
    --ink: #16212a;
    --muted: #46555f;
    background: var(--bg);
    border: 1px solid #ccd5da;
    border-radius: 12px;
    overflow: hidden;
    color: var(--ink);
}

.admin .theme-preview .tp-header {
    background: var(--brand);
    color: var(--on-brand);
    font-weight: 700;
    padding: 12px 16px;
}

.admin .theme-preview .tp-body {
    padding: 16px;
}

.admin .theme-preview .tp-card {
    background: #fff;
    border-radius: 14px;
    padding: 18px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .14);
}

.admin .theme-preview .tp-pill {
    display: inline-block;
    background: var(--brand);
    color: var(--on-brand);
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    padding: 4px 14px;
    border-radius: 999px;
}

.admin .theme-preview .tp-title {
    color: var(--brand-text);
    font-size: 1.35rem;
    font-weight: 800;
    margin: 10px 0 6px;
}

.admin .theme-preview .tp-link {
    color: var(--brand-text);
    text-decoration: underline;
}

.admin .theme-preview .tp-btn {
    background: var(--brand);
    color: var(--on-brand);
    text-align: center;
    font-weight: 800;
    padding: 14px;
    border-radius: 12px;
    margin-top: 10px;
}

.admin .theme-preview .tp-btn-outline {
    background: #fff;
    color: var(--brand-text);
    border: 3px solid var(--brand-text);
    padding: 11px;
}

.admin .theme-preview .tp-foot {
    color: var(--on-bg);
    font-size: .85rem;
    text-align: center;
    padding: 14px 0 0;
}
