/* ==========================================================================
   SIPAK — public site design layer (everything non-auth).
   Loaded after the Metronic bundle and tokens.css (shared with dashboards).
   Pages use: .pg-hero (via @section('page_title')), .pg-head, .pg-card,
   .pg-notice, plus restyled Bootstrap/Metronic .btn .form-* .card .table.
   ========================================================================== */

:root {
    /* Recolor Metronic/Bootstrap in one place: violet -> brand indigo */
    --bs-primary: var(--brand-600);
    --bs-primary-rgb: 79, 70, 229;
    --bs-primary-active: var(--brand-700);
    --bs-primary-light: var(--brand-50);
    --bs-primary-clarity: rgba(79, 70, 229, .2);
    --bs-primary-bg-subtle: var(--brand-100);
    --bs-primary-border-subtle: var(--brand-200);
    --bs-link-color: var(--brand-600);
    --bs-link-color-rgb: 79, 70, 229;
    --bs-link-hover-color: var(--brand-700);
    --bs-link-hover-color-rgb: 67, 56, 202;
    --bs-font-sans-serif: var(--font);
    --bs-body-font-family: var(--font);
    --bs-border-radius: 12px;
}

/* ---------- Base ---------- */
body.pub {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0;
    font-family: var(--font);
    color: var(--ink);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

.pub h1,
.pub h2,
.pub h3,
.pub h4,
.pub h5,
.pub h6 {
    font-family: var(--font);
    color: var(--ink);
    letter-spacing: -.01em;
}

.pub a {
    text-decoration: none;
}

.pub a:not(.btn):hover {
    text-decoration: underline;
}

.pub :focus-visible {
    outline: 2px solid var(--brand-600);
    outline-offset: 2px;
}

.pg-container {
    width: 100%;
    max-width: 1240px;
    margin: 0 auto;
    padding-left: clamp(16px, 3vw, 28px);
    padding-right: clamp(16px, 3vw, 28px);
}

#zoomContainer {
    display: flex;
    flex: 1 0 auto;
    flex-direction: column;
    min-height: 100%;
}

.pg-main {
    flex: 1 0 auto;
    padding-top: 28px;
    padding-bottom: 56px;
}

.pub .text-ellipsis {
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 1;
}

/* ---------- Header ---------- */
.pg-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
}

.pg-header__bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 68px;
}

.pg-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--brand-700);
}

.pg-brand:hover {
    text-decoration: none !important;
}

/* The uploaded logo can be wide (city + Capil marks side by side), so fix the height and let width follow. */
.pg-brand img {
    width: auto;
    height: 52px;
    max-width: 150px;
    object-fit: contain;
}

.pg-brand strong {
    display: block;
    font-size: 19px;
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: .3px;
}

.pg-brand small {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: var(--muted);
}

.pg-nav {
    display: flex;
    align-items: center;
    gap: 4px;
}

.pg-nav a:not(.btn) {
    padding: 9px 14px;
    font-size: 14.5px;
    font-weight: 600;
    color: #475569;
    border-radius: 10px;
}

.pg-nav a:not(.btn):hover {
    color: var(--brand-700);
    background: var(--brand-50);
    text-decoration: none;
}

.pg-nav a[aria-current="page"] {
    color: var(--brand-700);
    background: var(--brand-50);
}

.pg-nav .btn {
    height: 40px;
    margin-left: 8px;
    padding: 0 18px;
    font-size: 14.5px;
}

.pg-nav-toggle {
    display: none;
    width: 42px;
    height: 42px;
    place-items: center;
    border: 1.5px solid var(--line);
    border-radius: 10px;
    background: var(--surface);
    color: var(--ink);
    cursor: pointer;
}

.pg-nav-toggle svg {
    width: 22px;
    height: 22px;
    stroke: currentColor;
}

@media (max-width: 860px) {
    .pg-nav-toggle {
        display: grid;
    }

    .pg-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 2px;
        padding: 10px clamp(16px, 3vw, 28px) 16px;
        background: var(--surface);
        border-bottom: 1px solid var(--line);
        box-shadow: var(--shadow);
    }

    .pg-nav.is-open {
        display: flex;
    }

    .pg-nav .btn {
        margin: 8px 0 0;
        height: 46px;
    }
}

@media (max-width: 480px) {
    .pg-brand small {
        display: none;
    }
}

/* ---------- Page hero (same indigo as the auth screens) ---------- */
.pg-hero {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    color: #fff;
    border-radius: 0 0 32px 32px;
    background:
        radial-gradient(520px 320px at 92% 0%, rgba(129, 140, 248, .6), transparent 70%),
        radial-gradient(380px 260px at 0% 120%, rgba(255, 199, 0, .16), transparent 70%),
        linear-gradient(135deg, var(--brand-900) 0%, var(--brand-700) 55%, #1e1b4b 100%);
}

.pg-hero::before,
.pg-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
}

/* dot grid */
.pg-hero::before {
    background: radial-gradient(rgba(255, 255, 255, .2) 1.2px, transparent 1.6px) 0 0 / 24px 24px;
    -webkit-mask-image: linear-gradient(100deg, #000 0%, transparent 55%);
    mask-image: linear-gradient(100deg, #000 0%, transparent 55%);
}

/* concentric rings */
.pg-hero::after {
    background: repeating-radial-gradient(circle at 92% 40%, transparent 0 48px, rgba(255, 255, 255, .09) 48px 49px);
    -webkit-mask-image: radial-gradient(circle at 92% 40%, #000 0, transparent 55%);
    mask-image: radial-gradient(circle at 92% 40%, #000 0, transparent 55%);
}

.pg-hero .pg-container {
    padding-top: clamp(28px, 4vw, 40px);
    padding-bottom: clamp(36px, 5vw, 56px);
}

.pg-crumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 10px;
    margin: 0 0 18px;
    padding: 0;
    list-style: none;
    font-size: 13.5px;
    font-weight: 600;
    color: rgba(255, 255, 255, .8);
}

.pg-crumb li + li::before {
    content: "";
    display: inline-block;
    width: 6px;
    height: 6px;
    margin-right: 10px;
    border: solid currentColor;
    border-width: 1.5px 1.5px 0 0;
    opacity: .6;
    transform: rotate(45deg);
}

.pub .pg-crumb a {
    color: inherit;
}

.pub .pg-crumb a:hover,
.pg-crumb [aria-current] {
    color: #fff;
}

.pub .pg-hero h1 {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 0;
    color: #fff;
    font-size: clamp(28px, 3.8vw, 44px);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -.03em;
}

/* gold bar beside the title */
.pg-hero h1::before {
    content: "";
    flex: none;
    width: 6px;
    height: 1.05em;
    border-radius: 3px;
    background: linear-gradient(180deg, #ffd95e, #ffc700);
}

.pg-hero p {
    max-width: 62ch;
    margin: 12px 0 0 22px;
    font-size: 16px;
    line-height: 1.65;
    color: rgba(255, 255, 255, .88);
}

@media (max-width: 600px) {
    .pg-hero p {
        margin-left: 0;
    }
}

/* ---------- Shared components ---------- */
.pg-head {
    margin: 44px 0 22px;
}

.pg-head:first-child {
    margin-top: 8px;
}

.pub .pg-head h2 {
    margin: 0;
    font-size: clamp(21px, 2.4vw, 26px);
    font-weight: 800;
}

.pg-head p {
    margin: 6px 0 0;
    font-size: 14.5px;
    color: var(--muted);
}

.pg-card {
    height: 100%;
    padding: 24px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.pub .pg-card__title {
    margin: 0 0 8px;
    font-size: 17px;
    font-weight: 800;
}

.pg-card__text {
    margin: 0 0 18px;
    font-size: 14.5px;
    line-height: 1.6;
    color: var(--muted);
}

.pg-notice {
    display: flex;
    gap: 14px;
    padding: 16px 18px;
    background: var(--brand-50);
    border: 1px solid var(--brand-200);
    border-radius: var(--radius);
}

.pg-notice>i {
    flex: 0 0 auto;
    margin-top: 2px;
    font-size: 22px;
    color: var(--brand-600);
}

.pg-notice strong {
    display: block;
    margin-bottom: 4px;
    font-weight: 800;
}

.pg-notice p,
.pg-notice div {
    margin: 0;
    font-size: 14px;
    line-height: 1.6;
    color: #475569;
}

.pg-grid {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
    gap: 24px;
    align-items: start;
}

@media (max-width: 991px) {
    .pg-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

.pg-modal {
    border: 0;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 24px 60px -20px rgba(15, 23, 42, .45);
}

.pg-modal .modal-header {
    padding: 18px 22px;
    border-bottom: 1px solid var(--line);
}

.pg-modal .modal-title {
    font-size: 17px;
    font-weight: 800;
}

.pg-modal .modal-body {
    padding: 22px;
}

/* ---------- Restyled Bootstrap / Metronic parts ---------- */
.pub .text-muted,
.pub .text-gray-500,
.pub .text-gray-600,
.pub .dataTables_wrapper .dataTables_info,
.pub .dataTables_wrapper label {
    color: var(--muted) !important;
}

.pub .card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.pub .card-body {
    padding: 24px;
}

.pub .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: var(--font);
    font-weight: 700;
    border-radius: 12px;
    touch-action: manipulation;
    transition: background-color .15s ease, border-color .15s ease, box-shadow .15s ease, transform .05s ease;
}

.pub .btn:active {
    transform: translateY(1px);
}

.pub .btn:not(.btn-sm):not(.btn-icon) {
    min-height: 46px;
    padding: 0 20px;
}

.pub .btn-sm {
    border-radius: 10px;
}

.pub .btn.btn-primary {
    box-shadow: 0 8px 18px -10px rgba(79, 70, 229, .8);
}

.pub .btn:focus-visible {
    box-shadow: 0 0 0 4px var(--focus);
    outline: none;
}

.pub .btn i {
    line-height: 1;
}

.pub .form-label,
.pub .form-group>label {
    display: block;
    margin-bottom: 8px;
    font-size: 13.5px;
    font-weight: 600;
    color: #334155;
}

.pub .form-control,
.pub .form-select {
    min-height: 48px;
    font-family: var(--font);
    font-size: 15px;
    color: var(--ink);
    background-color: var(--surface);
    border: 1.5px solid var(--field-border);
    border-radius: 12px;
    box-shadow: none;
}

.pub textarea.form-control {
    min-height: 96px;
}

.pub .form-control:hover,
.pub .form-select:hover {
    border-color: var(--muted);
}

.pub .form-control:focus,
.pub .form-select:focus {
    border-color: var(--brand-600);
    box-shadow: 0 0 0 4px var(--focus);
}

.pub .form-control::placeholder {
    color: var(--muted-2);
}

.pub input:not([type="checkbox"]):not([type="radio"]):read-only,
.pub textarea:read-only {
    background-color: #f8fafc;
    cursor: not-allowed;
}

.pub .select2-container .select2-selection--single {
    min-height: 48px;
    border: 1.5px solid var(--field-border);
    border-radius: 12px;
}

.pub .message-error {
    display: block;
    margin-top: 6px;
    font-size: 12.5px;
    color: var(--danger);
}

.pub .table {
    --bs-table-striped-bg: #f8fafc;
}

.pub .table thead,
.pub table thead {
    background-color: var(--brand-50);
}

.pub .table thead th {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--brand-800);
    border-bottom: 0;
}

.pub .table:not(.table-bordered) td:first-child,
.pub .table:not(.table-bordered) th:first-child {
    padding-left: 16px;
}

.pub .alert {
    border-radius: var(--radius);
}

.pub .alert-primary {
    background: var(--brand-50);
    border-color: var(--brand-200);
    color: #334155;
}

.pub .b-dashed {
    border-style: dashed;
}

.pub .accordion-header {
    cursor: pointer;
    align-items: center;
}

.pub .accordion-header h3 {
    font-weight: 800;
}

.pub .modal-content {
    border: 0;
    border-radius: 18px;
}

.pub .dataTables_length select,
.pub .dataTables_filter input {
    width: auto;
    min-height: 40px;
    margin: 0 6px;
}

.pub .dataTables_wrapper .pagination .page-item.active .page-link {
    background: var(--brand-600);
    border-color: var(--brand-600);
}

/* ---------- Footer ---------- */
.pg-footer {
    flex-shrink: 0;
    background: var(--surface);
    border-top: 1px solid var(--line);
}

.pg-footer .pg-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding-top: 18px;
    padding-bottom: 18px;
    padding-right: 84px; /* keep clear of the floating tools */
    font-size: 13.5px;
    color: var(--muted);
}

.pg-footer img {
    height: 44px;
    width: auto;
}

@media (max-width: 640px) {
    .pg-footer .pg-container {
        flex-direction: column;
        text-align: center;
    }
}

/* ---------- Floating tools: chat + accessibility panel ---------- */
.pg-tools {
    position: fixed;
    right: 16px;
    bottom: 16px;
    z-index: 90;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
}

.pg-tools__btn {
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    padding: 0;
    border: 2px solid #fff;
    border-radius: 50%;
    font-size: 24px;
    line-height: 1;
    color: #fff;
    background: var(--brand-600);
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: background-color .15s ease;
}

.pg-tools__btn:hover {
    background: var(--brand-700);
    text-decoration: none;
}

.pg-tools__btn i {
    font-size: 26px;
    color: inherit; /* the vendor theme paints bare <i> grey (#99a1b7) */
}

.pg-tools__btn--wa {
    background: #0f9b88;
}

.pg-tools__btn--wa:hover {
    background: #0b7a6a;
}

.pg-tools__panel {
    width: min(332px, calc(100vw - 32px));
    padding: 16px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: 0 18px 40px -16px rgba(15, 23, 42, .35);
}

.pg-tools__panel[hidden] {
    display: none;
}

.pg-tools__title {
    margin: 0 0 12px;
    font-size: 15px;
    font-weight: 800;
    color: var(--ink);
}

.pg-tools__row span {
    white-space: nowrap;
}

.pg-tools__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--ink);
    border-top: 1px solid var(--line);
}

.pg-tools__zoom {
    display: flex;
    overflow: hidden;
    border: 1.5px solid var(--field-border);
    border-radius: 12px;
}

.pg-tools__zoom button {
    min-width: 44px;
    height: 44px;
    padding: 0 8px;
    font: inherit;
    font-size: 16px;
    font-weight: 700;
    color: var(--brand-800);
    background: var(--surface);
    border: 0;
    cursor: pointer;
}

.pg-tools__zoom button+button {
    border-left: 1.5px solid var(--line);
}

.pg-tools__zoom button:hover {
    background: var(--brand-50);
}

.pg-tools__zoom #pgZoomValue {
    min-width: 62px;
    font-size: 14px;
    font-variant-numeric: tabular-nums;
}

.pg-tools__switch {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    width: 100%;
    min-height: 52px;
    padding: 10px 0 0;
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    text-align: left;
    color: var(--ink);
    background: none;
    border: 0;
    border-top: 1px solid var(--line);
    cursor: pointer;
}

.pg-tools__switch i {
    margin-right: 4px;
    color: var(--brand-600);
}

.pg-tools__knob {
    position: relative;
    flex: 0 0 auto;
    width: 44px;
    height: 26px;
    background: var(--brand-600);
    border-radius: 999px;
    transition: background-color .15s ease;
}

.pg-tools__knob::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 21px;
    width: 20px;
    height: 20px;
    background: #fff;
    border-radius: 50%;
    transition: left .15s ease;
}

.pg-tools__switch.tts-disabled .pg-tools__knob {
    background: var(--muted-2);
}

.pg-tools__switch.tts-disabled .pg-tools__knob::after {
    left: 3px;
}

.pg-tools__switch.tts-disabled i {
    color: var(--muted);
}

@media (prefers-reduced-motion: reduce) {

    .pub *,
    .pub *::before,
    .pub *::after {
        animation-duration: .001ms !important;
        transition-duration: .001ms !important;
    }
}
