/* ============================================================
   OVERLAYS — Dynamic Island, Control Center, Spotlight, Lightbox sertifikat
   ============================================================ */

/* ---------- Dynamic Island ---------- */
.island { position: fixed; z-index: 500; top: 10px; left: 50%; transform: translateX(-50%); pointer-events: none; }
.island__in {
  display: flex; align-items: center; gap: 10px; height: 36px; min-width: 0; width: 0; padding: 0; overflow: hidden; border-radius: 22px;
  background: #000; border: 1px solid rgba(255,255,255,.12); color: #fff; font: 400 12.5px/1 var(--font-body); white-space: nowrap;
  box-shadow: 0 10px 40px rgba(0,0,0,.6); opacity: 0; transform: scale(.4); transition: width .6s var(--spring), padding .6s var(--spring), opacity .3s, transform .6s var(--spring);
}
.island.is-on .island__in { opacity: 1; transform: none; padding: 0 16px; width: var(--w, 160px); }
.island__ico { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: #30d158; color: #000; flex: none; }
.island__ico.is-info { background: #0a84ff; color: #fff; } .island__ico.is-err { background: #ff453a; color: #fff; }

/* ---------- Control Center ---------- */
.cc-btn { position: fixed; z-index: 150; right: 24px; bottom: 24px; width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; color: var(--fg-2); transition: transform .45s var(--spring), color .25s; opacity: 0; }
body.is-ready .cc-btn { opacity: 1; transition: transform .45s var(--spring), color .25s, opacity 1s 1.2s; }
.cc-btn:hover { color: #fff; transform: scale(1.1) rotate(30deg); }
.cc-btn:active { transform: scale(.9); }
.cc { position: fixed; inset: 0; z-index: 400; visibility: hidden; opacity: 0; transition: opacity .35s, visibility 0s .35s; background: rgba(0,0,0,.35); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.cc.is-open { visibility: visible; opacity: 1; transition: opacity .35s; }
.cc__panel {
  position: absolute; right: 24px; bottom: 82px; width: 300px; padding: 16px; border-radius: 32px;
  background: linear-gradient(180deg, rgba(40,40,40,.65), rgba(14,14,14,.7));
  transform-origin: 100% 100%; transform: scale(.2); opacity: 0; transition: transform .6s var(--spring), opacity .3s;
}
.cc.is-open .cc__panel { transform: none; opacity: 1; }
.cc__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.cc__tile { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 14px; min-height: 94px; border-radius: 22px; text-align: left; background: rgba(255,255,255,.07); border: 1px solid var(--line); transition: transform .4s var(--spring), background .25s; }
.cc__tile .ico { margin-bottom: auto; color: var(--fg); }
.cc__tile span { font-size: 13px; font-weight: 400; } .cc__tile small { font-size: 10px; color: var(--fg-3); }
.cc__tile:hover { background: rgba(255,255,255,.12); } .cc__tile:active { transform: scale(.94); }
.cc__tile[aria-pressed="true"] { background: #f4f4f5; color: #000; } .cc__tile[aria-pressed="true"] .ico, .cc__tile[aria-pressed="true"] small { color: #000; }
.cc__label { margin: 16px 4px 8px; font: 400 10.5px/1 var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--fg-3); }
.cc__swatches { display: flex; gap: 10px; padding: 0 4px; }
.cc__sw { width: 30px; height: 30px; border-radius: 50%; background: var(--c); border: 2px solid transparent; box-shadow: inset 0 0 0 2px rgba(0,0,0,.4); transition: transform .4s var(--spring), border-color .2s; }
.cc__sw:hover { transform: scale(1.15); } .cc__sw.is-on { border-color: #fff; transform: scale(1.1); }
.cc__range { -webkit-appearance: none; appearance: none; width: calc(100% - 8px); margin: 0 4px; height: 36px; border-radius: 18px; background: rgba(255,255,255,.1); overflow: hidden; outline: none; }
.cc__range::-webkit-slider-thumb { -webkit-appearance: none; width: 0; height: 36px; box-shadow: -300px 0 0 300px rgba(255,255,255,.85); }
.cc__range::-moz-range-thumb { width: 0; height: 36px; border: 0; box-shadow: -300px 0 0 300px rgba(255,255,255,.85); }
@media (max-width: 760px) { .cc-btn { right: 16px; bottom: calc(96px + env(safe-area-inset-bottom)); } .cc__panel { right: 16px; bottom: calc(150px + env(safe-area-inset-bottom)); width: min(300px, calc(100% - 32px)); } }

/* ---------- Spotlight ---------- */
.spot { position: fixed; inset: 0; z-index: 600; display: flex; justify-content: center; align-items: flex-start; padding: 14vh 16px 0; visibility: hidden; opacity: 0; background: rgba(0,0,0,.5); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); transition: opacity .3s, visibility 0s .3s; }
.spot.is-open { visibility: visible; opacity: 1; transition: opacity .3s; }
.spot__panel { width: min(600px, 100%); border-radius: 26px; overflow: hidden; background: linear-gradient(180deg, rgba(36,36,36,.78), rgba(14,14,14,.82)); transform: translateY(-20px) scale(.94); transition: transform .55s var(--spring); }
.spot.is-open .spot__panel { transform: none; }
.spot__bar { display: flex; align-items: center; gap: 12px; padding: 0 20px; height: 62px; color: var(--fg-3); border-bottom: 1px solid var(--line); }
.spot__bar input { flex: 1; background: transparent; border: 0; outline: 0; font-size: 16px; color: var(--fg); }
.spot__bar kbd { font: 400 10px var(--font-mono); padding: 4px 8px; border-radius: 6px; border: 1px solid var(--line-2); color: var(--fg-3); }
.spot__list { max-height: 50vh; overflow-y: auto; padding: 8px; }
.spot__grp { padding: 10px 14px 6px; font: 500 10px var(--font-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--fg-3); }
.spot__item { display: flex; align-items: center; gap: 14px; width: 100%; padding: 11px 14px; border-radius: 14px; text-align: left; color: var(--fg-2); font-size: 14px; }
.spot__item img { width: 22px; height: 22px; object-fit: contain; }
.spot__item small { margin-left: auto; font: 400 10px var(--font-mono); color: var(--fg-3); }
.spot__item.is-sel, .spot__item:hover { background: rgba(255,255,255,.1); color: #fff; }
.spot__empty { padding: 30px; text-align: center; color: var(--fg-3); font-size: 13px; }

/* ---------- Lightbox / sheet sertifikat ---------- */
.lb { position: fixed; inset: 0; z-index: 700; display: flex; align-items: center; justify-content: center; padding: 28px; visibility: hidden; opacity: 0; background: rgba(0,0,0,.82); -webkit-backdrop-filter: blur(18px) saturate(1.4); backdrop-filter: blur(18px) saturate(1.4); transition: opacity .4s var(--ease), visibility 0s .4s; }
.lb.is-open { visibility: visible; opacity: 1; transition: opacity .4s var(--ease); }
.lb__sheet { position: relative; width: min(900px, 100%); max-height: 100%; display: flex; flex-direction: column; padding: 10px; border-radius: 28px; background: #f4f4f5; color: #111; box-shadow: 0 40px 120px rgba(0,0,0,.7); transform: translateY(40px) scale(.9); opacity: 0; transition: transform .65s var(--spring), opacity .35s; touch-action: pan-y; }
.lb.is-open .lb__sheet { transform: translateY(var(--dy, 0px)) scale(var(--sc, 1)); opacity: 1; }
.lb__sheet.is-dragging { transition: none; }
.lb__grab { display: none; width: 40px; height: 5px; margin: 2px auto 10px; border-radius: 3px; background: rgba(0,0,0,.2); }
.lb__media { flex: 1; min-height: 0; display: grid; place-items: center; overflow: auto; border-radius: 20px; background: #fff; }
.lb__media img { max-width: 100%; max-height: calc(100svh - 150px); object-fit: contain; cursor: zoom-in; transition: transform .5s var(--ease); }
.lb__media img.is-zoom { transform: scale(1.9); cursor: zoom-out; }
.lb__media iframe { width: 100%; height: calc(100svh - 150px); border: 0; }
.lb__cap { display: flex; justify-content: space-between; gap: 14px; align-items: baseline; padding: 12px 12px 4px; font-size: 13px; }
.lb__cap strong { font-weight: 500; } .lb__cap span { color: #777; font-size: 12px; }
.lb__close { position: absolute; z-index: 5; top: 22px; right: 22px; width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.16); transition: transform .4s var(--spring), background .25s; }
.lb__close:hover { background: rgba(255,255,255,.22); transform: rotate(90deg); }
.lb__nav { position: absolute; z-index: 5; top: 50%; width: 46px; height: 46px; margin-top: -23px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.14); transition: transform .4s var(--spring), background .25s; }
.lb__nav:hover { background: rgba(255,255,255,.2); transform: scale(1.1); }
.lb__nav--prev { left: 22px; } .lb__nav--next { right: 22px; }
.lb--single .lb__nav { display: none; }
@media (max-width: 760px) {
  .lb { align-items: flex-end; padding: 0; }
  .lb__sheet { width: 100%; border-radius: 28px 28px 0 0; padding: 8px 8px calc(14px + env(safe-area-inset-bottom)); transform: translateY(100%); }
  .lb__grab { display: block; }
  .lb__close { top: calc(14px + env(safe-area-inset-top)); right: 14px; }
  .lb__nav { top: auto; bottom: 30px; margin: 0; background: rgba(0,0,0,.45); }
  .lb__nav--prev { left: 16px; } .lb__nav--next { right: 16px; }
}
