/* ==========================================================================
   CBT Patriot — Halaman Login beranimasi (gaya SIAKAD HyperCloud)
   Animasi: aurora bergerak, grid melayang, partikel tersambung (canvas),
   gelombang, cincin berputar, kata berganti, mock soal ujian melayang,
   elemen muncul bertahap. Semua animasi dimatikan bila prefers-reduced-motion.
   ========================================================================== */

body.cbt-ui.no-shell { background: #eef3f9; }
body.cbt-ui .auth-main { display: block !important; min-height: 100vh; padding: 0 !important; background: none !important; }

.cbt-login {
  --cl-blue: #2f74e0;
  --cl-blue-2: #1f5cc5;
  --cl-ink: #15243a;
  --cl-muted: #6b7a90;
  --cl-line: #e2e8f0;
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: clamp(16px, 4vw, 48px);
  overflow: hidden;
  font-family: var(--font-sans, Inter, system-ui, sans-serif);
  color: var(--cl-ink);
  isolation: isolate;
}

/* ---- Latar bergerak --------------------------------------------------- */
.cl-bg { position: absolute; inset: 0; z-index: -1; overflow: hidden; background: linear-gradient(160deg, #f6f9fd 0%, #edf3fb 55%, #e7effa 100%); }
.cl-blob {
  position: absolute; border-radius: 50%; filter: blur(60px); opacity: .55;
  will-change: transform;
}
.cl-blob-1 { width: 46vmax; height: 46vmax; left: -12vmax; top: -16vmax; background: radial-gradient(circle at 30% 30%, #8fc0ff, #2f74e0 70%); animation: cl-drift-1 22s ease-in-out infinite alternate; opacity: .38; }
.cl-blob-2 { width: 38vmax; height: 38vmax; right: -12vmax; top: 18vh; background: radial-gradient(circle at 60% 40%, #9fe6d6, #22b07d 75%); animation: cl-drift-2 26s ease-in-out infinite alternate; opacity: .24; }
.cl-blob-3 { width: 34vmax; height: 34vmax; left: 30vw; bottom: -20vmax; background: radial-gradient(circle, #c7b8ff, #6b72f0 75%); animation: cl-drift-3 30s ease-in-out infinite alternate; opacity: .22; }
@keyframes cl-drift-1 { 0% { transform: translate(0, 0) scale(1); } 50% { transform: translate(8vw, 6vh) scale(1.08); } 100% { transform: translate(14vw, -2vh) scale(.95); } }
@keyframes cl-drift-2 { 0% { transform: translate(0, 0) scale(1); } 50% { transform: translate(-10vw, 8vh) scale(1.12); } 100% { transform: translate(-4vw, -8vh) scale(1); } }
@keyframes cl-drift-3 { 0% { transform: translate(0, 0) scale(1); } 100% { transform: translate(-12vw, -10vh) scale(1.15); } }

.cl-grid {
  position: absolute; inset: -60px;
  background-image:
    linear-gradient(rgba(47, 116, 224, .07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(47, 116, 224, .07) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: radial-gradient(ellipse at 50% 40%, #000 30%, transparent 75%);
  mask-image: radial-gradient(ellipse at 50% 40%, #000 30%, transparent 75%);
  animation: cl-grid-move 18s linear infinite;
}
@keyframes cl-grid-move { to { transform: translate(44px, 44px); } }
.cl-particles { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .75; }

.cl-waves { position: absolute; left: 0; right: 0; bottom: 0; width: 200%; height: 22vh; min-height: 120px; }
.cl-wave { animation: cl-wave 16s linear infinite; }
.cl-wave-1 { fill: rgba(47, 116, 224, .08); }
.cl-wave-2 { fill: rgba(47, 116, 224, .06); animation-duration: 22s; animation-direction: reverse; }
@keyframes cl-wave { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ---- Kartu utama ------------------------------------------------------ */
.cl-shell {
  position: relative;
  width: min(100%, 1080px);
  min-height: 600px;
  display: grid;
  grid-template-columns: minmax(300px, .95fr) minmax(360px, 1.05fr);
  border-radius: 24px;
  background: rgba(255, 255, 255, .88);
  -webkit-backdrop-filter: blur(14px) saturate(150%);
  backdrop-filter: blur(14px) saturate(150%);
  border: 1px solid rgba(255, 255, 255, .9);
  box-shadow: 0 30px 80px rgba(21, 46, 84, .14), 0 2px 6px rgba(21, 46, 84, .05);
  overflow: hidden;
  animation: cl-rise .8s cubic-bezier(.2, .8, .2, 1) both;
}
@keyframes cl-rise { from { opacity: 0; transform: translateY(26px) scale(.985); } to { opacity: 1; transform: none; } }

.cl-reveal { opacity: 0; animation: cl-reveal .7s cubic-bezier(.2, .8, .2, 1) forwards; animation-delay: calc(.25s + var(--d, 0s)); }
@keyframes cl-reveal { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* ---- Panel brand biru ------------------------------------------------- */
.cl-brand {
  position: relative;
  display: flex; flex-direction: column;
  padding: 34px 34px 28px;
  color: #fff;
  background: linear-gradient(150deg, #3a82ea 0%, #2f74e0 40%, #1f5cc5 100%);
  background-size: 160% 160%;
  animation: cl-gradient 14s ease-in-out infinite alternate;
  overflow: hidden;
}
@keyframes cl-gradient { from { background-position: 0% 0%; } to { background-position: 100% 100%; } }
.cl-brand::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: radial-gradient(rgba(255, 255, 255, .16) 1px, transparent 1.2px);
  background-size: 22px 22px;
  -webkit-mask-image: linear-gradient(180deg, #000, transparent 85%);
  mask-image: linear-gradient(180deg, #000, transparent 85%);
  animation: cl-dots 30s linear infinite;
}
@keyframes cl-dots { to { background-position: 220px 110px; } }
.cl-brand::after {
  content: ""; position: absolute; top: -40%; left: -60%; width: 60%; height: 180%; pointer-events: none;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .13), transparent);
  transform: rotate(14deg);
  animation: cl-sweep 7s ease-in-out infinite;
}
@keyframes cl-sweep { 0%, 55% { left: -60%; } 100% { left: 130%; } }

.cl-ring { position: absolute; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .22); pointer-events: none; }
.cl-ring-1 { width: 420px; height: 420px; right: -190px; bottom: -150px; border-style: dashed; animation: cl-spin 60s linear infinite; }
.cl-ring-2 { width: 260px; height: 260px; right: -90px; bottom: -60px; border-color: rgba(255, 255, 255, .16); animation: cl-spin 40s linear infinite reverse; }
@keyframes cl-spin { to { transform: rotate(360deg); } }

.cl-brand-top { position: relative; z-index: 1; display: flex; align-items: center; gap: 12px; }
.cl-logo {
  flex: 0 0 48px; width: 48px; height: 48px; display: grid; place-items: center;
  border-radius: 14px; background: #fff; box-shadow: 0 8px 20px rgba(10, 40, 90, .22);
  animation: cl-bob 5s ease-in-out infinite;
}
.cl-logo img { width: 38px; height: 38px; object-fit: contain; display: block; }
@keyframes cl-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
.cl-brand-name { display: flex; flex-direction: column; min-width: 0; }
.cl-brand-name b { font-size: 17px; font-weight: 800; letter-spacing: .01em; line-height: 1.15; }
.cl-brand-name small { font-size: 11px; font-weight: 700; letter-spacing: .1em; opacity: .85; margin-top: 3px; }

.cl-brand-body { position: relative; z-index: 1; margin-top: auto; padding-top: 30px; }
.cl-chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px; border-radius: 999px;
  background: rgba(255, 255, 255, .16); border: 1px solid rgba(255, 255, 255, .26);
  font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
}
.cl-chip i { width: 7px; height: 7px; border-radius: 50%; background: #7cf0c0; box-shadow: 0 0 0 0 rgba(124, 240, 192, .7); animation: cl-ping 2s ease-out infinite; }
@keyframes cl-ping { 0% { box-shadow: 0 0 0 0 rgba(124, 240, 192, .7); } 80%, 100% { box-shadow: 0 0 0 9px rgba(124, 240, 192, 0); } }
.cl-brand h1 { margin: 16px 0 10px; font-size: clamp(26px, 2.6vw, 34px); line-height: 1.18; font-weight: 800; letter-spacing: -.03em; color: #fff; }
.cl-rotator { display: inline-block; height: 1.18em; overflow: hidden; vertical-align: bottom; }
.cl-rotator > span {
  display: block; height: 1.18em;
  color: #bfe3ff;
  background: linear-gradient(90deg, #ffffff, #bfe3ff 60%, #8ff0cf);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  animation: cl-rotate 7.5s cubic-bezier(.7, 0, .3, 1) infinite;
}
@keyframes cl-rotate {
  0%, 25% { transform: translateY(0); }
  33%, 58% { transform: translateY(-100%); }
  66%, 92% { transform: translateY(-200%); }
  100% { transform: translateY(-300%); }
}
.cl-brand p { margin: 0; max-width: 420px; color: rgba(255, 255, 255, .86); font-size: 13.5px; line-height: 1.65; }

/* Mock soal ujian yang melayang */
.cl-mock { position: relative; margin: 24px 0 4px; height: 226px; }
.cl-mock-card {
  position: absolute; left: 0; top: 10px; width: min(64%, 300px);
  padding: 16px; border-radius: 16px;
  background: rgba(255, 255, 255, .96); color: var(--cl-ink);
  box-shadow: 0 18px 40px rgba(8, 35, 80, .28);
  animation: cl-float-card 6s ease-in-out infinite;
}
@keyframes cl-float-card { 0%, 100% { transform: translateY(0) rotate(-1.2deg); } 50% { transform: translateY(-8px) rotate(.4deg); } }
.cl-mock-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; font-size: 10.5px; font-weight: 700; color: #6b7a90; letter-spacing: .04em; }
.cl-mock-timer { display: inline-flex; align-items: center; gap: 5px; color: #2f74e0; }
.cl-mock-timer i { width: 6px; height: 6px; border-radius: 50%; background: #2f74e0; animation: cl-blink 1s steps(2, start) infinite; }
@keyframes cl-blink { to { visibility: hidden; } }
.cl-mock-line { display: block; height: 7px; border-radius: 7px; background: #e6edf6; margin: 6px 0; }
.cl-mock-line.w90 { width: 90%; } .cl-mock-line.w75 { width: 75%; } .cl-mock-line.w70 { width: 70%; } .cl-mock-line.w60 { width: 60%; } .cl-mock-line.w50 { width: 50%; }
.cl-mock-opt { display: flex; align-items: center; gap: 9px; margin-top: 7px; padding: 6px 8px; border: 1px solid #e6edf6; border-radius: 9px; }
.cl-mock-opt b { flex: 0 0 20px; height: 20px; display: grid; place-items: center; border-radius: 6px; background: #eef3f9; color: #6b7a90; font-size: 10px; }
.cl-mock-opt .cl-mock-line { flex: 1; margin: 0; }
.cl-mock-opt em { font-style: normal; color: #12865f; font-weight: 800; font-size: 12px; opacity: 0; animation: cl-check 6s ease-in-out infinite; }
.cl-mock-opt.is-pick { animation: cl-pick 6s ease-in-out infinite; }
.cl-mock-opt.is-pick b { animation: cl-pick-b 6s ease-in-out infinite; }
@keyframes cl-pick { 0%, 30% { border-color: #e6edf6; background: #fff; } 40%, 100% { border-color: #9cc2f4; background: #eff6ff; } }
@keyframes cl-pick-b { 0%, 30% { background: #eef3f9; color: #6b7a90; } 40%, 100% { background: #2f74e0; color: #fff; } }
@keyframes cl-check { 0%, 38% { opacity: 0; transform: scale(.4); } 46%, 100% { opacity: 1; transform: scale(1); } }
.cl-mock-progress { margin-top: 11px; height: 5px; border-radius: 5px; background: #e6edf6; overflow: hidden; }
.cl-mock-progress span { display: block; height: 100%; width: 18%; border-radius: 5px; background: linear-gradient(90deg, #2f74e0, #5aa2f5); animation: cl-progress 6s ease-in-out infinite; }
@keyframes cl-progress { 0%, 35% { width: 15%; } 50%, 100% { width: 18%; } 60%, 95% { width: 20%; } }

.cl-float {
  position: absolute; display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 12px; border-radius: 12px;
  background: rgba(255, 255, 255, .18); border: 1px solid rgba(255, 255, 255, .3);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  color: #fff; font-size: 11.5px; font-weight: 700; white-space: nowrap;
  box-shadow: 0 10px 24px rgba(8, 35, 80, .18);
}
.cl-float .ui-icon { width: 15px; height: 15px; }
.cl-float-1 { right: 0; top: 6px; animation: cl-float-a 7s ease-in-out infinite; }
.cl-float-2 { right: 18px; bottom: 4px; animation: cl-float-b 8s ease-in-out infinite; }
@keyframes cl-float-a { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(-6px, 10px); } }
@keyframes cl-float-b { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(8px, -9px); } }

.cl-brand-foot { position: relative; z-index: 1; display: flex; align-items: center; gap: 10px; margin-top: 22px; font-size: 10.5px; font-weight: 800; letter-spacing: .16em; opacity: .9; }
.cl-brand-foot i { width: 4px; height: 4px; border-radius: 50%; background: rgba(255, 255, 255, .7); }

/* ---- Panel form ------------------------------------------------------- */
.cl-panel { display: flex; flex-direction: column; padding: 40px clamp(24px, 4.5vw, 58px) 22px; background: #fff; min-width: 0; }
.cl-panel-inner { width: 100%; max-width: 400px; margin: auto; }
.cl-mobile-brand { display: none; align-items: center; gap: 11px; margin-bottom: 22px; }
.cl-mobile-brand .cl-logo { background: #eaf3fe; box-shadow: none; }
.cl-mobile-brand .cl-brand-name b { color: var(--cl-blue); }
.cl-mobile-brand .cl-brand-name small { color: #6aa5ec; }
.cl-eyebrow { margin: 0 0 8px; color: var(--cl-blue); font-size: 11px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
.cl-panel h2 { margin: 0; font-size: clamp(23px, 2.2vw, 28px); font-weight: 800; letter-spacing: -.03em; color: var(--cl-ink); }
.cl-lead { margin: 8px 0 24px; color: var(--cl-muted); font-size: 13.5px; line-height: 1.6; }

.cl-form { display: grid; gap: 14px; }
.cl-field { display: grid; gap: 7px; }
.cl-label { color: #445a72; font-size: 12.5px; font-weight: 700; }
.cl-input {
  position: relative; display: flex; align-items: center;
  border: 1px solid #dce4ee; border-radius: 12px; background: #f9fbfe;
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
.cl-input:focus-within { border-color: #8bb6f2; background: #fff; box-shadow: 0 0 0 4px rgba(47, 116, 224, .12); }
.cl-input > .ui-icon { position: absolute; left: 14px; width: 18px; height: 18px; color: #8597ad; pointer-events: none; transition: color .18s ease; }
.cl-input:focus-within > .ui-icon { color: var(--cl-blue); }
body.cbt-ui .cl-input input {
  width: 100%; min-height: 48px; margin: 0;
  padding: 12px 46px 12px 44px !important;
  border: 0 !important; border-radius: 12px !important; background: transparent !important; box-shadow: none !important;
  color: var(--cl-ink); font-size: 14.5px; outline: 0;
}
body.cbt-ui .cl-input input::placeholder { color: #a3afc0; }
.cl-eye {
  position: absolute; right: 6px; width: 38px; height: 38px; display: grid; place-items: center;
  border: 0; border-radius: 10px; background: transparent; color: #8597ad; cursor: pointer;
}
.cl-eye:hover { background: #eef3f9; color: var(--cl-blue); }
.cl-eye[aria-pressed="true"] { color: var(--cl-blue); }
.cl-eye svg, .cl-eye .ui-icon { width: 18px; height: 18px; display: block; }
.cl-caps { margin: -4px 0 0; color: #a46a06; font-size: 12px; font-weight: 700; }

.cl-submit {
  position: relative; overflow: hidden;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 50px; margin-top: 6px; padding: 12px 18px;
  border: 0; border-radius: 12px;
  background: linear-gradient(100deg, #2f74e0, #4f93f0);
  color: #fff; font-size: 15px; font-weight: 750; cursor: pointer;
  box-shadow: 0 12px 26px rgba(47, 116, 224, .3);
  transition: transform .16s ease, box-shadow .16s ease, filter .16s ease;
}
.cl-submit::before {
  content: ""; position: absolute; top: 0; left: -80%; width: 50%; height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .35), transparent);
  transform: skewX(-18deg);
  animation: cl-shine 3.6s ease-in-out infinite 1.5s;
}
@keyframes cl-shine { 0%, 60% { left: -80%; } 100% { left: 140%; } }
.cl-submit:hover { transform: translateY(-1px); box-shadow: 0 16px 32px rgba(47, 116, 224, .36); }
.cl-submit:active { transform: translateY(0) scale(.99); }
.cl-submit-arrow { transition: transform .2s ease; }
.cl-submit:hover .cl-submit-arrow { transform: translateX(4px); }
.cl-spinner { display: none; width: 18px; height: 18px; border: 2.5px solid rgba(255, 255, 255, .45); border-top-color: #fff; border-radius: 50%; animation: cl-spin .7s linear infinite; }
.cl-submit.is-loading { pointer-events: none; filter: saturate(.9); }
.cl-submit.is-loading .cl-submit-arrow { display: none; }
.cl-submit.is-loading .cl-spinner { display: inline-block; }

.cl-secure {
  display: flex; align-items: flex-start; gap: 11px;
  margin-top: 18px; padding: 12px 14px;
  border: 1px solid #d8e8fa; border-radius: 12px; background: #f3f8ff;
}
.cl-secure > .ui-icon { flex: 0 0 20px; width: 20px; height: 20px; color: var(--cl-blue); margin-top: 1px; }
.cl-secure b { display: block; font-size: 12.5px; color: var(--cl-ink); }
.cl-secure small { display: block; margin-top: 2px; font-size: 11.5px; color: var(--cl-muted); line-height: 1.5; }

.cl-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.cl-meta > span {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 10px; border: 1px solid var(--cl-line); border-radius: 999px;
  color: #50667c; font-size: 11.5px; font-weight: 600; background: #fff;
}
.cl-meta .ui-icon { width: 14px; height: 14px; color: #8597ad; }
.cl-meta b { font-variant-numeric: tabular-nums; color: var(--cl-ink); }
.cl-dot { width: 7px; height: 7px; border-radius: 50%; background: #22b07d; animation: cl-ping-g 2s ease-out infinite; }
@keyframes cl-ping-g { 0% { box-shadow: 0 0 0 0 rgba(34, 176, 125, .55); } 80%, 100% { box-shadow: 0 0 0 7px rgba(34, 176, 125, 0); } }
.cl-note { margin: 14px 0 0; color: #8a98ab; font-size: 11.5px; line-height: 1.6; }
.cl-panel-foot { margin-top: 22px; padding-top: 14px; border-top: 1px solid #eef2f7; color: #94a2b4; font-size: 11px; text-align: center; }

/* Flash/peringatan di atas kartu */
body.cbt-ui.no-shell .auth-main > .alert { position: fixed; top: 16px; left: 50%; transform: translateX(-50%); z-index: 20; width: min(92vw, 520px); box-shadow: 0 12px 30px rgba(21, 46, 84, .14); }

/* ---- Responsif -------------------------------------------------------- */
@media (max-width: 900px) {
  .cl-shell { grid-template-columns: 1fr; min-height: 0; max-width: 520px; }
  .cl-brand { padding: 26px 24px 22px; }
  .cl-brand-top { display: none; }
  .cl-brand-body { padding-top: 0; margin-top: 0; }
  .cl-brand h1 { margin-top: 12px; font-size: 25px; }
  .cl-brand p { font-size: 12.5px; }
  .cl-mock { height: 150px; margin-top: 18px; }
  .cl-mock-card { width: 250px; padding: 12px; }
  .cl-mock-opt:nth-of-type(3), .cl-mock-line.w70 { display: none; }
  .cl-brand-foot { display: none; }
  .cl-panel { padding: 26px 22px 18px; order: -1; }
  .cl-mobile-brand { display: flex; }
}
@media (max-width: 480px) {
  .cbt-login { padding: 12px; place-items: start center; }
  .cl-shell { border-radius: 20px; }
  .cl-mock { display: none; }
  .cl-float { display: none; }
  .cl-brand h1 { font-size: 22px; }
}

@media (prefers-reduced-motion: reduce) {
  .cbt-login *, .cbt-login *::before, .cbt-login *::after { animation: none !important; transition: none !important; }
  .cl-reveal { opacity: 1 !important; }
  .cl-rotator > span { transform: none !important; }
  .cl-particles { display: none; }
}
