/* Free spoken level test (Views/LevelTest). Builds on home-ar.css tokens and buttons. */

.lt-page { background: var(--ar-soft); min-height: 100vh; }
.lt-header-wa { color: var(--ar-olive); font-weight: 700; text-decoration: none; }
.lt-header-wa:hover { color: var(--ar-red); }

.lt-hero { padding: 3rem 0 1.5rem; text-align: center; }
.lt-hero h1 { font-size: clamp(1.9rem, 4.5vw, 3rem); font-weight: 800; line-height: 1.35; margin: 0.9rem 0; }
.lt-hero h1 .ar-mark { color: var(--ar-red); }
.lt-hero p { color: var(--ar-muted); font-size: 1.15rem; max-width: 640px; margin: 0 auto; }
.lt-badges { display: flex; justify-content: center; flex-wrap: wrap; gap: 0.6rem; margin-top: 1.25rem; }
.lt-badge {
  background: #fff;
  border: 1px solid var(--ar-line);
  border-radius: 999px;
  padding: 0.35rem 0.9rem;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--ar-olive);
}
.lt-badge i { color: var(--ar-red); margin-inline-end: 0.35rem; }

/* Main card */
.lt-wrap { max-width: 760px; margin: 0 auto; padding: 0 16px 3rem; }
.lt-card {
  background: #fff;
  border: 1px solid var(--ar-line);
  border-radius: var(--ar-radius);
  box-shadow: 0 18px 40px rgba(46, 50, 27, 0.08);
  padding: 2rem;
}
.lt-card + .lt-card { margin-top: 1.25rem; }
.lt-card h2 { font-size: 1.5rem; font-weight: 800; margin: 0 0 0.5rem; }
.lt-card h3 { font-size: 1.15rem; font-weight: 800; margin: 0 0 0.6rem; }
.lt-muted { color: var(--ar-muted); }
.lt-step[hidden] { display: none !important; }

/* Stepper dots */
.lt-progress { display: flex; gap: 0.4rem; justify-content: center; margin-bottom: 1.5rem; }
.lt-progress span { width: 34px; height: 6px; border-radius: 6px; background: var(--ar-olive-soft); }
.lt-progress span.on { background: var(--ar-red); }

/* Question from Ahmad */
.lt-teacher { display: flex; align-items: center; gap: 1rem; margin: 1.25rem 0; }
.lt-avatar {
  width: 64px;
  height: 64px;
  flex: none;
  border-radius: 50%;
  background: var(--ar-olive);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 1.6rem;
  font-weight: 800;
  position: relative;
}
.lt-avatar.speaking::after {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 3px solid var(--ar-red);
  animation: lt-pulse 1.2s ease-out infinite;
}
.lt-bubble {
  background: var(--ar-olive-soft);
  border-radius: 18px;
  padding: 0.9rem 1.1rem;
  flex: 1;
}
.lt-bubble .en { font-family: "Poppins", sans-serif; font-weight: 600; direction: ltr; text-align: left; display: block; }

/* Recorder */
.lt-recorder { text-align: center; padding: 1rem 0 0.5rem; }
.lt-mic {
  width: 112px;
  height: 112px;
  border-radius: 50%;
  border: 0;
  background: var(--ar-red);
  color: #fff;
  font-size: 2.6rem;
  box-shadow: 0 8px 0 var(--ar-red-dark);
  transition: transform 0.15s ease;
  position: relative;
}
.lt-mic:hover { transform: translateY(-2px); }
.lt-mic:disabled { opacity: 0.5; }
.lt-mic.recording { background: var(--ar-olive); box-shadow: 0 8px 0 #15170c; }
.lt-mic.recording::after {
  content: "";
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  border: 4px solid var(--ar-red);
  animation: lt-pulse 1.2s ease-out infinite;
}
.lt-timer { font-family: "Poppins", sans-serif; font-size: 1.6rem; font-weight: 700; margin-top: 1rem; direction: ltr; }
.lt-hint { color: var(--ar-muted); margin-top: 0.4rem; }
.lt-meter { height: 8px; max-width: 280px; margin: 0.75rem auto 0; background: var(--ar-olive-soft); border-radius: 8px; overflow: hidden; }
.lt-meter > div { height: 100%; width: 0; background: var(--ar-red); transition: width 0.1s linear; }
.lt-playback { width: 100%; max-width: 420px; margin: 1rem auto 0; display: block; }
.lt-row { display: flex; flex-wrap: wrap; gap: 0.75rem; justify-content: center; margin-top: 1.25rem; }

@keyframes lt-pulse {
  from { transform: scale(0.95); opacity: 1; }
  to { transform: scale(1.25); opacity: 0; }
}

/* Form */
.lt-field { margin-bottom: 1rem; text-align: start; }
.lt-field label { font-weight: 700; display: block; margin-bottom: 0.35rem; }
.lt-field input, .lt-field select, .lt-textarea {
  width: 100%;
  border: 1.5px solid var(--ar-line);
  border-radius: 14px;
  padding: 0.8rem 1rem;
  font-size: 1.05rem;
  font-family: inherit;
}
.lt-field input:focus, .lt-field select:focus, .lt-textarea:focus { outline: none; border-color: var(--ar-olive); box-shadow: 0 0 0 3px var(--ar-olive-soft); }
.lt-field input[dir="ltr"] { text-align: left; }
.lt-field select { background: #fff; appearance: auto; }
.lt-field .lt-other { margin-top: 0.5rem; }
.lt-field-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 0 0.85rem; }
@media (max-width: 520px) { .lt-field-pair { grid-template-columns: 1fr; } }
.lt-small { font-size: 0.9rem; color: var(--ar-muted); }
.lt-error { color: var(--ar-red); font-weight: 600; margin-top: 0.75rem; min-height: 1.5em; }

/* Loading */
.lt-loading { text-align: center; padding: 1.5rem 0; }
.lt-spinner {
  width: 64px;
  height: 64px;
  margin: 0 auto 1.25rem;
  border-radius: 50%;
  border: 6px solid var(--ar-olive-soft);
  border-top-color: var(--ar-red);
  animation: lt-spin 0.9s linear infinite;
}
@keyframes lt-spin { to { transform: rotate(360deg); } }
.lt-loading ul { list-style: none; padding: 0; margin: 1rem auto 0; max-width: 320px; text-align: start; }
.lt-loading li { padding: 0.3rem 0; color: var(--ar-muted); }
.lt-loading li.done { color: var(--ar-olive); font-weight: 700; }
.lt-loading li i { width: 1.4rem; }

/* Result */
.lt-score { display: flex; align-items: center; gap: 1.5rem; flex-wrap: wrap; }
.lt-ring {
  --val: 0;
  width: 132px;
  height: 132px;
  flex: none;
  border-radius: 50%;
  background: conic-gradient(var(--ar-red) calc(var(--val) * 1%), var(--ar-olive-soft) 0);
  display: grid;
  place-items: center;
}
.lt-ring > div {
  width: 104px;
  height: 104px;
  border-radius: 50%;
  background: #fff;
  display: grid;
  place-items: center;
  text-align: center;
  line-height: 1.1;
}
.lt-ring strong { font-family: "Poppins", sans-serif; font-size: 2.1rem; display: block; }
.lt-ring small { color: var(--ar-muted); }
.lt-level {
  display: inline-block;
  background: var(--ar-olive);
  color: #fff;
  font-family: "Poppins", sans-serif;
  font-weight: 700;
  border-radius: 10px;
  padding: 0.15rem 0.7rem;
  margin-inline-start: 0.4rem;
}
.lt-subscores { display: flex; gap: 0.6rem; flex-wrap: wrap; margin-top: 0.75rem; }
.lt-subscores span { background: var(--ar-olive-soft); border-radius: 10px; padding: 0.3rem 0.7rem; font-weight: 600; font-size: 0.95rem; }

.lt-transcript {
  direction: ltr;
  text-align: left;
  font-family: "Poppins", sans-serif;
  background: var(--ar-soft);
  border-radius: 14px;
  padding: 0.9rem 1rem;
  line-height: 1.7;
}
.lt-list { list-style: none; padding: 0; margin: 0; }
.lt-list li { padding: 0.35rem 0; }
.lt-list li i { color: var(--ar-olive); margin-inline-end: 0.4rem; }

.lt-fix { border: 1px solid var(--ar-line); border-radius: 14px; padding: 0.8rem 1rem; margin-bottom: 0.6rem; }
.lt-fix .pair { direction: ltr; text-align: left; font-family: "Poppins", sans-serif; display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.lt-fix .wrong { color: var(--ar-red); text-decoration: line-through; }
.lt-fix .right { color: var(--ar-olive); font-weight: 700; }
.lt-fix .why { margin-top: 0.35rem; color: var(--ar-muted); }

.lt-words { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.lt-word {
  font-family: "Poppins", sans-serif;
  border: 1.5px solid var(--ar-line);
  background: #fff;
  border-radius: 999px;
  padding: 0.3rem 0.85rem;
  font-weight: 600;
  cursor: pointer;
}
.lt-word:hover { border-color: var(--ar-red); color: var(--ar-red); }
.lt-word small { color: var(--ar-muted); font-weight: 500; margin-inline-start: 0.3rem; }

.lt-listen {
  border: 0;
  background: var(--ar-olive-soft);
  color: var(--ar-olive);
  border-radius: 10px;
  padding: 0.35rem 0.8rem;
  font-weight: 700;
}
.lt-listen:hover { background: var(--ar-olive); color: #fff; }

.lt-video { position: relative; padding-top: 56.25%; border-radius: 16px; overflow: hidden; background: #000; }
.lt-video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.lt-cta { background: var(--ar-olive); color: #fff; border-color: var(--ar-olive); text-align: center; }
.lt-cta h2 { color: #fff; }
.lt-cta p { color: rgba(255, 255, 255, 0.85); }
.lt-google { display: inline-flex; align-items: center; gap: 0.6rem; }
.lt-google img { width: 22px; height: 22px; }

/* How it works */
.lt-how { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-top: 2rem; }
.lt-how div { background: #fff; border: 1px solid var(--ar-line); border-radius: 18px; padding: 1.1rem; text-align: center; }
.lt-how b { display: block; color: var(--ar-red); font-size: 1.6rem; font-family: "Poppins", sans-serif; }

/* Tour */
.lt-tour-steps { display: flex; gap: 0.5rem; overflow-x: auto; padding-bottom: 0.25rem; margin-bottom: 1.25rem; }
.lt-tour-steps button {
  flex: 1 0 auto;
  border: 1.5px solid var(--ar-line);
  background: #fff;
  border-radius: 12px;
  padding: 0.5rem 0.8rem;
  font-weight: 700;
  color: var(--ar-muted);
  white-space: nowrap;
}
.lt-tour-steps button.current { border-color: var(--ar-red); color: var(--ar-red); }
.lt-tour-steps button.done { background: var(--ar-olive); border-color: var(--ar-olive); color: #fff; }
.lt-tour-steps button:disabled { opacity: 0.55; }
.lt-model { direction: ltr; text-align: left; font-family: "Poppins", sans-serif; line-height: 2; background: var(--ar-soft); border-radius: 14px; padding: 1rem 1.2rem; }
.lt-model p { margin: 0; }
.lt-blank { display: inline-block; min-width: 90px; border-bottom: 2px dashed var(--ar-red); }
.lt-textarea { direction: ltr; text-align: left; font-family: "Poppins", sans-serif; min-height: 220px; line-height: 1.8; }
.lt-compare { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; text-align: center; }
.lt-compare > div { background: var(--ar-soft); border-radius: 16px; padding: 1rem; }
.lt-compare strong { font-family: "Poppins", sans-serif; font-size: 2.2rem; display: block; }
.lt-compare .after strong { color: var(--ar-red); }
.lt-gain { text-align: center; font-size: 1.2rem; font-weight: 800; color: var(--ar-olive); margin-top: 1rem; }

@media (max-width: 640px) {
  .lt-card { padding: 1.25rem; }
  .lt-how { grid-template-columns: 1fr; }
  .lt-score { justify-content: center; text-align: center; }
  .lt-subscores { justify-content: center; }
  .ar-logo img { height: 48px; }
}
