/* Portal karier MAA Group — daftar lowongan, detail, dan form lamaran. */

:root {
    --bg: #f4f2ef;
    --surface: #ffffff;
    --surface-2: #f1eeea;
    --ink: #1c1917;
    --ink-2: #57534e;
    --ink-3: #78716c;
    --line: #e7e3de;
    --line-strong: #d6d1ca;

    --brand: #933b2f;
    --brand-hover: #7b3026;
    --brand-soft: #f7e6e2;

    --warn-bg: #f8e9d2;
    --warn-ink: #7a4a12;
    --ok-bg: #e3f0e5;
    --ok-ink: #2e6a3e;
    --info-bg: #e7eefa;
    --info-ink: #2b4f8c;
    --danger: #b42318;

    --radius: 16px;
    --radius-sm: 10px;
    --shadow: 0 1px 2px rgba(28, 25, 23, .04), 0 4px 16px rgba(28, 25, 23, .05);
    --shadow-lg: 0 24px 64px rgba(28, 25, 23, .22);
    --focus: 0 0 0 3px rgba(147, 59, 47, .25);

    --top-h: 0px; /* header Porto tidak sticky di HP (stickyEnableOnMobile: false) */
    --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

/*
 * Halaman memakai template situs (navbar.php, banner, footer.php dari tema Porto).
 * Semua gaya portal dibatasi di dalam .cp (konten, dialog form, toast) supaya
 * tidak mengubah navbar/footer, dan reset di bawah menetralkan gaya global
 * Porto/Bootstrap (p, h1-h6, legend, dt, a:hover) di dalam .cp.
 */

.cp, .cp *, .cp *::before, .cp *::after { box-sizing: border-box; }

.cp {
    color: var(--ink);
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}
#main.cp { background: var(--surface); }

/* :where() menjaga spesifisitas reset tetap rendah, supaya kelas .cp-* selalu menang. */
:where(.cp) :is(h1, h2, h3, h4, h5, h6) { font-family: inherit; color: inherit; font-weight: 700; line-height: 1.3; letter-spacing: normal; text-transform: none; margin: 0; }
:where(.cp) p { margin: 0; color: inherit; font-size: inherit; line-height: inherit; }
:where(.cp) legend { float: none; width: auto; font-size: inherit; line-height: inherit; }
:where(.cp) dt { font-weight: 400; }
:where(.cp) dd { margin: 0; }
:where(.cp) label { margin: 0; font-weight: inherit; }
:where(.cp) img { max-width: 100%; display: block; }
:where(.cp) a { color: inherit; }
:where(.cp) button, :where(.cp) input, :where(.cp) select { font: inherit; color: inherit; letter-spacing: normal; }
.cp a:hover, .cp a:focus { text-decoration: none; }
.cp .cp-card__link:hover { color: inherit; }
.cp svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.cp [hidden] { display: none !important; }

.cp-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.cp-skip { position: absolute; left: 16px; top: -48px; z-index: 50; padding: 10px 14px; background: var(--ink); color: #fff !important; border-radius: 8px; text-decoration: none; }
.cp-skip:focus { top: 12px; }

.cp-wrap { width: 100%; max-width: 1320px; margin: 0 auto; padding: 0 16px; }

/* ---------- Tombol & kontrol dasar ---------- */

.cp-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 44px; padding: 0 20px;
    border: 1px solid transparent; border-radius: 12px;
    font-weight: 700; font-size: 15px; text-decoration: none; white-space: nowrap;
    cursor: pointer; transition: background-color .15s, border-color .15s, color .15s;
}
.cp-btn:focus-visible, .cp-icon-btn:focus-visible, .cp-chip:focus-visible, .cp-link:focus-visible,
.cp-card__link:focus-visible { outline: none; box-shadow: var(--focus); }
.cp-btn--primary { background: var(--brand); color: #fff; }
.cp-btn--primary:hover { background: var(--brand-hover); }
.cp-btn--primary:disabled { background: #c9b8b4; cursor: not-allowed; }
.cp-btn--outline { background: var(--surface); border-color: var(--line-strong); color: var(--ink); }
.cp-btn--outline:hover { border-color: var(--ink-3); }
.cp-btn--block { width: 100%; }

.cp-icon-btn {
    display: inline-grid; place-items: center;
    width: 44px; height: 44px;
    background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
    color: var(--ink); cursor: pointer;
}
.cp-icon-btn:hover { border-color: var(--line-strong); }
.cp-icon-btn[aria-pressed="true"] { color: var(--brand); border-color: var(--brand); background: var(--brand-soft); }
.cp-icon-btn[aria-pressed="true"] svg { fill: currentColor; }

.cp-link { background: none; border: 0; padding: 4px 2px; color: var(--brand); font-weight: 600; font-size: 14px; cursor: pointer; border-radius: 6px; }

.cp-chip {
    display: inline-flex; align-items: center; gap: 6px;
    min-height: 40px; padding: 0 16px;
    background: var(--surface); border: 1px solid var(--line-strong); border-radius: 999px;
    font-size: 14px; font-weight: 500; white-space: nowrap; cursor: pointer;
}
.cp-chip svg { width: 16px; height: 16px; }
.cp-chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; font-weight: 700; }

.cp-badge { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--brand); color: #fff; font-size: 12px; font-weight: 700; }

.cp-tag {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 10px; border-radius: 8px;
    background: var(--surface-2); color: #44403c;
    font-size: 13px; font-weight: 500; line-height: 1.4; white-space: nowrap;
}
.cp-tag svg { width: 15px; height: 15px; }
.cp-tag--warn { background: var(--warn-bg); color: var(--warn-ink); font-weight: 700; }
.cp-tag--ok { background: var(--ok-bg); color: var(--ok-ink); font-weight: 700; }
.cp-tag--info { background: var(--info-bg); color: var(--info-ink); font-weight: 600; }
.cp-tag--closed { background: var(--surface-2); color: var(--ink-3); font-weight: 700; }
.cp-new { display: inline-block; padding: 2px 8px; border-radius: 6px; background: var(--brand); color: #fff; font-size: 11px; font-weight: 800; letter-spacing: .04em; }

.cp-eyebrow { margin: 0; color: var(--brand); font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }

/* ---------- Hero & pencarian ---------- */

.cp-hero { background: var(--surface); border-bottom: 1px solid var(--line); padding: 20px 0 16px; }
.cp-hero__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.cp-hero h1 { margin: 4px 0 0; font-size: 26px; line-height: 1.2; font-weight: 800; letter-spacing: -.02em; }
.cp-hero__sub { display: none; margin: 8px 0 0; color: var(--ink-2); font-size: 16px; }

.cp-search { display: grid; grid-template-columns: 1fr; gap: 12px; margin-top: 16px; }
.cp-field {
    position: relative; display: flex; align-items: center; gap: 10px;
    min-height: 48px; padding: 0 14px;
    background: var(--surface); border: 1px solid var(--line-strong); border-radius: 12px;
    color: var(--ink-3);
    transition: border-color .15s, box-shadow .15s;
}
.cp-field:hover { border-color: var(--ink-3); }
.cp-field:focus-within { border-color: var(--brand); box-shadow: var(--focus); background: var(--surface); }
.cp-field input, .cp-field select { flex: 1; min-width: 0; height: 46px; border: 0; background: transparent; outline: none; color: var(--ink); font-size: 15px; appearance: none; }
.cp-field input::placeholder { color: var(--ink-3); }
.cp-field select { cursor: pointer; padding-right: 24px; }
.cp-field__caret { position: absolute; right: 14px; pointer-events: none; width: 18px !important; height: 18px !important; transition: transform .15s; }
.cp-search__loc { display: none; }

.cp-chips { display: flex; gap: 8px; margin: 16px -16px 0; padding: 0 16px 2px; overflow-x: auto; scrollbar-width: none; scroll-snap-type: x proximity; }
.cp-chips::-webkit-scrollbar { display: none; }
.cp-chips .cp-chip { scroll-snap-align: start; }

/* ---------- Isi: filter, daftar, detail ---------- */

.cp-body { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; padding-top: 16px; padding-bottom: 40px; }

.cp-filter {
    display: none;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 16px;
}
.cp-filter.is-open { display: block; }
.cp-filter__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.cp-filter h2 { margin: 0; font-size: 16px; font-weight: 700; }
.cp-filter__group { border: 0; margin: 0; padding: 12px 0 4px; min-width: 0; }
/* Garis pemisah lewat box-shadow: border fieldset akan terpotong oleh <legend>. */
.cp-filter__group + .cp-filter__group { margin-top: 8px; padding-top: 16px; box-shadow: inset 0 1px 0 var(--line); }
.cp-filter__group legend { float: left; width: 100%; padding: 0; margin-bottom: 6px; color: var(--ink-3); font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.cp-filter__saved { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }

.cp-check { display: flex; align-items: flex-start; gap: 10px; padding: 7px 0; cursor: pointer; font-size: 15px; }
.cp-check input {
    appearance: none; flex: none; width: 20px; height: 20px; margin: 1px 0 0;
    border: 1.5px solid var(--line-strong); border-radius: 6px; background: var(--surface); cursor: pointer;
    display: grid; place-items: center;
}
.cp-check input::after { content: ""; width: 10px; height: 6px; border: 2px solid #fff; border-top: 0; border-right: 0; transform: rotate(-45deg) translate(1px, -1px); opacity: 0; }
.cp-check input:checked { background: var(--brand); border-color: var(--brand); }
.cp-check input:checked::after { opacity: 1; }
.cp-check input:focus-visible { box-shadow: var(--focus); outline: none; }
.cp-check span { flex: 1; }
.cp-check small { color: var(--ink-3); font-size: 13px; font-variant-numeric: tabular-nums; }

.cp-list__bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.cp-list__bar p { margin: 0; color: var(--ink-2); font-size: 14px; white-space: nowrap; }
.cp-list__bar strong { color: var(--ink); }
.cp-list__tools { display: flex; align-items: center; gap: 8px; }
.cp-list__filter-btn { min-height: 36px; padding: 0 12px; font-size: 13px; }
.cp-sort { position: relative; display: inline-flex; align-items: center; }
.cp-sort select { appearance: none; border: 0; background: transparent; padding: 6px 24px 6px 4px; font-size: 14px; font-weight: 700; cursor: pointer; border-radius: 8px; }
.cp-sort select:focus-visible { outline: none; box-shadow: var(--focus); }
.cp-sort svg { position: absolute; right: 2px; width: 16px; height: 16px; pointer-events: none; transition: transform .15s; }

/* Dropdown kustom (lokasi & urutan) — pengganti daftar <select> bawaan browser. */
.cp-dd { cursor: pointer; }
.cp-dd.is-open .cp-field__caret, .cp-dd.is-open > svg:last-of-type { transform: rotate(180deg); }
.cp-dd__btn {
    flex: 1; min-width: 0; display: block; height: 46px; padding: 0 28px 0 0;
    border: 0; background: transparent; text-align: left; cursor: pointer;
    color: var(--ink); font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cp-dd__btn:focus-visible { outline: none; }
.cp-sort .cp-dd__btn { height: auto; padding: 6px 24px 6px 4px; font-size: 14px; font-weight: 700; border-radius: 8px; }
.cp-sort .cp-dd__btn:focus-visible { box-shadow: var(--focus); }
.cp-dd__list {
    position: absolute; z-index: 40; top: calc(100% + 6px); left: 0; right: 0;
    min-width: 240px; max-height: 340px; overflow-y: auto; overscroll-behavior: contain;
    margin: 0; padding: 6px; list-style: none;
    background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
    box-shadow: 0 16px 40px rgba(28, 25, 23, .14), 0 2px 6px rgba(28, 25, 23, .06);
    outline: none; cursor: default; scrollbar-width: thin;
    animation: cp-dd-in .12s ease-out;
}
@keyframes cp-dd-in { from { opacity: 0; transform: translateY(-4px); } }
.cp-sort .cp-dd__list { left: auto; right: 0; min-width: 220px; }
.cp-dd__opt {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 12px; border-radius: 9px;
    color: var(--ink); font-size: 15px; font-weight: 500; line-height: 1.35; cursor: pointer;
}
.cp-dd__opt span { flex: 1; min-width: 0; }
.cp-dd__opt small { color: var(--ink-3); font-size: 13px; font-variant-numeric: tabular-nums; }
.cp-dd__opt svg { position: static; width: 16px; height: 16px; color: var(--brand); visibility: hidden; transform: none; }
.cp-dd__opt.is-active { background: var(--surface-2); }
.cp-dd__opt[aria-selected="true"] { color: var(--brand); font-weight: 700; }
.cp-dd__opt[aria-selected="true"] svg { visibility: visible; }

.cp-cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }

.cp-card {
    position: relative;
    background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--radius);
    transition: border-color .15s, box-shadow .15s;
}
.cp-card:hover { border-color: var(--line-strong); box-shadow: var(--shadow); }
.cp-card.is-active { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); }
.cp-card__link { display: block; padding: 16px 44px 16px 16px; text-decoration: none; border-radius: var(--radius); }
.cp-card__link::after { content: ""; position: absolute; right: 16px; top: 20px; width: 9px; height: 9px; border: solid var(--ink-3); border-width: 2px 2px 0 0; transform: rotate(45deg); }
.cp-card__new { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; color: var(--ink-3); font-size: 13px; }
.cp-card h3 { margin: 0; font-size: 17px; line-height: 1.35; font-weight: 700; letter-spacing: -.01em; }
.cp-card h3 .cp-new { margin-left: 6px; vertical-align: 2px; }
.cp-only-wide { display: none !important; }
.cp-card__meta { margin: 4px 0 0; color: var(--ink-2); font-size: 14px; }
.cp-card__tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }

.cp-empty { padding: 40px 24px; text-align: center; background: var(--surface); border: 1px dashed var(--line-strong); border-radius: var(--radius); color: var(--ink-2); }
.cp-empty__title { margin: 0 0 4px; color: var(--ink); font-weight: 700; font-size: 16px; }
.cp-empty .cp-btn { margin-top: 12px; }

/* Panel detail */

.cp-detail { display: none; outline: none; }

.cp-job { background: var(--surface); }
.cp-job__bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 16px 0; }
.cp-job__bar .cp-icon-btn { border-color: transparent; }
.cp-job__actions { display: flex; gap: 4px; margin-left: auto; }
.cp-job__head { padding: 8px 20px 20px; }
.cp-job__head h2 { margin: 6px 0 0; font-size: 26px; line-height: 1.2; font-weight: 800; letter-spacing: -.02em; }
.cp-job__top-actions { display: none; }

.cp-deadline { display: flex; align-items: flex-start; gap: 10px; margin-top: 16px; padding: 12px 16px; border-radius: 12px; font-size: 15px; font-weight: 600; }
.cp-deadline svg { margin-top: 1px; }
.cp-deadline--warn { background: var(--warn-bg); color: var(--warn-ink); }
.cp-deadline--ok { background: var(--ok-bg); color: var(--ok-ink); }
.cp-deadline--closed { background: var(--surface-2); color: var(--ink-2); }

.cp-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 20px; margin: 0; padding: 20px; border-top: 1px solid var(--line); border-bottom: 8px solid var(--bg); }
.cp-facts dt { color: var(--ink-3); font-size: 13px; }
.cp-facts dd { margin: 2px 0 0; font-weight: 700; font-size: 15px; overflow-wrap: break-word; }

.cp-job__body { padding: 20px 20px 8px; }
.cp-job__cols { display: grid; gap: 8px; }
.cp-job__body h3 { margin: 0 0 8px; font-size: 18px; font-weight: 800; letter-spacing: -.01em; }
.cp-rich { color: #292524; font-size: 15px; }
.cp-rich > :first-child { margin-top: 0; }
.cp-rich p { margin: 0 0 10px; }
.cp-rich ul, .cp-rich ol { margin: 0 0 12px; padding-left: 20px; }
.cp-rich li { margin: 6px 0; padding-left: 2px; }
.cp-rich li::marker { color: var(--ink-3); }
.cp-rich h4, .cp-rich h5, .cp-rich h6 { margin: 14px 0 6px; font-size: 15px; }
.cp-rich--empty { color: var(--ink-3); font-style: italic; }
.cp-section { margin-bottom: 20px; }

.cp-steps { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0; padding: 0; list-style: none; }
.cp-steps li { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; }
.cp-steps li span { padding: 6px 10px; border-radius: 8px; background: var(--surface-2); color: #44403c; }
.cp-steps li + li::before { content: ""; width: 5px; height: 5px; border: solid var(--ink-3); border-width: 1.5px 1.5px 0 0; transform: rotate(45deg); margin-right: 2px; }

.cp-job__apply {
    position: sticky; bottom: 0; z-index: 5;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
    background: var(--surface); border-top: 1px solid var(--line);
}
.cp-job__apply .cp-btn { width: 100%; min-height: 52px; font-size: 16px; }
.cp-job__apply p { margin: 8px 0 0; text-align: center; color: var(--ink-3); font-size: 13px; }

.cp-missing { padding: 48px 24px; text-align: center; }
.cp-missing h2 { margin: 0 0 6px; font-size: 20px; }
.cp-missing p { margin: 0 0 16px; color: var(--ink-2); }

/* ---------- Mode detail di layar sempit: hanya detail ---------- */

@media (max-width: 1099.98px) {
    body[data-mode="detail"] #main.cp { background: var(--surface); }
    body[data-mode="detail"] .cp-hero,
    body[data-mode="detail"] .cp-filter,
    body[data-mode="detail"] .cp-list { display: none !important; }
    body[data-mode="detail"] .cp-body { padding: 0; }
    body[data-mode="detail"] .cp-body.cp-wrap { max-width: 760px; padding: 0; }
    body[data-mode="detail"] .cp-detail { display: block; }
}

/* ---------- Tablet ---------- */

@media (min-width: 640px) {
    .cp-wrap { padding: 0 24px; }
    .cp-chips { margin: 16px -24px 0; padding: 0 24px 2px; }
    .cp-hero h1 { font-size: 30px; }
    .cp-cards { grid-template-columns: 1fr; }
    .cp-body.cp-wrap { max-width: 760px; }
    .cp-job__head h2 { font-size: 30px; }
}

/* ---------- Desktop: filter | daftar (2 kolom kartu); detail di drawer ---------- */

@media (min-width: 1100px) {
    /* Tinggi header sticky Porto (navbar.php) di desktop. */
    :root { --top-h: 80px; }
    .cp-wrap { padding: 0 40px; }

    .cp-hero { padding: 36px 0 28px; }
    .cp-hero .cp-eyebrow, .cp-hero__saved { display: none; }
    .cp-hero h1 { margin: 0; font-size: 36px; }
    .cp-hero__sub { display: block; }
    .cp-search { grid-template-columns: minmax(0, 1fr) 300px; margin-top: 24px; }
    .cp-search__loc { display: flex; }
    .cp-chips { display: none; }

    .cp-body, .cp-body.cp-wrap {
        max-width: 1320px;
        grid-template-columns: 220px minmax(0, 1fr);
        gap: 32px; padding-top: 24px; padding-bottom: 56px;
        align-items: start;
    }
    .cp-filter { display: block; border: 0; background: transparent; padding: 4px 0 0; position: sticky; top: calc(var(--top-h) + 24px + var(--cp-shift, 0px)); }
    .cp-list__filter-btn { display: none; }
    .cp-list__bar { min-height: 28px; }
    .cp-list__bar p { font-size: 14px; }

    .cp-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
    .cp-card { display: flex; }
    .cp-card__link { display: flex; flex-direction: column; flex: 1; padding: 18px 20px; }
    .cp-card__tags { margin-top: auto; padding-top: 12px; }
    .cp-card__link::after { display: none; }
    .cp-only-narrow { display: none !important; }
    .cp-only-wide { display: inline-block !important; }

    /* Detail di dalam halaman hanya untuk layar sempit. */
    .cp-detail { display: none !important; }

    /* Isi detail di drawer */
    .cp-job__bar, .cp-job__apply { display: none; }
    .cp-job__head { padding: 28px 32px 24px; }
    .cp-job__head h2 { font-size: 28px; }
    .cp-facts { grid-template-columns: repeat(4, minmax(0, 1fr)); padding: 20px 32px; border-bottom: 1px solid var(--line); }
    .cp-job__body { padding: 24px 32px 16px; }
    .cp-job__cols { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px; }
    .cp-rich { font-size: 14.5px; }
    .cp-missing { padding: 64px 32px; }
}

/* ---------- Drawer detail (desktop) ----------
 * <dialog> modal di kanan. Bar atas & bawah tetap, hanya .cp-drawer__body yang di-scroll. */

.cp-drawer {
    position: fixed; inset: 0 0 0 auto;
    width: min(780px, 64vw); max-width: 100vw;
    height: 100vh; height: 100dvh; max-height: none;
    margin: 0 0 0 auto; padding: 0; border: 0;
    background: var(--surface); color: var(--ink);
    box-shadow: -24px 0 64px rgba(28, 25, 23, .25);
    overflow: hidden;
}
.cp-drawer[open] { display: flex; flex-direction: column; animation: cp-drawer-in .3s cubic-bezier(.2, .8, .2, 1); }
.cp-drawer.is-closing { animation: cp-drawer-out .22s ease-in forwards; }
.cp-drawer::backdrop { background: rgba(28, 25, 23, .5); animation: cp-fade-in .3s ease; }
.cp-drawer.is-closing::backdrop { animation: cp-fade-out .22s ease forwards; }
@keyframes cp-drawer-in { from { transform: translateX(100%); } }
@keyframes cp-drawer-out { to { transform: translateX(100%); } }
@keyframes cp-fade-in { from { opacity: 0; } }
@keyframes cp-fade-out { to { opacity: 0; } }

.cp-drawer__top { flex: none; display: flex; align-items: center; gap: 8px; min-height: 72px; padding: 12px 24px; border-bottom: 1px solid var(--line); background: var(--surface); }
.cp-drawer__mini { flex: 1; min-width: 0; margin: 0 8px; font-size: 16px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; opacity: 0; transform: translateY(4px); transition: opacity .18s, transform .18s; }
.cp-drawer.is-scrolled .cp-drawer__mini { opacity: 1; transform: none; }
.cp-drawer__actions { display: flex; gap: 8px; margin-left: auto; }

.cp-drawer__body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; outline: none; scrollbar-width: thin; scrollbar-color: #c9c3bb transparent; }
.cp-drawer__body::-webkit-scrollbar { width: 10px; }
.cp-drawer__body::-webkit-scrollbar-thumb { background: #c9c3bb; border-radius: 10px; border: 3px solid var(--surface); }
.cp-drawer__body .cp-job__head h2 { font-size: 30px; }

.cp-drawer__foot { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 24px; border-top: 1px solid var(--line); background: var(--surface); }
.cp-drawer__nav { display: flex; align-items: center; gap: 8px; }
.cp-drawer__nav .cp-btn { padding: 0 16px; gap: 4px; }
.cp-drawer__nav .cp-btn svg { width: 18px; height: 18px; }
.cp-drawer__nav .cp-btn:disabled { opacity: .45; cursor: not-allowed; }
.cp-drawer__count { margin-left: 6px; color: var(--ink-3); font-size: 13px; white-space: nowrap; }
.cp-drawer__foot > .cp-btn--primary { min-width: 220px; min-height: 48px; font-size: 16px; }
.cp-drawer .cp-deadline { display: inline-flex; }
.cp-drawer .cp-toast { bottom: 96px; }



/* ---------- Toast ---------- */

.cp-toast {
    position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); z-index: 60;
    transform: translateX(-50%);
    max-width: calc(100% - 32px); padding: 12px 18px;
    background: var(--ink); color: #fff; border-radius: 12px; box-shadow: var(--shadow-lg);
    font-size: 14px; font-weight: 600;
}
body[data-mode="detail"] .cp-toast { bottom: calc(96px + env(safe-area-inset-bottom)); }
@media (min-width: 1100px) { body[data-mode="detail"] .cp-toast { bottom: 24px; } }

/* ---------- Dialog lamaran ---------- */

.cp-sheet {
    width: 100%; max-width: 100%; height: 100%; max-height: 100%;
    margin: 0; padding: 0; border: 0;
    background: var(--surface); color: var(--ink);
}
.cp-sheet::backdrop { background: rgba(28, 25, 23, .55); }
.cp-sheet[open] { display: flex; }
/* Kunci scroll halaman saat drawer/form terbuka (tema memasang overflow di <html>). */
html.cp-lock { overflow: hidden !important; }

.cp-apply { display: flex; flex-direction: column; width: 100%; min-height: 0; }
.cp-apply__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 16px 16px 14px 20px; border-bottom: 1px solid var(--line); }
.cp-apply__head h2 { margin: 2px 0 0; font-size: 20px; line-height: 1.25; font-weight: 800; letter-spacing: -.01em; }
.cp-apply__head h2:focus { outline: none; }
.cp-apply__meta { margin: 2px 0 0; color: var(--ink-2); font-size: 14px; }
.cp-apply__body { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; padding: 16px 20px 8px; }
.cp-apply__intro { margin: 0 0 16px; color: var(--ink-2); font-size: 14px; }
.cp-apply__foot { display: flex; justify-content: flex-end; gap: 10px; padding: 12px 20px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--surface); }
.cp-apply__foot .cp-btn--primary { flex: 1; }

.cp-form-error { display: flex; gap: 10px; margin: 0 0 16px; padding: 12px 14px; border-radius: 12px; background: #fdecea; color: var(--danger); font-size: 14px; font-weight: 600; }

.cp-fs { margin: 0 0 8px; padding: 0 0 16px; border: 0; min-width: 0; }
.cp-fs + .cp-fs { padding-top: 20px; box-shadow: inset 0 1px 0 var(--line); }
.cp-fs legend { float: left; width: 100%; display: flex; align-items: center; gap: 10px; padding: 0; margin-bottom: 14px; font-size: 16px; font-weight: 800; }
.cp-fs legend span { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 999px; background: var(--brand-soft); color: var(--brand); font-size: 13px; }

.cp-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.cp-form-field { min-width: 0; }
.cp-label { display: block; margin: 0 0 6px; font-size: 14px; font-weight: 600; }
.cp-req { color: var(--brand); }
.cp-opt { color: var(--ink-3); font-weight: 400; font-size: 13px; }
.cp-hint { margin: 6px 0 0; color: var(--ink-3); font-size: 13px; }

.cp-input {
    width: 100%; min-height: 46px; padding: 10px 14px;
    background: var(--surface); border: 1px solid var(--line-strong); border-radius: 12px;
    font-size: 16px; line-height: 1.4; color: var(--ink);
    transition: border-color .15s, box-shadow .15s;
}
.cp-input::placeholder { color: #a8a29e; }
.cp-input:focus { outline: none; border-color: var(--brand); box-shadow: var(--focus); }
.cp-input:disabled { background: var(--surface-2); color: var(--ink-3); }
.cp-select {
    appearance: none; padding-right: 40px; cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2378716c' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 14px center; background-size: 18px;
}
.cp-input--other { margin-top: 8px; }
.cp-invalid .cp-input, .cp-input.cp-invalid { border-color: var(--danger); }
.cp-field-error { margin: 6px 0 0; color: var(--danger); font-size: 13px; font-weight: 600; }

.cp-prefix, .cp-suffix { display: flex; align-items: stretch; }
.cp-prefix span, .cp-suffix span { display: inline-flex; align-items: center; padding: 0 12px; background: var(--surface-2); border: 1px solid var(--line-strong); color: var(--ink-2); font-size: 15px; font-weight: 600; }
.cp-prefix span { border-right: 0; border-radius: 12px 0 0 12px; }
.cp-prefix .cp-input { border-radius: 0 12px 12px 0; }
.cp-suffix span { border-left: 0; border-radius: 0 12px 12px 0; }
.cp-suffix .cp-input { border-radius: 12px 0 0 12px; }
.cp-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }

.cp-seg { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.cp-seg label { position: relative; }
.cp-seg input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.cp-seg span { display: flex; align-items: center; justify-content: center; min-height: 46px; padding: 8px 12px; border: 1px solid var(--line-strong); border-radius: 12px; font-size: 14px; font-weight: 600; text-align: center; cursor: pointer; }
.cp-seg input:checked + span { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); }
.cp-seg input:focus-visible + span { box-shadow: var(--focus); }

.cp-company { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; padding: 14px; border-radius: 12px; background: var(--bg); }

.cp-drop {
    position: relative; display: flex; align-items: center; gap: 14px;
    padding: 16px; border: 1.5px dashed var(--line-strong); border-radius: 12px;
    background: var(--bg); cursor: pointer;
}
.cp-drop:hover, .cp-drop:focus-within { border-color: var(--brand); }
.cp-drop svg { width: 28px; height: 28px; color: var(--brand); }
.cp-drop__text { display: flex; flex-direction: column; min-width: 0; font-size: 14px; }
.cp-drop__text span { color: var(--ink-3); font-size: 13px; overflow-wrap: anywhere; }
.cp-drop input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.cp-drop.has-file { border-style: solid; border-color: var(--ok-ink); background: var(--ok-bg); }
.cp-drop.has-file svg { color: var(--ok-ink); }

.cp-consent { padding: 14px; border-radius: 12px; background: var(--bg); font-size: 14px; color: #44403c; }

.cp-spinner { display: none; width: 18px; height: 18px; border: 2.5px solid rgba(255, 255, 255, .4); border-top-color: #fff; border-radius: 50%; animation: cp-spin .7s linear infinite; }
.is-loading .cp-spinner { display: inline-block; }
@keyframes cp-spin { to { transform: rotate(360deg); } }

@media (min-width: 640px) {
    .cp-grid, .cp-company { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .cp-span-2 { grid-column: 1 / -1; }
    .cp-apply__foot .cp-btn--primary { flex: 0 0 auto; min-width: 200px; }
}

@media (min-width: 800px) {
    .cp-sheet {
        width: min(820px, calc(100% - 48px)); height: auto; max-height: calc(100dvh - 48px);
        margin: auto; border-radius: 20px; box-shadow: var(--shadow-lg);
    }
    .cp-apply__head { padding: 22px 24px 18px 28px; }
    .cp-apply__head h2 { font-size: 22px; }
    .cp-apply__body { padding: 20px 28px 8px; }
    .cp-apply__foot { padding: 14px 28px; }
}

/* Dialog hasil kirim lamaran */
.cp-result { width: min(420px, calc(100% - 32px)); padding: 28px 24px 22px; border: 0; border-radius: 20px; text-align: center; box-shadow: var(--shadow-lg); color: var(--ink); }
.cp-result::backdrop { background: rgba(28, 25, 23, .55); }
.cp-result__icon { display: inline-grid; place-items: center; width: 56px; height: 56px; margin-bottom: 12px; border-radius: 50%; }
.cp-result__icon svg { width: 28px; height: 28px; stroke-width: 2.4; }
.cp-result--success .cp-result__icon { background: var(--ok-bg); color: var(--ok-ink); }
.cp-result--error .cp-result__icon { background: #fdecea; color: var(--danger); }
.cp-result h2 { margin: 0 0 6px; font-size: 20px; }
.cp-result p { margin: 0 0 20px; color: var(--ink-2); }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; animation-duration: .01ms !important; }
}

/* <legend> dibuat float agar keluar dari garis fieldset (tidak tertabrak pemisah). */
.cp-filter__group legend + *, .cp-fs legend + * { clear: both; }

/* Banner template Porto: hilangkan margin bawah bawaan agar menempel ke konten. */
.page-header.cp-banner { margin-bottom: 0; }

/* ---------- Layar tunggu saat mengirim lamaran ---------- */
.cp-sheet { position: fixed; }
.cp-sending {
    position: absolute; inset: 0; z-index: 20;
    display: grid; place-items: center; padding: 24px;
    background: rgba(255, 255, 255, .92);
    backdrop-filter: blur(2px);
    animation: cp-fade-in .2s ease;
}
.cp-sending[hidden] { display: none; }
.cp-sending__box { max-width: 360px; text-align: center; }
.cp-sending__spinner {
    display: inline-block; width: 44px; height: 44px; margin-bottom: 16px;
    border: 4px solid var(--brand-soft); border-top-color: var(--brand); border-radius: 50%;
    animation: cp-spin .8s linear infinite;
}
.cp-sending__title { margin: 0 0 6px; font-size: 18px; font-weight: 800; color: var(--ink); }
.cp-sending__text { margin: 0; color: var(--ink-2); font-size: 14px; }
@media (prefers-reduced-motion: reduce) { .cp-sending__spinner { animation-duration: 1.6s !important; } }

/* ---------- reCAPTCHA ---------- */
/* Logo reCAPTCHA disembunyikan (menutupi tombol di HP); keterangan wajib Google ditampilkan di form. */
.grecaptcha-badge { visibility: hidden !important; }
.cp-recaptcha-note { margin: 4px 0 8px; color: var(--ink-3); font-size: 12px; }
.cp-recaptcha-note a { color: var(--ink-2); text-decoration: underline; }

/* ---------- Halaman maintenance ---------- */
.cp-maint { display: grid; place-items: center; padding: 56px 16px 72px; background: var(--surface); }
.cp-maint__card { max-width: 560px; text-align: center; }
.cp-maint__icon { display: inline-grid; place-items: center; width: 64px; height: 64px; margin-bottom: 18px; border-radius: 50%; background: var(--warn-bg); color: var(--warn-ink); }
.cp-maint__icon svg { width: 30px; height: 30px; }
.cp-maint h1 { margin: 0 0 10px; font-size: 26px; line-height: 1.25; font-weight: 800; letter-spacing: -.01em; }
.cp-maint__msg { margin: 0 0 14px; color: var(--ink-2); font-size: 16px; }
.cp-maint__until { margin: 0 0 22px; padding: 10px 14px; display: inline-block; border-radius: 10px; background: var(--surface-2); font-size: 14px; }
@media (min-width: 1100px) { .cp-maint { padding: 88px 16px 104px; } .cp-maint h1 { font-size: 32px; } }
