/* ============================================================
   ISYARAT — Global Stylesheet
   assets/css/style.css
   ============================================================ */

/* ---------- CSS Variables ---------- */
:root {
  --bg-cream:   #FFF8EE;
  --ink:        #362B4F;
  --ink-soft:   #6B6280;
  --gold:       #FFB627;
  --gold-deep:  #E89A0C;
  --teal:       #2EC4B6;
  --teal-deep:  #1F9C90;
  --coral:      #FF6F59;
  --mint:       #3FCB80;
  --navy:       #1B1B3A;
  --navy-soft:  #2A2A52;
  --card-line:  #EFE4D0;
  --radius-lg:  28px;
  --radius-md:  18px;
  --radius-sm:  12px;

  /* Auth-page extras */
  --auth-bg-from: #EFEAFE;
  --auth-bg-to:   #FDEBD8;
}

/* ---------- Reset & Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
  font-family: 'Atkinson Hyperlegible', sans-serif;
  background: linear-gradient(180deg, #EFEAFE 0%, #FDF3E4 55%, #FDEBD8 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
}

a { color: var(--teal-deep); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- Main App Container (Responsive View) ---------- */
.app-container {
  width: 100%;
  max-width: 600px; /* Maksimal lebar untuk tampilan web desktop */
  height: 100dvh;   /* Menggunakan dVH (dynamic viewport height) agar cocok di Android/iOS */
  background: var(--bg-cream);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 10px 40px -10px rgba(27,27,58,.2);
}

/* Aturan untuk menghilangkan max-width di perangkat mobile seutuhnya */
@media (max-width: 600px) {
  .app-container {
    max-width: 100%;
    box-shadow: none;
  }
}

/* ---------- Screens ---------- */
.screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity .28s ease, transform .28s ease;
}
.screen.active {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}
.screen-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 24px 20px 14px; /* Padding atas disesuaikan karena tidak ada notch */
}
.screen-scroll::-webkit-scrollbar { width: 0; }

/* ---------- App Header ---------- */
.app-header { padding: 0 4px 14px; }
.eyebrow {
  font-size: 11px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--ink-soft);
  font-weight: 700;
  margin: 0 0 2px;
}
h1.title {
  font-family: 'Baloo 2', sans-serif;
  font-size: 26px;
  margin: 0;
  color: var(--ink);
}
h2.section-title {
  font-family: 'Baloo 2', sans-serif;
  font-size: 17px;
  font-weight: 700;
  margin: 20px 0 10px;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 8px;
}
p.lead {
  font-size: 14px;
  color: var(--ink-soft);
  line-height: 1.5;
  margin: 6px 0 0;
}

/* ---------- Home: Mascot Card ---------- */
.mascot-card {
  background: linear-gradient(135deg, var(--teal) 0%, var(--teal-deep) 100%);
  border-radius: var(--radius-lg);
  padding: 22px;
  color: white;
  position: relative;
  overflow: hidden;
  margin-top: 8px;
}
.mascot-card::after {
  content: "";
  position: absolute; right: -30px; top: -30px;
  width: 140px; height: 140px; border-radius: 50%;
  background: rgba(255,255,255,.12);
}
.mascot-emoji {
  font-size: 44px;
  display: inline-block;
  filter: drop-shadow(0 4px 6px rgba(0,0,0,.15));
}
.mascot-card h3 {
  font-family: 'Baloo 2', sans-serif;
  font-size: 19px; margin: 10px 0 4px;
}
.mascot-card p { font-size: 13.5px; margin: 0; opacity: .95; line-height: 1.5; }

/* ---------- Home: Menu Grid ---------- */
.menu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); /* Responsif */
  gap: 12px;
  margin-top: 16px;
}
.menu-tile {
  background: white;
  border: 1px solid var(--card-line);
  border-radius: var(--radius-md);
  padding: 16px 14px;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  transition: transform .15s ease, box-shadow .15s ease;
}
.menu-tile:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 18px -10px rgba(54,43,79,.25);
}
.menu-tile .ic {
  width: 38px; height: 38px; border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  font-size: 19px; margin-bottom: 10px;
}
.menu-tile h4 {
  font-family: 'Baloo 2', sans-serif;
  font-size: 14.5px; margin: 0 0 3px; color: var(--ink);
}
.menu-tile span { font-size: 12px; color: var(--ink-soft); }

/* ---------- Streak Row ---------- */
.streak-row {
  display: flex; align-items: center; gap: 10px;
  background: white; border: 1px solid var(--card-line);
  border-radius: var(--radius-md); padding: 12px 14px; margin-top: 14px;
}
.streak-row .flame { font-size: 22px; }
.streak-row .txt { flex: 1; }
.streak-row .txt b { font-family: 'Baloo 2', sans-serif; font-size: 13.5px; }
.streak-row .txt div { font-size: 11.5px; color: var(--ink-soft); }
.pill {
  background: var(--gold); color: var(--navy); font-weight: 700;
  font-size: 11px; padding: 4px 10px; border-radius: 20px;
}

/* ---------- Caption Bar ---------- */
.caption-bar {
  background: var(--navy);
  color: #fff;
  padding: 12px 18px 14px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  line-height: 1.45;
  border-top: 3px solid var(--gold);
}
.caption-bar .cc-badge {
  flex: 0 0 auto;
  background: var(--gold);
  color: var(--navy);
  font-family: 'Baloo 2', sans-serif;
  font-weight: 800; font-size: 10.5px;
  padding: 3px 6px; border-radius: 6px;
  letter-spacing: .03em; margin-top: 1px;
}
.caption-bar .cc-text { opacity: .96; }

/* ---------- Bottom Navigation ---------- */
.bottom-nav {
  display: flex;
  background: white;
  border-top: 1px solid var(--card-line);
  padding: 10px 6px 14px;
}
.nav-btn {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  background: none; border: none;
  font-family: 'Atkinson Hyperlegible', sans-serif;
  color: var(--ink-soft); font-size: 10.5px; cursor: pointer; padding: 4px 0;
}
.nav-btn .nav-ic {
  width: 26px; height: 26px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center; font-size: 14px;
}
.nav-btn.active { color: var(--ink); font-weight: 700; }
.nav-btn.active .nav-ic { background: var(--gold); }

/* ---------- AR Screen ---------- */
.ar-view {
  flex: 1;
  background: radial-gradient(circle at 30% 20%, #26264d 0%, var(--navy) 65%);
  position: relative; display: flex; flex-direction: column;
  padding: 24px 0 0; overflow: hidden;
}
.ar-topbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0 18px 10px; color: #fff;
}
.ar-topbar .lbl { font-family: 'Baloo 2', sans-serif; font-size: 15px; }
.ar-topbar .close {
  width: 30px; height: 30px; border-radius: 50%;
  background: rgba(255,255,255,.14);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 14px; cursor: pointer; border: none;
}
.ar-frame {
  flex: 1; margin: 6px 20px 16px; position: relative;
  border-radius: 24px; overflow: hidden;
  background: linear-gradient(160deg, #3a3a68, #20203f);
}
.corner {
  position: absolute; width: 34px; height: 34px;
  border-color: var(--teal); border-style: solid; border-width: 0;
}
.corner.tl { top: 14px; left: 14px; border-top-width: 4px; border-left-width: 4px; border-radius: 8px 0 0 0; }
.corner.tr { top: 14px; right: 14px; border-top-width: 4px; border-right-width: 4px; border-radius: 0 8px 0 0; }
.corner.bl { bottom: 14px; left: 14px; border-bottom-width: 4px; border-left-width: 4px; border-radius: 0 0 0 8px; }
.corner.br { bottom: 14px; right: 14px; border-bottom-width: 4px; border-right-width: 4px; border-radius: 0 0 8px 0; }
.scan-line {
  position: absolute; left: 14px; right: 14px; height: 3px;
  background: linear-gradient(90deg, transparent, var(--teal), transparent);
  animation: scan 2.4s ease-in-out infinite; border-radius: 3px;
}
@keyframes scan {
  0%   { top: 20%; opacity: .2; }
  50%  { top: 78%; opacity: 1;  }
  100% { top: 20%; opacity: .2; }
}
.hand-target {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
}
.hand-target svg {
  width: 120px; height: 120px; opacity: .9;
  animation: pulseHand 1.8s ease-in-out infinite;
}
@keyframes pulseHand {
  0%, 100% { transform: scale(1); opacity: .75; }
  50%       { transform: scale(1.06); opacity: 1; }
}
.ar-badge {
  position: absolute; top: 16px; left: 16px;
  background: rgba(63,203,128,.16); border: 1px solid var(--mint);
  color: var(--mint); font-size: 11px; font-weight: 700;
  padding: 5px 10px; border-radius: 20px;
}
.ar-instruction { padding: 4px 20px 10px; color: #fff; }
.ar-instruction .word { font-family: 'Baloo 2', sans-serif; font-size: 22px; margin: 0 0 4px; }
.ar-instruction .step { font-size: 12.5px; color: #C9C6E0; }
.ar-controls { display: flex; gap: 10px; padding: 0 20px 10px; }
.ar-btn {
  flex: 1; padding: 12px; border-radius: 16px; border: none;
  font-family: 'Baloo 2', sans-serif; font-weight: 700; font-size: 13.5px; cursor: pointer;
}
.ar-btn.primary { background: var(--gold); color: var(--navy); }
.ar-btn.ghost   { background: rgba(255,255,255,.1); color: #fff; }

/* ---------- Lessons Screen ---------- */
.tab-row { display: flex; gap: 8px; margin-top: 6px; }
.tab-chip {
  padding: 7px 14px; border-radius: 20px; font-size: 12.5px; font-weight: 700;
  border: 1px solid var(--card-line); background: white;
  color: var(--ink-soft); cursor: pointer;
  font-family: 'Atkinson Hyperlegible', sans-serif;
}
.tab-chip.on { background: var(--ink); color: white; border-color: var(--ink); }

.lesson-grid {
  display: grid; 
  grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); /* Responsif */
  gap: 10px; margin-top: 14px;
}
.lesson-card {
  background: white; border: 1px solid var(--card-line); border-radius: 16px;
  padding: 12px 8px; text-align: center; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  transition: transform .15s ease;
}
.lesson-card:hover { transform: translateY(-2px); }
.lesson-card .badge {
  width: 44px; height: 44px; border-radius: 14px;
  background: #F3EEFB; display: flex; align-items: center; justify-content: center;
  font-family: 'Baloo 2', sans-serif; font-weight: 800; font-size: 17px; color: var(--ink);
}
.lesson-card.done .badge { background: var(--mint); color: white; }
.lesson-card span { font-size: 11px; color: var(--ink-soft); font-weight: 600; }

.word-list { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.word-row {
  display: flex; align-items: center; gap: 12px; background: white;
  border: 1px solid var(--card-line); border-radius: 16px;
  padding: 11px 12px; cursor: pointer;
  transition: transform .15s ease;
}
.word-row:hover { transform: translateX(3px); }
.word-row .em   { font-size: 26px; }
.word-row .wt   { flex: 1; }
.word-row .wt b { font-family: 'Baloo 2', sans-serif; font-size: 14px; display: block; }
.word-row .wt span { font-size: 11.5px; color: var(--ink-soft); }
.word-row .arrow { color: var(--ink-soft); font-size: 13px; }

/* ---------- Lesson Detail ---------- */
.back-row { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.back-btn {
  width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--card-line);
  background: white; display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 14px;
}
.demo-panel {
  background: var(--navy); border-radius: var(--radius-lg); padding: 26px 20px;
  text-align: center; margin-top: 10px; position: relative; overflow: hidden;
}
.demo-panel svg { width: 110px; height: 110px; }
.demo-panel .loop-tag {
  position: absolute; top: 12px; right: 12px;
  background: rgba(255,255,255,.14); color: #fff;
  font-size: 10px; padding: 4px 8px; border-radius: 20px; font-weight: 700;
}
.steps { margin-top: 16px; display: flex; flex-direction: column; gap: 10px; }
.step-item {
  display: flex; gap: 12px; background: white; border: 1px solid var(--card-line);
  border-radius: 14px; padding: 12px 13px; align-items: flex-start;
}
.step-num {
  flex: 0 0 auto; width: 24px; height: 24px; border-radius: 50%;
  background: var(--gold); color: var(--navy);
  font-family: 'Baloo 2', sans-serif; font-weight: 800; font-size: 12px;
  display: flex; align-items: center; justify-content: center;
}
.step-item p { margin: 0; font-size: 13px; line-height: 1.5; }
.note-box {
  margin-top: 14px; background: #FFF3D6; border: 1px dashed var(--gold-deep);
  border-radius: 14px; padding: 12px 13px; font-size: 12px;
  color: #7A5A00; line-height: 1.5;
}
.cta-solid {
  margin-top: 16px; width: 100%; padding: 14px; border: none; border-radius: 16px;
  background: var(--gold); color: var(--navy);
  font-family: 'Baloo 2', sans-serif; font-weight: 800; font-size: 14.5px; cursor: pointer;
  transition: background .15s ease;
}
.cta-solid:hover { background: var(--gold-deep); }

/* ---------- Progress Screen ---------- */
.prog-ring-card {
  background: linear-gradient(135deg, var(--coral), #FF9166);
  border-radius: var(--radius-lg); padding: 20px; color: white; margin-top: 8px;
  display: flex; align-items: center; gap: 16px;
}
.ring {
  width: 74px; height: 74px; border-radius: 50%;
  background: conic-gradient(#fff 0% 0%, rgba(255,255,255,.28) 0% 100%);
  display: flex; align-items: center; justify-content: center; flex: 0 0 auto;
  transition: background 0.5s ease;
}
.ring div {
  width: 58px; height: 58px; border-radius: 50%; background: var(--coral);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Baloo 2', sans-serif; font-weight: 800; font-size: 15px;
}
.prog-ring-card h4 { font-family: 'Baloo 2', sans-serif; margin: 0 0 4px; font-size: 15px; }
.prog-ring-card p  { margin: 0; font-size: 12px; opacity: .95; }

.badge-grid { 
  display: grid; 
  grid-template-columns: repeat(auto-fit, minmax(70px, 1fr)); /* Responsif */
  gap: 10px; margin-top: 14px; 
}
.badge-item { display: flex; flex-direction: column; align-items: center; gap: 5px; }
.badge-item .b {
  width: 50px; height: 50px; border-radius: 16px;
  background: white; border: 1px solid var(--card-line);
  display: flex; align-items: center; justify-content: center; font-size: 20px;
}
.badge-item.lock .b { opacity: .35; }
.badge-item span { font-size: 9.5px; color: var(--ink-soft); text-align: center; }

.setting-row {
  display: flex; align-items: center; justify-content: space-between;
  background: white; border: 1px solid var(--card-line);
  border-radius: 14px; padding: 12px 14px; margin-top: 10px;
}
.setting-row .st { font-size: 13px; }
.setting-row .st small { display: block; color: var(--ink-soft); font-size: 11px; margin-top: 2px; }
.switch {
  width: 40px; height: 23px; border-radius: 20px;
  background: var(--card-line); position: relative; cursor: pointer; flex: 0 0 auto;
}
.switch.on { background: var(--teal); }
.switch::after {
  content: ""; position: absolute; top: 2.5px; left: 3px;
  width: 18px; height: 18px; border-radius: 50%;
  background: white; transition: left .15s ease;
}
.switch.on::after { left: 19px; }

/* ============================================================
   AUTH PAGES (login.php & register.php)
   ============================================================ */
.auth-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background: linear-gradient(145deg, var(--auth-bg-from) 0%, #FDF3E4 50%, var(--auth-bg-to) 100%);
}
.auth-card {
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(12px);
  border: 1px solid var(--card-line);
  border-radius: 32px;
  padding: 40px 36px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 24px 48px -16px rgba(27,27,58,.18);
}
.auth-logo {
  text-align: center;
  margin-bottom: 28px;
}
.auth-logo .em { font-size: 52px; display: block; margin-bottom: 8px; }
.auth-logo h1 {
  font-family: 'Baloo 2', sans-serif;
  font-size: 28px;
  color: var(--ink);
  margin: 0 0 4px;
}
.auth-logo p {
  font-size: 13px;
  color: var(--ink-soft);
  margin: 0;
}
.form-group { margin-bottom: 16px; }
.form-group label {
  display: block;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 6px;
  letter-spacing: .02em;
}
.form-control {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid var(--card-line);
  border-radius: 14px;
  font-family: 'Atkinson Hyperlegible', sans-serif;
  font-size: 14px;
  color: var(--ink);
  background: #FAFAFA;
  transition: border-color .2s ease, box-shadow .2s ease;
  outline: none;
}
.form-control:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(46,196,182,.18);
  background: #fff;
}
.form-control.error { border-color: var(--coral); }
.error-msg {
  font-size: 11.5px;
  color: var(--coral);
  margin-top: 5px;
  display: none;
}
.error-msg.show { display: block; }

.btn-primary {
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--teal) 0%, var(--teal-deep) 100%);
  color: white;
  font-family: 'Baloo 2', sans-serif;
  font-weight: 800;
  font-size: 15px;
  cursor: pointer;
  letter-spacing: .02em;
  transition: transform .15s ease, box-shadow .15s ease;
  margin-top: 8px;
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px -8px rgba(46,196,182,.5);
}
.btn-primary:active { transform: translateY(0); }

.auth-divider {
  text-align: center;
  margin: 20px 0;
  position: relative;
  font-size: 12px;
  color: var(--ink-soft);
}
.auth-divider::before, .auth-divider::after {
  content: "";
  position: absolute;
  top: 50%; width: 42%;
  height: 1px;
  background: var(--card-line);
}
.auth-divider::before { left: 0; }
.auth-divider::after  { right: 0; }

.auth-link-row {
  text-align: center;
  font-size: 13px;
  color: var(--ink-soft);
  margin-top: 20px;
}
.auth-link-row a { color: var(--teal-deep); font-weight: 700; }

.alert {
  padding: 12px 16px;
  border-radius: 14px;
  font-size: 13px;
  margin-bottom: 18px;
  line-height: 1.5;
}
.alert-error {
  background: #FFF0EE;
  border: 1px solid #FFD0CA;
  color: #C0392B;
}
.alert-success {
  background: #EDFBF4;
  border: 1px solid #A8EFC9;
  color: #1D7A45;
}

/* Avatar selector (register page) */
.avatar-group {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 6px;
}
.avatar-opt {
  width: 44px; height: 44px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; cursor: pointer;
  border: 2px solid var(--card-line);
  transition: border-color .15s ease, transform .15s ease;
  background: white;
}
.avatar-opt.selected {
  border-color: var(--teal);
  background: rgba(46,196,182,.1);
  transform: scale(1.1);
}