/* ============================================================
   CCF Baliuag — Data Privacy Consent App
   Light mode · mobile-first · app-style UI
   ============================================================ */

:root {
    --brand:        #1CA0B3;
    --brand-dark:   #157E8D;
    --brand-darker: #0E5C67;
    --brand-soft:   #E7F6F8;
    --brand-tint:   #F1FAFB;

    --ink:      #14252A;
    --ink-soft: #4A5C61;
    --muted:    #8A9A9E;
    --line:     #E4EBED;

    --bg:      #F4F8F9;
    --card:    #FFFFFF;
    --danger:  #D64545;
    --success: #2A9D8F;
    --amber:   #E9A93B;

    --radius:    18px;
    --radius-sm: 12px;
    --shadow:    0 10px 30px rgba(20, 60, 70, 0.08);
    --shadow-sm: 0 2px 10px rgba(20, 60, 70, 0.06);

    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font);
    color: var(--ink);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    line-height: 1.5;
}

a { color: var(--brand-dark); }

/* ---- App shell: a phone-width column centered on wide screens ---- */
.app {
    max-width: 480px;
    margin: 0 auto;
    min-height: 100vh;
    background: var(--bg);
    position: relative;
    box-shadow: 0 0 60px rgba(0,0,0,0.05);
}

.pad { padding: 20px; }

/* ---- Top brand bar ---- */
.topbar {
    background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%);
    color: #fff;
    padding: 22px 20px 26px;
    border-radius: 0 0 26px 26px;
    position: relative;
}
.topbar .brand-row {
    display: flex;
    align-items: center;
    gap: 12px;
}
.topbar .logo {
    width: 44px; height: 44px;
    background: #fff;
    border-radius: 12px;
    display: grid; place-items: center;
    padding: 5px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}
.topbar .logo img { width: 100%; height: 100%; object-fit: contain; }
.topbar h1 { font-size: 17px; margin: 0; font-weight: 700; letter-spacing: .2px; }
.topbar .sub { font-size: 12px; opacity: .9; margin-top: 1px; }

.badge-law {
    display: inline-block;
    margin-top: 14px;
    background: rgba(255,255,255,0.16);
    border: 1px solid rgba(255,255,255,0.28);
    padding: 5px 11px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .3px;
}

/* ---- Cards ---- */
.card {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 18px;
    margin-bottom: 16px;
    border: 1px solid var(--line);
}
.card h2 { font-size: 16px; margin: 0 0 4px; }
.card .hint { font-size: 13px; color: var(--ink-soft); margin: 0 0 14px; }

/* ---- Event header inside form ---- */
.event-head {
    display: flex; align-items: center; gap: 12px;
    margin-bottom: 4px;
}
.event-type-pill {
    font-size: 11px; font-weight: 700; color: #fff;
    padding: 4px 10px; border-radius: 999px; letter-spacing: .3px;
    background: var(--brand);
}
.event-meta { font-size: 13px; color: var(--ink-soft); }
.event-meta strong { color: var(--ink); }

/* ---- Form fields ---- */
label.fld { display: block; margin-bottom: 14px; }
label.fld > span {
    display: block;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--ink-soft);
    margin-bottom: 6px;
}
.req { color: var(--danger); }

input[type=text], input[type=tel], input[type=email], input[type=date],
input[type=password], select, textarea {
    width: 100%;
    font-family: inherit;
    font-size: 15px;
    color: var(--ink);
    background: #fff;
    border: 1.5px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 13px 14px;
    outline: none;
    transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px var(--brand-soft);
}
textarea { resize: vertical; min-height: 72px; }

/* ---- Name search autocomplete ---- */
.search-wrap { position: relative; }
.search-icon {
    position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
    color: var(--muted); pointer-events: none;
}
.search-wrap input { padding-left: 42px; }
.search-status {
    position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
    font-size: 12px; color: var(--muted);
}
.spinner {
    width: 15px; height: 15px; border: 2px solid var(--brand-soft);
    border-top-color: var(--brand); border-radius: 50%;
    animation: spin .7s linear infinite; display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

.suggestions {
    list-style: none; margin: 6px 0 0; padding: 6px;
    background: #fff; border: 1px solid var(--line);
    border-radius: var(--radius-sm); box-shadow: var(--shadow);
    position: absolute; left: 0; right: 0; z-index: 30;
    max-height: 260px; overflow-y: auto;
}
.suggestions li {
    padding: 11px 12px; border-radius: 10px; cursor: pointer;
    display: flex; align-items: center; gap: 10px; font-size: 14.5px;
}
.suggestions li:hover, .suggestions li.active { background: var(--brand-tint); }
.suggestions li .avatar {
    width: 30px; height: 30px; border-radius: 50%; flex: none;
    background: var(--brand-soft); color: var(--brand-dark);
    display: grid; place-items: center; font-weight: 700; font-size: 12px;
}
.suggestions li .meta { font-size: 12px; color: var(--muted); }
.suggestions li.add-new { color: var(--brand-dark); font-weight: 600; }
.suggestions li.add-new .avatar { background: var(--brand); color: #fff; }

.selected-chip {
    display: none; align-items: center; gap: 10px;
    background: var(--brand-soft); border: 1px solid #CDE9ED;
    border-radius: var(--radius-sm); padding: 11px 14px; margin-top: 8px;
}
.selected-chip.show { display: flex; }
.selected-chip .avatar {
    width: 34px; height: 34px; border-radius: 50%; flex: none;
    background: var(--brand); color: #fff;
    display: grid; place-items: center; font-weight: 700; font-size: 13px;
}
.selected-chip .who { font-weight: 600; font-size: 14.5px; }
.selected-chip .tag { font-size: 11px; color: var(--brand-dark); }
.selected-chip .clear {
    margin-left: auto; background: none; border: none; color: var(--ink-soft);
    font-size: 20px; cursor: pointer; line-height: 1;
}

/* Optional contact details — collapsed behind a toggle for new people */
.add-details { margin-top: 10px; }
.new-tag {
    font-size: 12px; color: var(--brand-dark); display: flex; gap: 6px;
    align-items: center; margin-bottom: 8px;
}
.link-toggle {
    display: inline-flex; align-items: center; gap: 7px;
    background: none; border: none; cursor: pointer; font-family: inherit;
    font-size: 13.5px; font-weight: 600; color: var(--brand-dark); padding: 4px 0;
}
.link-toggle .tw {
    width: 20px; height: 20px; border-radius: 6px; background: var(--brand-soft);
    color: var(--brand-dark); display: grid; place-items: center;
    font-size: 15px; line-height: 1; flex: none;
}
.link-toggle .opt { color: var(--muted); font-weight: 400; }
.link-toggle:hover { color: var(--brand); }

.detail-fields {
    display: none; margin-top: 12px; padding-top: 14px;
    border-top: 1px dashed var(--line);
}
.detail-fields.show { display: block; }
.detail-hint { font-size: 12px; color: var(--muted); margin: 0 0 12px; }

/* ---- Consent checkbox ---- */
.consent-box {
    display: flex; gap: 12px; align-items: flex-start;
    background: var(--brand-tint); border: 1px solid #DCEEF1;
    border-radius: var(--radius-sm); padding: 14px; margin: 4px 0 16px;
    cursor: pointer;
}
.consent-box input { width: 20px; height: 20px; margin-top: 1px; accent-color: var(--brand); flex: none; }
.consent-box .txt { font-size: 13px; color: var(--ink-soft); }
.consent-box .txt a { font-weight: 600; }

/* ---- Policy block ---- */
.policy {
    font-size: 12.5px; color: var(--ink-soft); line-height: 1.55;
}
.policy h3 { font-size: 15px; color: var(--ink); margin: 0 0 10px; }
.policy h4 { font-size: 13px; color: var(--brand-dark); margin: 16px 0 4px; }
.policy ul, .policy ol { padding-left: 20px; margin: 6px 0; }
.policy li { margin-bottom: 3px; }

.policy-scroll {
    max-height: 300px; overflow-y: auto;
    border: 1px solid var(--line); border-radius: var(--radius-sm);
    padding: 14px; background: #FCFEFE;
}

/* ---- Buttons ---- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    width: 100%; font-family: inherit; font-size: 15.5px; font-weight: 600;
    padding: 15px 18px; border-radius: 14px; border: none; cursor: pointer;
    background: var(--brand); color: #fff; transition: transform .08s, background .15s, box-shadow .15s;
    box-shadow: 0 6px 16px rgba(28,160,179,0.28);
}
.btn:hover { background: var(--brand-dark); }
.btn:active { transform: translateY(1px); }
.btn:disabled { background: #B9CCD0; box-shadow: none; cursor: not-allowed; }
.btn.secondary { background: #fff; color: var(--brand-dark); border: 1.5px solid var(--line); box-shadow: var(--shadow-sm); }
.btn.secondary:hover { background: var(--brand-tint); }
.btn.danger { background: var(--danger); box-shadow: 0 6px 16px rgba(214,69,69,0.25); }
.btn.small { width: auto; padding: 9px 14px; font-size: 13px; border-radius: 10px; }
.btn.ghost { background: none; color: var(--brand-dark); box-shadow: none; width: auto; padding: 8px 10px; }

/* ---- Success screen ---- */
.done { text-align: center; padding: 30px 20px; }
.done .check {
    width: 84px; height: 84px; border-radius: 50%; margin: 0 auto 18px;
    background: var(--brand-soft); display: grid; place-items: center;
    animation: pop .35s ease;
}
@keyframes pop { 0% { transform: scale(.6); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
.done h2 { margin: 0 0 6px; font-size: 20px; }
.done p { color: var(--ink-soft); font-size: 14px; margin: 0 auto; max-width: 300px; }

/* ---- Toast / alerts ---- */
.alert {
    border-radius: var(--radius-sm); padding: 12px 14px; font-size: 13.5px;
    margin-bottom: 14px; border: 1px solid transparent;
}
.alert.error   { background: #FDECEC; color: #A32A2A; border-color: #F5C6C6; }
.alert.success { background: #E7F6F1; color: #1F7A6C; border-color: #BFE7DE; }

/* ---- Footer ---- */
.foot {
    text-align: center; font-size: 11.5px; color: var(--muted);
    padding: 22px 20px 30px;
}
.foot a { color: var(--brand-dark); }

/* ============================================================
   Admin
   ============================================================ */
.admin-body { background: #EEF3F4; }
.admin-shell { max-width: 960px; margin: 0 auto; padding: 0 0 40px; }

.admin-top {
    background: linear-gradient(135deg, var(--brand-dark) 0%, var(--brand-darker) 100%);
    color: #fff; padding: 16px 20px;
    display: flex; align-items: center; gap: 12px;
    position: sticky; top: 0; z-index: 40;
}
.admin-top .logo { width: 34px; height: 34px; background: #fff; border-radius: 9px; padding: 4px; display: grid; place-items: center; }
.admin-top .logo img { width: 100%; height: 100%; object-fit: contain; }
.admin-top h1 { font-size: 15px; margin: 0; font-weight: 700; }
.admin-top .sub { font-size: 11px; opacity: .85; }
.admin-top .right { margin-left: auto; display: flex; align-items: center; gap: 14px; font-size: 13px; }
.admin-top .right a { color: #fff; text-decoration: none; opacity: .9; }
.admin-top .right a:hover { opacity: 1; }

.admin-nav {
    background: #fff; border-bottom: 1px solid var(--line);
    display: flex; gap: 4px; padding: 0 12px; overflow-x: auto;
    position: sticky; top: 66px; z-index: 30;
}
.admin-nav a {
    padding: 14px 14px; font-size: 13.5px; font-weight: 600; color: var(--ink-soft);
    text-decoration: none; border-bottom: 3px solid transparent; white-space: nowrap;
}
.admin-nav a.active { color: var(--brand-dark); border-bottom-color: var(--brand); }
.admin-nav a:hover { color: var(--brand-dark); }

.admin-main { padding: 22px 20px; }
.page-title { font-size: 20px; margin: 0 0 2px; }
.page-sub { color: var(--ink-soft); font-size: 13.5px; margin: 0 0 20px; }

/* stat cards */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-bottom: 24px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.stat .n { font-size: 28px; font-weight: 700; color: var(--brand-dark); line-height: 1; }
.stat .l { font-size: 12.5px; color: var(--ink-soft); margin-top: 6px; }

/* tables */
.table-wrap { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.table-scroll { overflow-x: auto; }
table.grid { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.grid th {
    text-align: left; padding: 13px 16px; background: #F7FAFB; color: var(--ink-soft);
    font-size: 11.5px; text-transform: uppercase; letter-spacing: .4px; border-bottom: 1px solid var(--line);
    white-space: nowrap;
}
table.grid td { padding: 13px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.grid tr:last-child td { border-bottom: none; }
table.grid tr:hover td { background: #FAFDFD; }

.pill {
    display: inline-block; font-size: 11px; font-weight: 700; color: #fff;
    padding: 3px 9px; border-radius: 999px; white-space: nowrap;
}
.pill.soft { background: var(--brand-soft); color: var(--brand-dark); }
.pill.on   { background: var(--success); }
.pill.off  { background: var(--muted); }

.avatar-sm {
    width: 28px; height: 28px; border-radius: 50%; background: var(--brand-soft);
    color: var(--brand-dark); display: inline-grid; place-items: center;
    font-weight: 700; font-size: 11px; margin-right: 8px; vertical-align: middle;
}

.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 18px; }
.toolbar .grow { flex: 1 1 200px; }
.toolbar select, .toolbar input { padding: 10px 12px; font-size: 13.5px; }

.empty { text-align: center; padding: 46px 20px; color: var(--muted); }
.empty .ico { font-size: 40px; margin-bottom: 8px; opacity: .5; }

/* event grid (admin) */
.event-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.event-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; }
.event-card .et { display: inline-block; align-self: flex-start; font-size: 10.5px; font-weight: 700; color: #fff; padding: 3px 9px; border-radius: 999px; margin-bottom: 10px; }
.event-card h3 { font-size: 15.5px; margin: 0 0 4px; }
.event-card .when { font-size: 12.5px; color: var(--ink-soft); }
.event-card .count { font-size: 12.5px; color: var(--brand-dark); font-weight: 600; margin: 10px 0; }
.event-card .actions { display: flex; gap: 8px; margin-top: auto; flex-wrap: wrap; }

/* modal-ish form */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }

/* QR print sheet */
.qr-sheet { max-width: 420px; margin: 0 auto; text-align: center; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 30px 26px; }
.qr-sheet .qr-logo { width: 60px; margin: 0 auto 8px; display: block; }
.qr-kicker { font-size: 12px; letter-spacing: 2px; color: var(--muted); font-weight: 700; }
.qr-sheet h2 { font-size: 20px; margin: 6px 0 2px; }
.qr-sheet .qr-type { display: inline-block; color: #fff; background: var(--brand); font-size: 12px; font-weight: 700; padding: 4px 12px; border-radius: 999px; margin: 6px 0; }
.qr-sheet .qr-when { color: var(--ink-soft); font-size: 14px; margin: 4px 0 16px; }
.qr-img { width: 240px; height: 240px; margin: 0 auto; display: block; border: 10px solid #fff; }
.qr-cta { font-weight: 700; margin-top: 14px; font-size: 15px; }
.qr-url { font-size: 12px; color: var(--muted); word-break: break-all; margin-top: 6px; }
.qr-law { font-size: 11px; color: var(--muted); margin-top: 16px; border-top: 1px solid var(--line); padding-top: 12px; }

.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: linear-gradient(160deg, var(--brand-tint), #EAF3F4); }
.login-card { width: 100%; max-width: 360px; background: #fff; border-radius: 22px; box-shadow: var(--shadow); padding: 30px 26px; }
.login-card .logo { width: 60px; height: 60px; margin: 0 auto 14px; background: var(--brand-tint); border-radius: 16px; padding: 8px; display: grid; place-items: center; }
.login-card .logo img { width: 100%; height: 100%; object-fit: contain; }
.login-card h1 { text-align: center; font-size: 19px; margin: 0 0 2px; }
.login-card .sub { text-align: center; color: var(--ink-soft); font-size: 13px; margin: 0 0 22px; }

@media (max-width: 520px) {
    .form-grid { grid-template-columns: 1fr; }
    .admin-main { padding: 18px 14px; }
}

/* ---- Print: QR poster fills a proper A4 page ---- */
@media print {
    @page { size: A4 portrait; margin: 14mm; }
    html, body { background: #fff !important; }
    .no-print { display: none !important; }
    .admin-top, .admin-nav { display: none !important; }
    #linkHolder { display: none !important; }

    .admin-shell { max-width: none; padding: 0; }
    /* Centre the poster on the page instead of a small card up top */
    .admin-main {
        padding: 0; min-height: 252mm;
        display: flex; align-items: center; justify-content: center;
    }
    .qr-sheet {
        border: none; box-shadow: none; margin: 0;
        width: 100%; max-width: 172mm; padding: 0;
    }
    .qr-sheet .qr-logo { width: 26mm; margin: 0 auto 4mm; }
    .qr-kicker { font-size: 12pt; letter-spacing: 3px; }
    .qr-sheet h2 { font-size: 30pt; margin: 4mm 0 2mm; }
    .qr-sheet .qr-type { font-size: 13pt; padding: 2mm 9mm; margin: 3mm 0; }
    .qr-sheet .qr-when { font-size: 14pt; margin: 2mm 0 9mm; }
    .qr-img { width: 96mm; height: 96mm; border-width: 4mm; }
    .qr-cta { font-size: 19pt; margin-top: 9mm; }
    .qr-url { font-size: 10pt; margin-top: 3mm; }
    .qr-law { font-size: 9pt; margin-top: 9mm; padding-top: 5mm; }
}

/* ============================================================
   Compact layout — tighten spacing so everything fits small
   phones (iPhone SE 375×667 and 320px-wide devices) nicely.
   ============================================================ */
.pad { padding: 15px; }
.topbar { padding: 16px 16px 20px; border-radius: 0 0 22px 22px; }
.topbar .logo { width: 40px; height: 40px; }
.topbar h1 { font-size: 16px; }
.badge-law { margin-top: 11px; padding: 4px 10px; font-size: 10.5px; }

.card { padding: 15px; margin-bottom: 13px; border-radius: 16px; }
.card h2 { font-size: 15.5px; }
.card .hint { font-size: 12.5px; margin-bottom: 12px; }

label.fld { margin-bottom: 12px; }
label.fld > span { font-size: 12px; margin-bottom: 5px; }
input[type=text], input[type=tel], input[type=email], input[type=date],
input[type=password], select, textarea { padding: 12px 13px; font-size: 15px; border-radius: 11px; }
/* Keep room for the search icon — the shorthand above would otherwise reset it */
.search-wrap input { padding-left: 42px; }

.btn { padding: 14px 16px; font-size: 15px; border-radius: 13px; }
.event-type-pill { font-size: 10.5px; padding: 4px 9px; }
.event-meta { font-size: 12.5px; }

.suggestions li { padding: 10px; font-size: 14px; }
.selected-chip { padding: 10px 12px; }

.foot { padding: 18px 16px 26px; }

/* Very small phones (e.g. iPhone SE 1st gen, Galaxy Fold cover) */
@media (max-width: 360px) {
    .pad { padding: 12px; }
    .topbar { padding: 14px 14px 18px; }
    .topbar h1 { font-size: 15px; }
    .topbar .sub { font-size: 11px; }
    .topbar .logo { width: 36px; height: 36px; border-radius: 10px; }
    .badge-law { font-size: 10px; }
    .card { padding: 13px; }
    .card h2 { font-size: 15px; }
    .btn { padding: 13px 14px; font-size: 14.5px; }
    .done { padding: 24px 14px; }
    .done .check { width: 70px; height: 70px; }
    .done h2 { font-size: 18px; }
}

/* Short screens — let the policy sheet use the full height */
@media (max-height: 640px) {
    .policy-modal { height: 96vh; max-height: 96vh; }
}

/* ============================================================
   Registration Portal (index) — desktop / tablet first,
   collapses gracefully to a single column on phones.
   ============================================================ */
.portal-body { background: linear-gradient(180deg, #EAF4F5 0%, var(--bg) 240px); min-height: 100vh; }
.portal { max-width: 1120px; margin: 0 auto; padding: 26px 24px 40px; }

.portal-hero {
    background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%);
    color: #fff; border-radius: 26px; padding: 30px 34px;
    display: flex; align-items: center; justify-content: space-between; gap: 30px;
    box-shadow: 0 18px 44px rgba(21,126,141,0.28); flex-wrap: wrap;
}
.portal-hero .hero-left { display: flex; align-items: center; gap: 20px; }
.portal-hero .hero-logo {
    width: 78px; height: 78px; background: #fff; border-radius: 20px; flex: none;
    display: grid; place-items: center; padding: 10px; box-shadow: 0 8px 20px rgba(0,0,0,0.14);
}
.portal-hero .hero-logo img { width: 100%; height: 100%; object-fit: contain; }
.portal-hero .hero-kicker { font-size: 12.5px; text-transform: uppercase; letter-spacing: 1.5px; opacity: .85; }
.portal-hero h1 { font-size: 30px; margin: 2px 0 1px; font-weight: 800; letter-spacing: .3px; }
.portal-hero .hero-sub { font-size: 15px; opacity: .95; }
.portal-hero .badge-law { margin-top: 12px; }
.portal-hero .hero-note {
    max-width: 380px; background: rgba(255,255,255,0.13); border: 1px solid rgba(255,255,255,0.22);
    border-radius: 16px; padding: 16px 18px; font-size: 13.5px;
}
.portal-hero .hero-note strong { display: block; margin-bottom: 5px; font-size: 14.5px; }
.portal-hero .hero-note p { margin: 0; opacity: .92; line-height: 1.5; }

.portal-head { display: flex; align-items: baseline; gap: 12px; margin: 32px 4px 16px; flex-wrap: wrap; }
.portal-head h2 { font-size: 20px; margin: 0; }
.portal-head-sub { font-size: 13.5px; color: var(--ink-soft); }

.portal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 20px; }
.portal-card {
    background: var(--card); border: 1px solid var(--line); border-radius: 20px;
    padding: 22px; display: flex; flex-direction: column; box-shadow: var(--shadow-sm);
    transition: transform .14s ease, box-shadow .14s ease, border-color .14s;
}
.portal-card:hover { transform: translateY(-4px); box-shadow: 0 18px 40px rgba(20,60,70,0.12); border-color: #CFE6E9; }
.pc-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.pc-type { font-size: 11px; font-weight: 700; color: #fff; padding: 5px 12px; border-radius: 999px; letter-spacing: .3px; }
.pc-count { font-size: 12px; font-weight: 600; color: var(--brand-dark); background: var(--brand-soft); padding: 4px 11px; border-radius: 999px; }
.portal-card h3 { font-size: 19px; margin: 0 0 10px; line-height: 1.25; }
.pc-meta { font-size: 13.5px; color: var(--ink-soft); display: flex; flex-direction: column; gap: 3px; margin-bottom: 20px; }
.pc-cta { margin-top: auto; }
.pc-single { text-align: center; font-size: 12.5px; color: var(--muted); margin-top: 10px; text-decoration: none; }
.pc-single:hover { color: var(--brand-dark); text-decoration: underline; }

.portal-empty {
    background: var(--card); border: 1px solid var(--line); border-radius: 20px;
    padding: 50px 24px; text-align: center; color: var(--ink-soft);
}
.portal-empty .ico { font-size: 46px; opacity: .5; }
.portal-empty h3 { margin: 8px 0 4px; color: var(--ink); }
.portal-empty p { margin: 0 0 6px; }

.portal-foot { text-align: center; font-size: 12.5px; color: var(--muted); padding: 34px 20px 10px; }
.portal-foot a { color: var(--brand-dark); }

/* Tablet */
@media (max-width: 820px) {
    .portal-hero { padding: 26px; }
    .portal-hero h1 { font-size: 26px; }
    .portal-hero .hero-note { max-width: 100%; flex: 1 1 100%; }
}
/* Phone — stack the hero, single-column grid */
@media (max-width: 560px) {
    .portal { padding: 16px 14px 34px; }
    .portal-hero { border-radius: 20px; padding: 20px; gap: 18px; }
    .portal-hero .hero-left { gap: 14px; }
    .portal-hero .hero-logo { width: 58px; height: 58px; border-radius: 15px; }
    .portal-hero h1 { font-size: 22px; }
    .portal-hero .hero-sub { font-size: 13.5px; }
    .portal-hero .hero-note { font-size: 12.5px; padding: 13px 14px; }
    .portal-grid { grid-template-columns: 1fr; gap: 14px; }
    .portal-card { padding: 18px; border-radius: 16px; }
    .portal-head { margin: 24px 2px 12px; }
}

/* ============================================================
   Kiosk / registration-desk bar on the event form (e.php?kiosk=1)
   ============================================================ */
.desk-bar {
    max-width: 480px; margin: 0 auto; display: flex; align-items: center;
    justify-content: space-between; gap: 10px; padding: 10px 16px;
    background: #0E5C67; color: #fff; font-size: 13px;
}
.desk-bar .desk-tag { font-weight: 700; letter-spacing: .3px; display: flex; align-items: center; gap: 7px; }
.desk-bar .desk-switch {
    color: #fff; text-decoration: none; font-weight: 600; background: rgba(255,255,255,0.16);
    border: 1px solid rgba(255,255,255,0.28); padding: 6px 12px; border-radius: 999px;
}
.desk-bar .desk-switch:hover { background: rgba(255,255,255,0.26); }
.kiosk-count {
    display: none; margin-top: 16px; font-size: 14px; font-weight: 600; color: var(--brand-dark);
    background: var(--brand-tint); border: 1px solid #DCEEF1; border-radius: 12px; padding: 12px;
}
.back-events { display: inline-block; margin-top: 16px; }

/* ============================================================
   Registration form on PC / tablet — two-panel desk layout.
   Phones keep the single-column flow (this only kicks in wide).
   ============================================================ */
.desk-only { display: none; }

.steps-card h3 { font-size: 15px; margin: 0 0 14px; }
.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 15px; }
.steps li { display: flex; gap: 12px; align-items: flex-start; font-size: 13px; color: var(--ink-soft); line-height: 1.45; }
.steps li .n {
    width: 27px; height: 27px; border-radius: 50%; background: var(--brand-soft);
    color: var(--brand-dark); font-weight: 700; font-size: 13px;
    display: grid; place-items: center; flex: none;
}
.steps li strong { color: var(--ink); }

@media (min-width: 900px) {
    .app-event { max-width: 960px; background: transparent; box-shadow: none; }
    .app-event .topbar { border-radius: 20px; margin: 10px 10px 0; }
    .app-event .desk-bar { max-width: none; margin: 12px 10px 0; border-radius: 14px; padding: 12px 20px; font-size: 14px; }
    .app-event .pad { padding: 20px 10px 10px; }

    .desk-layout { display: grid; grid-template-columns: 0.82fr 1.18fr; gap: 22px; align-items: start; }
    .desk-info { position: sticky; top: 16px; display: flex; flex-direction: column; gap: 16px; }
    .desk-main { min-width: 0; }
    .desk-only { display: block; }

    /* Roomier, touch-friendly controls on desk hardware */
    .desk-main .card { padding: 28px; }
    .desk-main h2 { font-size: 18px; }
    .app-event .btn { padding: 16px 18px; font-size: 16px; }
    .app-event input, .app-event select, .app-event textarea { padding: 14px 15px; font-size: 16px; }
    .app-event .search-wrap input { padding-left: 44px; }
    .event-card-lg h2 { font-size: 21px; }
    .app-event .foot { padding-top: 26px; }
}

/* Large desktop — a touch more breathing room */
@media (min-width: 1200px) {
    .app-event { max-width: 1040px; }
    .desk-layout { gap: 28px; }
}
