/* speak.css — voice reader + sign-in panel for spellinglist.sg */

/* ================= voice reader ================= */

.sp-bar {
  position: sticky; top: 52px; z-index: 12;
  background: #16233d; color: #fff;
  border-radius: 14px;
  padding: 12px 14px;
  margin: 0 0 16px;
  font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, sans-serif;
  box-shadow: 0 3px 14px rgba(22, 35, 61, .2);
}

.sp-bar-main { display: flex; align-items: center; gap: 12px; }

.sp-play {
  flex: 1; font: inherit; font-size: 1rem; font-weight: 700;
  background: #fbbf24; color: #16233d;
  border: none; border-radius: 10px; padding: 13px 16px;
  cursor: pointer;
}
.sp-play:active { transform: translateY(1px); }

.sp-count {
  font-size: .8rem; font-weight: 600; color: #a8b6cf;
  font-variant-numeric: tabular-nums; white-space: nowrap;
}

.sp-controls {
  display: flex; align-items: center; gap: 8px;
  flex-wrap: wrap; margin-top: 10px;
}
.sp-controls[hidden] { display: none; }

.sp-mini {
  font: inherit; font-size: .82rem; font-weight: 700;
  background: rgba(255,255,255,.12); color: #fff;
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 8px; padding: 9px 13px; cursor: pointer;
}
.sp-mini:hover { background: rgba(255,255,255,.2); }

.sp-gap {
  margin-left: auto; font-size: .74rem; color: #a8b6cf;
  display: flex; align-items: center; gap: 6px; font-weight: 600;
}
.sp-gap select {
  font: inherit; font-size: .78rem; font-weight: 700;
  background: rgba(255,255,255,.12); color: #fff;
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 7px; padding: 6px 8px;
}
.sp-gap select option { color: #16233d; }

.sp-unsupported {
  background: #fff7ed; color: #9a3412;
  font-size: .82rem; line-height: 1.5; font-weight: 600;
  padding: 12px 14px; border-radius: 11px;
  border: 1px solid #fed7aa; margin: 0 0 14px;
}

/* per-word speaker button */
.sp-say {
  border: none; background: transparent; cursor: pointer;
  color: #1d4ed8; padding: 7px; border-radius: 9px;
  vertical-align: middle; line-height: 0;
  flex: none;
}
.sp-say:hover { background: #eef2ff; }
.sp-say.is-on { background: #1d4ed8; color: #fff; }
.sp-say:focus-visible { outline: 3px solid rgba(29,78,216,.3); }

/* the word currently being read */
[data-speaking] {
  background: #fef3c7;
  border-radius: 9px;
  box-shadow: 0 0 0 3px #fef3c7;
}
[data-speaking="waiting"] {
  background: #dbeafe;
  box-shadow: 0 0 0 3px #dbeafe;
}
[data-speaking="reading"] { animation: sp-pulse 1s ease-in-out infinite; }

@keyframes sp-pulse {
  0%, 100% { box-shadow: 0 0 0 3px #fef3c7; }
  50%      { box-shadow: 0 0 0 7px #fef3c7; }
}

@media (prefers-reduced-motion: reduce) {
  [data-speaking="reading"] { animation: none; }
}

/* ================= sign-in panel ================= */

.sl-auth {
  position: fixed; inset: 0; z-index: 900;
  background: rgba(11, 17, 29, .55);
  display: flex; align-items: flex-end; justify-content: center;
  padding: 0;
  font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, sans-serif;
}
.sl-auth[hidden] { display: none; }

.sl-auth-box {
  position: relative;
  background: #fff; width: 100%; max-width: 420px;
  border-radius: 18px 18px 0 0;
  padding: 26px 22px calc(26px + env(safe-area-inset-bottom));
  animation: sl-rise .22s ease-out;
}
@keyframes sl-rise { from { transform: translateY(18px); opacity: 0; } to { transform: none; opacity: 1; } }

.sl-auth-box h3 { margin: 0 0 5px; font-size: 1.2rem; color: #16233d; }
.sl-auth-box p  { margin: 0 0 16px; font-size: .86rem; color: #5b6b86; }

.sl-auth-box input {
  width: 100%; box-sizing: border-box; font: inherit; font-size: 1rem;
  padding: 14px; border: 1.5px solid #cfd8e6; border-radius: 11px;
  background: #fbfaf6; color: #16233d; margin-bottom: 10px;
}
.sl-auth-box input:focus { outline: 3px solid rgba(29,78,216,.28); border-color: #1d4ed8; }

.sl-auth-go {
  width: 100%; font: inherit; font-size: 1rem; font-weight: 700;
  background: #1d4ed8; color: #fff; border: none;
  border-radius: 11px; padding: 15px; cursor: pointer;
}
.sl-auth-go:disabled { background: #cbd5e1; cursor: default; }

.sl-auth-msg { margin: 12px 0 0; font-size: .84rem; font-weight: 600; }
.sl-auth-msg[data-tone="ok"]    { color: #15803d; }
.sl-auth-msg[data-tone="error"] { color: #b91c1c; }

.sl-auth-x {
  position: absolute; top: 12px; right: 14px;
  border: none; background: transparent; cursor: pointer;
  font-size: 1.6rem; line-height: 1; color: #94a3b8; padding: 4px 8px;
}

@media (min-width: 620px) {
  .sl-auth { align-items: center; padding: 20px; }
  .sl-auth-box { border-radius: 18px; }
}

/* ---- OTP code step ---- */
.sl-code{
  text-align:center; font-size:2rem !important; font-weight:800;
  letter-spacing:.5em; text-indent:.5em; font-variant-numeric:tabular-nums;
}
.sl-auth-back{
  display:block; width:100%; margin-top:10px; padding:11px;
  font:inherit; font-size:.84rem; font-weight:700;
  background:transparent; border:none; color:#5b6b86; cursor:pointer;
  text-decoration:underline;
}
.sl-auth-box p b{color:#16233d}
