/* =====================================================================
   HEADER MODERN — PT. Integration Teknologi Visual
   ---------------------------------------------------------------------
   Dimuat SESUDAH styles.css + visual.css sehingga semua aturan di
   sini menimpa stylesheet dasar tanpa mengubah file asli.

   Isi:
     1. Topbar (utility strip)
     2. Header glass + mouse glow + gradient border
     3. Brand mark (gradient ring + shine)
     4. Nav link (pill + underline sweep + state aktif)
     5. Pill indikator aktif (sliding highlight)
     6. Dropdown glass card + caret + stagger
     7. Language switcher
     8. CTA pulse
     9. Progress bar di dalam header
    10. Panel mobile
   ===================================================================== */

:root {
  --header-h: 72px;
  --topbar-h: 42px;
}

/* ---------------------------------------------------------------
   1. Topbar — strip informasi di atas header
   --------------------------------------------------------------- */
.topbar {
  position: relative;
  z-index: 61;
  background: linear-gradient(100deg, #061223 0%, #0c2340 52%, #123a6b 100%);
  color: rgba(226, 238, 252, .8);
  font-size: .78rem;
  overflow: hidden;
}

.topbar::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(100deg, transparent 25%, rgba(255, 255, 255, .08) 48%, transparent 72%);
  transform: translateX(-100%);
  animation: hdr-shimmer 8s ease-in-out infinite;
}

@keyframes hdr-shimmer {
  0%, 55% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.topbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: var(--topbar-h);
}

.topbar__left,
.topbar__right {
  display: flex;
  align-items: center;
  gap: 20px;
  min-width: 0;
}

.topbar__item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: inherit;
  text-decoration: none;
  white-space: nowrap;
  transition: color .2s ease;
}

.topbar__item i {
  font-size: .86rem;
  color: var(--cyan);
  opacity: .95;
}

a.topbar__item:hover { color: #fff; }
a.topbar__item:hover i { color: #fff; }

.topbar__status {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-weight: 600;
  letter-spacing: .02em;
}

.topbar__status i {
  font-size: .48rem;
  color: #34d399;
  animation: hdr-pulse 2.2s ease-in-out infinite;
}

@keyframes hdr-pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(52, 211, 153, .55); }
  50% { opacity: .75; box-shadow: 0 0 0 6px rgba(52, 211, 153, 0); }
}

.topbar__wa {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 15px;
  border-radius: 999px;
  background: rgba(37, 211, 102, .12);
  border: 1px solid rgba(37, 211, 102, .34);
  color: #d6ffe7;
  font-weight: 600;
  text-decoration: none;
  transition: background .2s ease, transform .2s ease, box-shadow .2s ease;
}

.topbar__wa:hover {
  background: rgba(37, 211, 102, .24);
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(37, 211, 102, .18);
}

/* ---------------------------------------------------------------
   2. Header glass + glow + border gradien
   --------------------------------------------------------------- */
.header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(255, 255, 255, .74);
  backdrop-filter: blur(18px) saturate(170%);
  -webkit-backdrop-filter: blur(18px) saturate(170%);
  border-bottom: 1px solid rgba(11, 31, 58, .07);
  box-shadow: 0 6px 24px rgba(11, 31, 58, .05);
  transition:
    transform .34s cubic-bezier(.2, .8, .25, 1),
    background .3s ease,
    box-shadow .3s ease;
}

.header.is-hidden { transform: translateY(-100%); }

@media (max-width: 960px) {
  /* Di mobile panel menu butuh header tetap terlihat */
  .header.is-hidden { transform: none; }
}

/* Cahaya lembut yang mengikuti kursor */
.header::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(
    420px circle at var(--mx, 50%) var(--my, 50%),
    rgba(31, 111, 235, .12),
    transparent 62%
  );
  opacity: 0;
  transition: opacity .35s ease;
}

.header:hover::before { opacity: 1; }

/* Garis gradien animasi di tepi ATAS header (tidak bentrok dengan progress bar) */
.header::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 2px;
  z-index: 5;
  pointer-events: none;
  background-image: linear-gradient(90deg, var(--blue), var(--cyan) 40%, var(--violet) 70%, var(--blue));
  background-size: 220% 100%;
  opacity: .5;
  animation: hdr-line 9s linear infinite;
  transition: opacity .3s ease, height .3s ease;
}

@keyframes hdr-line {
  from { background-position: 0% 50%; }
  to { background-position: 220% 50%; }
}

.header.is-scrolled {
  background: rgba(255, 255, 255, .88);
  backdrop-filter: blur(24px) saturate(190%);
  -webkit-backdrop-filter: blur(24px) saturate(190%);
  box-shadow: 0 12px 34px rgba(11, 31, 58, .11);
}

.header.is-scrolled::after { opacity: 1; height: 3px; }

.header .wrap { position: relative; z-index: 3; }

/* Progress bar di dalam header */
.header__progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  z-index: 6;
  pointer-events: none;
}

.header__progress > span {
  display: block;
  height: 100%;
  width: 100%;
  transform: scaleX(0);
  transform-origin: 0 50%;
  background-image: linear-gradient(90deg, var(--blue), var(--cyan) 45%, var(--violet));
  box-shadow: 0 0 14px rgba(0, 184, 217, .55);
  will-change: transform;
}

/* ---------------------------------------------------------------
   3. Brand mark — cincin gradien + shine
   --------------------------------------------------------------- */
.brand { position: relative; }

.brand__mark {
  position: relative;
  transition: transform .35s cubic-bezier(.2, .8, .25, 1), box-shadow .35s ease;
}

.brand__mark::after {
  content: "";
  position: absolute;
  inset: -4px;
  padding: 3px;
  border-radius: 15px;
  pointer-events: none;
  background: conic-gradient(from 0deg, rgba(31, 111, 235, 0), var(--blue), var(--cyan), var(--violet), rgba(31, 111, 235, 0));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  opacity: 0;
  transition: opacity .35s ease;
  animation: hdr-spin 7s linear infinite;
}

@keyframes hdr-spin {
  to { transform: rotate(360deg); }
}

.brand:hover .brand__mark {
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 14px 30px rgba(31, 111, 235, .36);
}

.brand:hover .brand__mark::after { opacity: 1; }

.brand__text > span {
  background: linear-gradient(100deg, var(--navy) 0%, var(--blue) 50%, var(--cyan) 100%);
  background-size: 180% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  transition: background-position .5s ease;
}

.brand:hover .brand__text > span { background-position: 100% 0; }

/* ---------------------------------------------------------------
   4. Nav link — pil + underline sweep + state aktif
   --------------------------------------------------------------- */
@media (min-width: 961px) {
  .nav__links { position: relative; }

  .nav__links > a:not(.nav__cta),
  .nav__link--toggle {
    position: relative;
    padding: 9px 5px;
    border-radius: 10px;
    transition: color .22s ease, background-color .22s ease;
  }

  .nav__links > a:not(.nav__cta)::after,
  .nav__link--toggle::after {
    content: "";
    position: absolute;
    left: 5px;
    right: 5px;
    bottom: 2px;
    height: 2px;
    border-radius: 2px;
    background-image: linear-gradient(90deg, var(--blue), var(--cyan));
    transform: scaleX(0);
    transform-origin: 50% 50%;
    transition: transform .3s cubic-bezier(.2, .8, .25, 1);
  }

  .nav__links > a:not(.nav__cta):hover,
  .nav__link--toggle:hover { color: var(--navy); }

  .nav__links > a:not(.nav__cta):hover::after,
  .nav__link--toggle:hover::after { transform: scaleX(1); }

  .nav__links > a:not(.nav__cta).is-active,
  .nav__link--toggle.is-active { color: var(--navy); font-weight: 600; }

  .nav__links > a:not(.nav__cta).is-active::after,
  .nav__link--toggle.is-active::after { transform: scaleX(1); }
}

/* Reset underline bawaan untuk isi dropdown (desktop & mobile) */
.nav__submenu a::after { display: none; }

/* ---------------------------------------------------------------
   5. Pill indikator aktif (sliding highlight)
   --------------------------------------------------------------- */
.nav__pill {
  display: none;
  position: absolute;
  left: 0;
  top: 50%;
  width: 0;
  height: 38px;
  border-radius: 11px;
  z-index: 0;
  pointer-events: none;
  opacity: 0;
  background-image: linear-gradient(180deg, rgba(31, 111, 235, .16), rgba(0, 184, 217, .10));
  border: 1px solid rgba(31, 111, 235, .16);
  box-shadow: 0 8px 20px rgba(31, 111, 235, .14);
  transition:
    transform .42s cubic-bezier(.2, .8, .25, 1),
    width .42s cubic-bezier(.2, .8, .25, 1),
    opacity .28s ease;
}
@media (min-width: 961px) {
  .nav__pill {
    display: block;
    transform: translate(0, -50%);
  }

  .nav__pill.is-visible { opacity: 1; }
}

/* ---------------------------------------------------------------
   6. Dropdown glass card + caret + stagger
   --------------------------------------------------------------- */
@media (min-width: 961px) {
  .nav__submenu {
    min-width: 232px;
    padding: 10px;
    border-radius: 18px;
    background: rgba(255, 255, 255, .88);
    backdrop-filter: blur(22px) saturate(180%);
    -webkit-backdrop-filter: blur(22px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, .75);
    box-shadow:
      0 28px 60px -22px rgba(11, 31, 58, .34),
      0 0 0 1px rgba(31, 111, 235, .08);
    transform-origin: top left;
  }

  .nav__submenu::after {
    content: "";
    position: absolute;
    top: -7px;
    left: 28px;
    width: 14px;
    height: 14px;
    background: rgba(255, 255, 255, .92);
    border-left: 1px solid rgba(31, 111, 235, .12);
    border-top: 1px solid rgba(31, 111, 235, .12);
    transform: rotate(45deg);
    border-radius: 3px 0 0 0;
  }

  .nav__submenu a {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 12px;
    font-size: .89rem;
    font-weight: 500;
    color: var(--muted);
    transition: background-color .2s ease, color .2s ease, transform .2s ease;
  }

  .nav__submenu a::before {
    content: "";
    width: 6px;
    height: 6px;
    flex: 0 0 auto;
    border-radius: 50%;
    background: var(--line);
    transition: background-color .2s ease, transform .2s ease;
  }

  .nav__submenu a:hover {
    background: linear-gradient(100deg, rgba(31, 111, 235, .12), rgba(0, 184, 217, .08));
    color: var(--navy);
    transform: translateX(4px);
  }

  .nav__submenu a:hover::before {
    background: var(--cyan);
    transform: scale(1.4);
  }

  /* Stagger saat dropdown dibuka */
  .nav__group.open .nav__submenu a,
  .nav__group:hover .nav__submenu a {
    animation: hdr-sub-in .28s cubic-bezier(.2, .8, .25, 1) both;
  }

  .nav__submenu a:nth-child(1) { animation-delay: .02s; }
  .nav__submenu a:nth-child(2) { animation-delay: .06s; }
  .nav__submenu a:nth-child(3) { animation-delay: .10s; }
  .nav__submenu a:nth-child(4) { animation-delay: .14s; }
  .nav__submenu a:nth-child(5) { animation-delay: .18s; }

  @keyframes hdr-sub-in {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
  }
}

/* ---------------------------------------------------------------
   7. Language switcher
   ---------------------------------------------------------------
   Hanya desktop. Di mobile, dropdown bahasa tampil sebagai daftar
   rata kiri di dalam panel menu (gaya dasar dari visual.css) —
   jadi aturan glass-card ini TIDAK boleh menimpanya.
   --------------------------------------------------------------- */
@media (min-width: 961px) {
  .lang-switch__toggle {
    border-radius: 999px;
    border-color: rgba(11, 31, 58, .12);
    background: rgba(255, 255, 255, .6);
    transition: color .2s ease, border-color .2s ease, background-color .2s ease, box-shadow .2s ease, transform .2s ease;
  }

  .lang-switch__toggle:hover {
    color: var(--blue);
    border-color: rgba(31, 111, 235, .4);
    background: #fff;
    box-shadow: 0 8px 18px rgba(31, 111, 235, .14);
    transform: translateY(-1px);
  }

  .lang-switch.is-open .lang-switch__toggle {
    color: var(--blue);
    border-color: rgba(31, 111, 235, .45);
    background: #fff;
    box-shadow: 0 8px 20px rgba(31, 111, 235, .16);
  }

  .lang-switch__wrap {
    border-radius: 16px;
    padding: 9px;
    background: rgba(255, 255, 255, .9);
    backdrop-filter: blur(22px) saturate(180%);
    -webkit-backdrop-filter: blur(22px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, .78);
    box-shadow: 0 24px 50px -18px rgba(11, 31, 58, .32);
  }

  .lang-switch__wrap button {
    border-radius: 11px;
    padding: 10px 12px;
    transition: background-color .18s ease, color .18s ease, transform .18s ease;
  }

  .lang-switch__wrap button:hover {
    transform: translateX(3px);
  }
}

/* ---------------------------------------------------------------
   8. CTA — pulse ring
   --------------------------------------------------------------- */
.header .btn--primary {
  position: relative;
  isolation: isolate;
}

.header .btn--primary::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  box-shadow: 0 0 0 0 rgba(31, 111, 235, .45);
  transition: box-shadow .4s ease;
}

.header .btn--primary:hover::before {
  box-shadow: 0 0 0 8px rgba(31, 111, 235, 0);
  animation: hdr-pulse-ring .7s ease-out;
}

@keyframes hdr-pulse-ring {
  from { box-shadow: 0 0 0 0 rgba(31, 111, 235, .5); }
  to { box-shadow: 0 0 0 12px rgba(31, 111, 235, 0); }
}

/* ---------------------------------------------------------------
   9. Panel mobile
   --------------------------------------------------------------- */
@media (max-width: 960px) {
  :root { --header-h: 68px; }

  .topbar { display: none; }

  .nav { height: var(--header-h); }

  .header {
    background: rgba(255, 255, 255, .9);
    backdrop-filter: blur(16px) saturate(160%);
    -webkit-backdrop-filter: blur(16px) saturate(160%);
  }

  .header::before { display: none; }

  .header.is-scrolled .nav { height: var(--header-h); }

  /* Panel menu mengikuti tinggi header yang baru */
  .nav__links {
    position: fixed;
    inset: var(--header-h) 0 auto 0;
    max-height: calc(100vh - var(--header-h));
    background: rgba(255, 255, 255, .96);
    backdrop-filter: blur(20px) saturate(170%);
    -webkit-backdrop-filter: blur(20px) saturate(170%);
    border-top: 1px solid rgba(31, 111, 235, .1);
  }

  .nav__links.open::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    height: 2px;
    background-image: linear-gradient(90deg, var(--blue), var(--cyan), var(--violet));
    background-size: 220% 100%;
    animation: hdr-line 6s linear infinite;
  }

  .nav__links > a:not(.nav__cta),
  .nav__link--toggle {
    transition: background-color .18s ease, color .18s ease;
  }

  .nav__links > a:not(.nav__cta):hover,
  .nav__link--toggle:hover { background: rgba(31, 111, 235, .06); }

  /* Baris bahasa di panel mobile: rata kiri, memanjang penuh,
     tetap understated seperti item menu lain. */
  .lang-switch__toggle {
    width: 100%;
    justify-content: flex-start;
    gap: 10px;
    padding: 13px 0;
    border: 0;
    border-bottom: 1px solid var(--bg-soft);
    border-radius: 0;
    background: none;
    box-shadow: none;
    font-size: .95rem;
    font-weight: 500;
    letter-spacing: 0;
    color: var(--muted);
  }

  .lang-switch__toggle:hover {
    color: var(--blue);
    border-color: var(--bg-soft);
    background: none;
    box-shadow: none;
    transform: none;
  }

  .lang-switch.is-open .lang-switch__toggle {
    color: var(--blue);
    background: none;
    box-shadow: none;
  }

  .lang-switch__toggle i:first-child { font-size: .95rem; }

  /* Daftar bahasa: rata kiri, gaya inline di dalam panel */
  .lang-switch__wrap {
    position: static;
    width: 100%;
    min-width: 0;
    max-width: none;
    margin: 0;
    padding: 6px 0 6px 16px;
    border: 0;
    border-left: 2px solid var(--line);
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    display: none;
    opacity: 1;
    visibility: visible;
    transform: none;
  }

  .lang-switch.is-open .lang-switch__wrap { display: flex; }

  .lang-switch__wrap button {
    padding: 10px 0;
    font-size: .89rem;
    background: none;
  }

  .lang-switch__wrap button:hover {
    background: var(--bg-soft);
    color: var(--blue);
    transform: none;
  }

  .nav__toggle {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    border: 1px solid rgba(11, 31, 58, .12);
    background: rgba(255, 255, 255, .7);
    font-size: 1.35rem;
    color: var(--navy);
    transition: background-color .2s ease, border-color .2s ease, box-shadow .2s ease, transform .2s ease;
  }

  .nav__toggle:hover {
    border-color: rgba(31, 111, 235, .4);
    box-shadow: 0 8px 18px rgba(31, 111, 235, .16);
    transform: translateY(-1px);
  }

  .nav__toggle.is-active {
    background: var(--blue);
    border-color: var(--blue);
    color: #fff;
    box-shadow: 0 10px 24px rgba(31, 111, 235, .32);
  }
}

/* ---------------------------------------------------------------
   10. Aksesibilitas & reduced motion
   --------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .topbar::after,
  .header::after,
  .brand__mark::after,
  .nav__submenu a { animation: none !important; }

  .header,
  .brand__mark,
  .nav__pill { transition-duration: .01ms !important; }
}
