/* Shared across the two pages: the chat (index.html) and the reveal (hasil.html).
   The `:root` tokens and the html/body background are also inlined in each page's
   <head> so the first paint is correct before this file lands. */

:root {
  --c-blue: #293ff5;
  --c-blue-deep: #052699;
  --c-blue-mid: #116af8;
  --c-cyan: #00dac9;
  --c-pink: #ff0f4c;
  --c-pink-soft: #ff7d9e;
  --c-yellow: #ffde3d;
  --c-yellow-ink: #16204d;

  --text: #ffffff;
  --muted: rgba(255, 255, 255, 0.78);
  --muted-2: rgba(255, 255, 255, 0.56);
  --hair: rgba(255, 255, 255, 0.16);
  --hair-strong: rgba(255, 255, 255, 0.30);
  --card: rgba(255, 255, 255, 0.09);
  --card-2: rgba(255, 255, 255, 0.06);

  --sans: 'Plus Jakarta Sans', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --radius: 18px;
  --shadow: 0 24px 60px -22px rgba(3, 17, 90, 0.55);
  --shadow-sm: 0 14px 34px -18px rgba(3, 17, 90, 0.5);
  --cta-grad: radial-gradient(125% 320% at 50% 0%, var(--c-pink-soft) 0%, #ff618a 25%, #ff4675 50%, #ff2a61 75%, var(--c-pink) 100%);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background:
    radial-gradient(55% 46% at 0% 100%, rgba(0, 218, 201, 0.30) 0%, rgba(0, 218, 201, 0.10) 55%, rgba(0, 218, 201, 0) 100%),
    radial-gradient(48% 52% at 100% 6%, rgba(255, 15, 76, 0.24) 0%, rgba(255, 15, 76, 0.08) 55%, rgba(255, 15, 76, 0) 100%),
    radial-gradient(70% 60% at 50% 34%, rgba(17, 106, 248, 0.45) 0%, rgba(41, 63, 245, 0.22) 55%, rgba(41, 63, 245, 0) 100%),
    var(--c-blue);
  color: var(--text);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

body { overscroll-behavior-y: none; }

.eyebrow {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--c-yellow);
}

button { font: inherit; color: inherit; cursor: pointer; }

:is(button, a):focus-visible {
  outline: 2.5px solid var(--c-yellow);
  outline-offset: 3px;
  border-radius: 6px;
}

.app {
  display: flex;
  flex-direction: column;
  height: 100%;
  max-width: 620px;
  margin: 0 auto;
  background: transparent;
}

/* ---------- Hero ---------- */

.hero {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 22px;
  flex: 1;
  padding: 32px 24px calc(34px + env(safe-area-inset-bottom));
}

.hero h1 {
  font-size: clamp(34px, 8.6vw, 50px);
  line-height: 1.03;
  letter-spacing: -0.024em;
  font-weight: 800;
  margin: 0;
  max-width: 15ch;
  color: var(--text);
}

.hero h1 .hl {
  color: var(--c-yellow);
}

.hero p {
  margin: 0;
  font-size: 17px;
  line-height: 1.5;
  color: var(--muted);
  max-width: 38ch;
}

.btn-primary {
  align-self: flex-start;
  background: var(--cta-grad);
  color: #fff;
  border: 0;
  border-radius: 999px;
  padding: 15px 30px;
  font-size: 16px;
  font-weight: 700;
  box-shadow: 0 14px 34px -12px rgba(255, 15, 76, 0.6);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 20px 44px -12px rgba(255, 15, 76, 0.7); }

.hero-rule {
  height: 1px;
  background: var(--hair);
  max-width: 68px;
}

/* ---------- Chat shell ---------- */

.chat { display: none; flex-direction: column; flex: 1; min-height: 0; }
.chat[data-active='true'] { display: flex; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px 12px;
  background: rgba(5, 38, 153, 0.55);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--hair);
}

.back {
  display: none;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--hair-strong);
  border-radius: 999px;
  width: 32px;
  height: 32px;
  line-height: 1;
  padding: 0;
  flex: none;
  color: var(--text);
}
.back[data-show='true'] { display: block; }
.back:hover { border-color: var(--c-cyan); background: rgba(255, 255, 255, 0.18); }

.topbar-meta { flex: 1; min-width: 0; }
.topbar-meta .who { font-size: 13px; font-weight: 700; color: var(--text); }
.topbar-meta .step { display: block; margin-top: 1px; }

.progress {
  height: 3px;
  background: var(--hair);
  border-radius: 99px;
  overflow: hidden;
  margin: 0 18px;
  opacity: 0;
  transition: opacity 0.25s ease;
}
.progress[data-show='true'] { opacity: 1; }
.progress i {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--c-cyan), var(--c-yellow));
  transition: width 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.log {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 20px 18px 8px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scrollbar-width: thin;
}

/* ---------- Bubbles ---------- */

.row { display: flex; gap: 9px; align-items: flex-end; }
.row.me { justify-content: flex-end; }

.avatar {
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: url('revou-logo.svg') center / cover no-repeat;
  border: 1px solid var(--hair);
  margin-bottom: 2px;
}
.row.stacked .avatar { visibility: hidden; }

.hero-logo {
  width: 40px;
  height: 40px;
  margin-bottom: -4px;
}

.topbar-logo {
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
}

.bubble {
  max-width: min(80%, 430px);
  padding: 11px 15px;
  border-radius: var(--radius);
  font-size: 15.5px;
  line-height: 1.48;
  animation: pop 0.28s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.row:not(.me) .bubble {
  background: var(--card);
  border: 1px solid var(--hair);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom-left-radius: 6px;
  color: var(--text);
  box-shadow: var(--shadow-sm);
}
.row.stacked:not(.me) .bubble { border-bottom-left-radius: var(--radius); }

.row.me .bubble {
  background: var(--c-yellow);
  border-bottom-right-radius: 6px;
  font-weight: 700;
  color: var(--c-yellow-ink);
}

.bubble.q { font-size: 17px; letter-spacing: -0.008em; }
.bubble .sub { display: block; margin-top: 5px; font-size: 14px; color: var(--muted); }

.blk-head {
  display: block;
  font-family: var(--sans);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--c-yellow);
  margin-bottom: 6px;
}

@keyframes pop {
  from { opacity: 0; transform: translateY(7px) scale(0.985); }
  to { opacity: 1; transform: none; }
}

.typing { display: flex; gap: 4px; padding: 15px 16px; }
.typing span {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--muted);
  animation: blink 1.25s infinite ease-in-out both;
}
.typing span:nth-child(2) { animation-delay: 0.17s; }
.typing span:nth-child(3) { animation-delay: 0.34s; }
@keyframes blink { 0%, 70%, 100% { opacity: 0.25; transform: none; } 35% { opacity: 1; transform: translateY(-2px); } }

.caret {
  display: inline-block;
  width: 2px;
  height: 1em;
  background: var(--text);
  vertical-align: -0.14em;
  margin-left: 1px;
  animation: caret 0.9s steps(1) infinite;
}
@keyframes caret { 50% { opacity: 0; } }

/* ---------- Option chips ---------- */

.composer {
  flex: none;
  padding: 10px 18px calc(18px + env(safe-area-inset-bottom));
  background: linear-gradient(transparent, rgba(5, 38, 153, 0.85) 42%);
}

.options {
  display: flex;
  flex-direction: column;
  gap: 7px;
  max-height: min(46vh, 400px);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  padding-right: 2px;
}

.chip {
  text-align: left;
  background: var(--card-2);
  border: 1.5px solid var(--hair);
  border-radius: var(--radius);
  padding: 12px 15px;
  font-size: 15px;
  line-height: 1.36;
  color: var(--text);
  transition: border-color 0.14s ease, background 0.14s ease, transform 0.14s ease;
  animation: pop 0.3s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.chip:hover { border-color: var(--c-cyan); background: rgba(255, 255, 255, 0.12); transform: translateY(-2px); }
.chip:active { transform: scale(0.99); }
.chip[data-picked='true'] { border-color: var(--c-yellow); background: var(--c-yellow); color: var(--c-yellow-ink); }
.chip[disabled] { cursor: default; opacity: 0.45; }
.chip[data-picked='true'][disabled] { opacity: 1; }

/* ---------- Result blocks ---------- */

.card {
  max-width: min(88%, 470px);
  border-radius: var(--radius);
  animation: pop 0.34s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.path {
  background: var(--card);
  border: 1px solid var(--hair);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom-left-radius: 6px;
  padding: 18px;
  box-shadow: var(--shadow-sm);
}
.path .leg + .leg { margin-top: 14px; }
.path .val {
  display: block;
  margin-top: 3px;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.015em;
  line-height: 1.2;
  color: var(--text);
}
.path .arrow { margin: 12px 0 0; color: var(--c-yellow); font-size: 20px; line-height: 1; }
.path .arrow::before { content: '↓'; }

.program {
  background: var(--c-blue-deep);
  color: var(--text);
  padding: 22px;
  max-width: min(92%, 480px);
  border: 1px solid var(--hair-strong);
  box-shadow: var(--shadow);
}
.program .name {
  font-size: 27px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin: 6px 0 0;
}
.program .meta {
  font-family: var(--sans);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--c-yellow);
}
.program ul { list-style: none; margin: 18px 0 20px; padding: 0; display: grid; gap: 9px; }
.program li {
  position: relative;
  padding-left: 20px;
  font-size: 14.5px;
  line-height: 1.42;
  color: rgba(255, 255, 255, 0.86);
}
.program li::before {
  content: '';
  position: absolute;
  left: 2px; top: 8px;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--c-yellow);
}
.program .cta {
  display: block;
  width: 100%;
  text-align: center;
  text-decoration: none;
  background: var(--cta-grad);
  color: #fff;
  border-radius: 999px;
  padding: 14px;
  font-size: 16px;
  font-weight: 700;
  box-shadow: 0 14px 34px -12px rgba(255, 15, 76, 0.6);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.program .cta:hover { transform: translateY(-2px); box-shadow: 0 20px 44px -12px rgba(255, 15, 76, 0.7); }

.bridge {
  max-width: min(88%, 470px);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.4;
  padding: 4px 2px;
  color: var(--text);
  animation: pop 0.3s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* ---------- Exit ----------
   The non-HR answer is two bot lines, and the redirect sits inside the second
   bubble — so the only exit style needed is a button that lives in a bubble. */

.bubble .cta {
  /* Block + fit-content so the button drops below the line it answers instead
     of trailing the last word. */
  display: block;
  width: fit-content;
  margin-top: 12px;
  text-decoration: none;
  background: var(--cta-grad);
  color: #fff;
  border-radius: 999px;
  padding: 11px 22px;
  font-size: 14.5px;
  font-weight: 700;
  box-shadow: 0 14px 34px -12px rgba(255, 15, 76, 0.55);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.bubble .cta:hover { transform: translateY(-2px); }

/* ---------- Handoff curtain ----------
   Covers the chat on the way out so the navigation to /hasil reads as one move
   rather than two documents. The reveal page opens on the same colour. */

.curtain {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: var(--c-blue-deep);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}
.curtain[data-show='true'] { opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .typing span { opacity: 0.5; }
}
