:root {
  --navy: #14213d;
  --navy-2: #22315a;
  --orange: #e8622c;
  --orange-2: #ff7a45;
  --cream: #f7f4ec;
  --cream-2: #fffdf8;
  --ink: #22262e;
  --muted: #6b7280;
  --line: #e2e2df;
  --teal: #2a9d8f;
  --danger: #c0392b;
  --radius: 16px;
  --shadow: 0 18px 40px rgba(20, 33, 61, 0.18);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 20% -10%, #22315a 0%, transparent 60%),
    linear-gradient(160deg, #0f1a30 0%, #14213d 45%, #101a2f 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100dvh;
  padding: 18px 14px 64px;
}

#app {
  width: 100%;
  max-width: 460px;
}

/* ------------------------------- layar ------------------------------- */

.screen { display: none; }
.screen.is-active { display: block; animation: fade 0.28s ease; }

@keyframes fade {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.card {
  background: var(--cream-2);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 26px 22px;
  border: 1px solid rgba(20, 33, 61, 0.06);
}

.card-center { text-align: center; }

/* ------------------------------ tipografi ------------------------------ */

.kicker {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 11px;
  font-weight: 700;
  color: var(--orange);
  margin: 0 0 10px;
}

h1 { font-size: 25px; line-height: 1.2; margin: 0 0 12px; color: var(--navy); }
h2 { font-size: 19px; line-height: 1.25; margin: 0 0 10px; color: var(--navy); }
h3 { font-size: 15px; margin: 20px 0 8px; color: var(--navy); }
p { margin: 0 0 12px; line-height: 1.55; }

.muted { color: var(--muted); }
.tiny { font-size: 11.5px; line-height: 1.5; }

/* -------------------------------- tombol -------------------------------- */

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 15px 18px;
  border: none;
  border-radius: 12px;
  font-size: 15.5px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
  text-decoration: none;
}
.btn:active { transform: scale(0.985); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn[hidden] { display: none; }

.btn-primary {
  background: linear-gradient(180deg, var(--orange-2), var(--orange));
  color: #fff;
  box-shadow: 0 10px 22px rgba(232, 98, 44, 0.35);
  margin-top: 16px;
}

.btn-ghost {
  background: transparent;
  color: var(--muted);
  font-weight: 600;
  font-size: 13.5px;
  padding: 12px;
  margin-top: 6px;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.btn-provider {
  background: #fff;
  color: var(--ink);
  border: 1.5px solid var(--line);
  font-weight: 600;
  justify-content: flex-start;
  padding: 14px 16px;
}
.btn-provider:hover { border-color: #c9cdd6; }

.provider-list { display: grid; gap: 12px; margin: 18px 0 14px; }

.brand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  font-weight: 800;
  font-size: 15px;
  color: #fff;
  flex: 0 0 auto;
}
.brand-google { background: #fff; color: #4285f4; border: 1.5px solid var(--line); }
.brand-instagram { background: linear-gradient(45deg, #f9ce34, #ee2a7b 50%, #6228d7); }
.brand-lg { width: 52px; height: 52px; border-radius: 14px; font-size: 22px; margin: 0 auto 14px; }

/* -------------------------------- landing -------------------------------- */

.prize-visual {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 132px;
  margin: 8px 0 16px;
  border-radius: 14px;
  background: radial-gradient(circle at 50% 45%, #fff3e6, #ffe4cf 70%);
}
.gift { font-size: 62px; animation: bob 2.4s ease-in-out infinite; }
@keyframes bob { 0%,100% { transform: translateY(0) rotate(-3deg); } 50% { transform: translateY(-8px) rotate(3deg); } }

/* -------------------------------- spinner -------------------------------- */

.spinner {
  width: 44px; height: 44px;
  margin: 6px auto 18px;
  border-radius: 50%;
  border: 4px solid rgba(20, 33, 61, 0.14);
  border-top-color: var(--orange);
  animation: spin 0.85s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* -------------------------------- login -------------------------------- */

.login-card { padding-top: 30px; }
.login-head { text-align: center; margin-bottom: 20px; }
.login-head h2 { margin-bottom: 4px; }
.login-head p { margin: 0; font-size: 13px; }

.field { display: block; margin-bottom: 14px; }
.field span {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 6px;
}
.field input {
  width: 100%;
  padding: 13px 14px;
  font-size: 15px;
  font-family: inherit;
  color: var(--ink);
  border: 1.5px solid var(--line);
  border-radius: 10px;
  background: #fff;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.field input:focus { border-color: var(--orange); box-shadow: 0 0 0 3px rgba(232, 98, 44, 0.14); }

/* --------------------------- popup permission --------------------------- */

.perm-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px;
  background: rgba(10, 16, 30, 0.55);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
  animation: fade 0.18s ease;
}
.perm-modal[hidden] { display: none; }

.perm-dialog {
  width: 100%;
  max-width: 360px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.38);
  overflow: hidden;
  animation: pop 0.22s cubic-bezier(0.2, 0.9, 0.3, 1.15);
}
@keyframes pop {
  from { transform: scale(0.92); opacity: 0; }
  to { transform: none; opacity: 1; }
}

.perm-dialog-body {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 20px 20px 16px;
}
.perm-dialog-icon { font-size: 26px; line-height: 1; }
.perm-dialog-body strong { display: block; font-size: 16px; color: var(--navy); margin-bottom: 5px; }
.perm-dialog-body p { margin: 0; font-size: 13px; line-height: 1.45; }

.perm-dialog-actions { display: flex; border-top: 1px solid var(--line); }
.perm-choice {
  flex: 1;
  padding: 14px;
  border: none;
  background: #fff;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  color: #5b6270;
  cursor: pointer;
}
.perm-choice + .perm-choice { border-left: 1px solid var(--line); }
.perm-choice-primary { color: var(--orange); }

/* -------------------------------- pass -------------------------------- */

.pass-card { border-top: 6px solid var(--teal); }
.big-emoji { font-size: 54px; line-height: 1; margin-bottom: 8px; }
.pass-title { color: var(--teal); font-size: 30px; letter-spacing: 0.02em; }
.medal {
  display: inline-block;
  margin: 10px 0 6px;
  padding: 10px 18px;
  border-radius: 999px;
  background: #e9f7f4;
  color: #166a5f;
  font-weight: 700;
  border: 1.5px solid #bfe6df;
}

ul.tips, ul.facts, ol.steps, ul.links { text-align: left; padding-left: 20px; margin: 0 0 12px; }
ul.tips li, ul.facts li, ol.steps li, ul.links li { margin-bottom: 8px; line-height: 1.5; font-size: 14px; }
ul.links { list-style: none; padding-left: 0; }
ul.links li {
  font-family: "SF Mono", Menlo, Consolas, monospace;
  background: #eef1f6;
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 13px;
}

/* -------------------------------- wheel -------------------------------- */

.wheel-wrap {
  position: relative;
  width: 100%;
  max-width: 330px;
  margin: 18px auto 6px;
}
.wheel-wrap canvas {
  width: 100%;
  height: auto;
  display: block;
  filter: drop-shadow(0 12px 24px rgba(20, 33, 61, 0.28));
}
.wheel-pointer {
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 0; height: 0;
  border-left: 13px solid transparent;
  border-right: 13px solid transparent;
  border-top: 22px solid var(--navy);
  z-index: 2;
}

/* -------------------------------- debrief -------------------------------- */

.debrief-card { border-top: 6px solid var(--danger); }
.stop-banner {
  display: inline-block;
  background: #fdecea;
  color: var(--danger);
  font-weight: 800;
  font-size: 12.5px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 7px 12px;
  border-radius: 8px;
  margin-bottom: 14px;
}

/* -------------------------------- footer -------------------------------- */

.sim-footer {
  width: 100%;
  max-width: 460px;
  text-align: center;
  color: rgba(255, 255, 255, 0.5);
  font-size: 11px;
  margin-top: 18px;
  line-height: 1.5;
}

.noscript { color: #fff; text-align: center; padding: 20px; }

/* ==========================================================================
   TEMA PER HALAMAN PROVIDER
   ========================================================================== */
body[data-theme="provider"] { background: #f5f5f5; }
body[data-theme="google"] { background: #fff; }
body[data-theme="instagram"] { background: #fafafa; }

body[data-theme="provider"] .sim-footer,
body[data-theme="google"] .sim-footer,
body[data-theme="instagram"] .sim-footer { display: none; }

/* ------------------- halaman pilih metode (kartu OAuth) ------------------- */

.ocard {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  background: #fefefe;
  border-radius: 8px;
  padding: 26px 22px;
  box-shadow: 0 24px 64px 0 rgba(24, 24, 24, 0.10);
}
@media (min-width: 560px) {
  .ocard { padding: 52px 56px; }
}

.ocard-logo { display: flex; margin-bottom: 30px; }
.ocard-title { font-size: 22px; font-weight: 500; color: #181818; margin: 0 0 24px; }

.ocard-form { display: flex; flex-direction: column; }
.ocard-label {
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: #181818;
  margin-bottom: 6px;
}
.ocard-input {
  width: 100%;
  padding: 10px 16px;
  font-size: 14px;
  font-family: inherit;
  color: #181818;
  background: #fefefe;
  border: 1px solid #cecece;
  border-radius: 4px;
  outline: 2px solid transparent;
  outline-offset: 2px;
  transition: border-color 0.15s ease, outline-color 0.15s ease;
}
.ocard-input:hover { border-color: #b4e4bb; }
.ocard-input:focus { border-color: #1db954; outline-color: #daf2dd; outline-offset: 0; }

.ocard-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  border-radius: 9999px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.ocard-btn-solid { background: #191919; color: #fefefe; border: 1px solid #191919; margin-top: 24px; }
.ocard-btn-solid:hover { background: #3b3b3b; }

.ocard-divider { border: none; border-top: 1px solid #e2e2e2; margin: 24px 0; }

.ocard-btn-outline { background: transparent; color: #191919; border: 1px solid #cecece; }
.ocard-btn-outline + .ocard-btn-outline { margin-top: 12px; }
.ocard-btn-outline:hover { background: #e8e8e8; }

.prov-ic { width: 18px; height: 18px; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.ig-glyph {
  background: linear-gradient(45deg, #f9ce34, #ee2a7b 50%, #6228d7);
  border-radius: 5px;
  display: inline-flex; align-items: center; justify-content: center;
}

/* ------------------------------ halaman Google ------------------------------ */

.gpage { width: 100%; padding: 34px 8px 6px; }
.gcard {
  width: 100%; max-width: 448px; margin: 0 auto;
  background: #fff; border: none; border-radius: 28px;
  padding: 44px 38px 34px;
  box-shadow: 0 1px 3px rgba(60, 64, 67, 0.3), 0 4px 8px 3px rgba(60, 64, 67, 0.08);
}
.glogo {
  font-family: Arial, Helvetica, sans-serif;
  font-size: 26px; letter-spacing: -1px; margin-bottom: 20px;
}
.gl1 { color: #4285F4; } .gl2 { color: #EA4335; } .gl3 { color: #FBBC05; }
.gl4 { color: #4285F4; } .gl5 { color: #34A853; }
.gtitle { font-size: 24px; font-weight: 400; color: #202124; margin: 0 0 8px; }
.gsub { font-size: 16px; color: #202124; margin: 0 0 26px; }
.gchip {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 14px; color: #202124; background: #f1f3f4;
  border-radius: 16px; padding: 7px 13px; margin-bottom: 24px;
}
.gfield { position: relative; margin-top: 6px; }
.ginput {
  width: 100%; height: 56px;
  border: 1px solid #747775; border-radius: 4px;
  padding: 0 15px; font-size: 16px; font-family: inherit;
  color: #202124; background: #fff; outline: none;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
.ginput:hover { border-color: #202124; }
.ginput:focus { border-color: #0b57d0; box-shadow: inset 0 0 0 1px #0b57d0; }

.gfloat {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  padding: 0 4px;
  background: #fff;
  color: #444746;
  font-size: 16px;
  pointer-events: none;
  transition: font-size 0.1s ease, top 0.1s ease, color 0.1s ease;
}
.ginput:focus ~ .gfloat,
.ginput:not(:placeholder-shown) ~ .gfloat {
  top: 0;
  font-size: 12px;
  color: #444746;
}
.ginput:focus ~ .gfloat { color: #0b57d0; }

.glink {
  display: inline-block; font-size: 14px; color: #0b57d0;
  font-weight: 500; text-decoration: none; margin-top: 18px;
}
.glink-tight { margin-top: 8px; }
.glink-action { margin-top: 0; }

.gshow {
  display: flex; align-items: center; gap: 12px;
  margin-top: 14px;
  font-size: 14px; color: #202124;
  cursor: pointer;
}
.gshow input {
  width: 18px; height: 18px; margin: 0;
  accent-color: #0b57d0; cursor: pointer;
}

.gactions { display: flex; align-items: center; justify-content: space-between; margin-top: 28px; }
.gactions-split { align-items: center; }
.gactions-split .ghint { flex: 1; padding-right: 24px; }
.gbtn {
  background: #0b57d0; color: #fff; border: none; border-radius: 9999px;
  padding: 11px 26px; font-size: 14px; font-weight: 500; font-family: inherit; cursor: pointer;
}
.gbtn:hover { background: #1a63d1; box-shadow: 0 1px 2px rgba(60, 64, 67, 0.3); }
.ghint { font-size: 14px; color: #5f6368; line-height: 1.45; margin: 0; }
.gfooter {
  display: flex; align-items: center; gap: 22px;
  width: 100%; max-width: 448px; margin: 20px auto 0;
  font-size: 12px; color: #70757a;
}
.gfooter .gsep { flex: 1; }

/* ----------------------------- halaman Instagram ----------------------------- */

.igwrap { width: 100%; max-width: 350px; margin: 0 auto; padding-top: 26px; }
.igcard {
  background: #fff; border: 1px solid #dbdbdb; border-radius: 12px;
  padding: 38px 30px 22px; margin-bottom: 10px;
}
.iglogo { display: flex; justify-content: center; margin-bottom: 26px; }
.ig-glyph-lg { width: 58px; height: 58px; border-radius: 15px; }
.iginput {
  width: 100%; height: 44px; margin-bottom: 8px;
  background: #fafafa; border: 1px solid #dbdbdb; border-radius: 12px;
  padding: 0 12px; font-size: 14px; font-family: inherit;
  color: #262626; outline: none;
}
.iginput:focus { border-color: #a8a8a8; }
.igbtn {
  width: 100%; height: 44px; margin-top: 8px;
  background: #0095f6; color: #fff; border: none; border-radius: 12px;
  font-size: 14px; font-weight: 600; font-family: inherit; cursor: pointer;
}
.igbtn:hover { filter: brightness(0.94); }
.igsep {
  display: flex; align-items: center; gap: 16px;
  margin: 20px 0 16px; color: #8e8e8e; font-size: 13px; font-weight: 600;
}
.igsep::before, .igsep::after { content: ""; flex: 1; height: 1px; background: #dbdbdb; }
.igfb {
  display: block; text-align: center; margin-bottom: 16px;
  color: #385185; font-size: 14px; font-weight: 600; text-decoration: none;
}
.igforgot { display: block; text-align: center; color: #00376b; font-size: 12px; text-decoration: none; }
.igsig { padding: 18px; text-align: center; font-size: 14px; color: #262626; }
.igsig a { color: #0095f6; font-weight: 600; text-decoration: none; }

/* ----------------------------- halaman demo ----------------------------- */

.demo-card {
  width: 100%;
  max-width: 540px;
}
.demo-view {
  margin: 16px 0 4px;
  min-height: 120px;
}
.demo-view video,
.demo-view img {
  display: block;
  width: 100%;
  border-radius: 12px;
  background: #10182b;
  transform: scaleX(-1);
}
.demo-msg { color: var(--danger); }

/* --------------------- kamera transparan di debrief --------------------- */

.camera-demo {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px dashed var(--line);
  text-align: left;
}
.camera-demo h3 { margin-top: 0; }
.cam-view { margin: 12px 0 8px; }
.cam-view video,
.cam-view img {
  display: block;
  width: 100%;
  border-radius: 12px;
  background: #10182b;
  transform: scaleX(-1);
}
.demo-view [hidden] { display: none; }
.cam-view [hidden] { display: none; }
.cam-msg { color: var(--danger); }

