/* ============================================================
   IELTS Assessment — IMB Digital
   style.css
============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

#ielts-wrap * {
  box-sizing: border-box;
}

#ielts-wrap {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  max-width: 860px;
  margin: 2rem auto;
  color: #1a1a2e;
}

/* ---- STEP VISIBILITY ---- */
.ielts-step { display: none; }
.ielts-step.active { display: block; animation: fadeSlide 0.5s ease both; }

@keyframes fadeSlide {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---- HEADER ---- */
.ielts-header {
  text-align: center;
  padding: 3rem 2rem 2rem;
  background: linear-gradient(135deg, #0f2c6b 0%, #1a4db8 60%, #0d9488 100%);
  border-radius: 20px;
  color: white;
  margin-bottom: 2rem;
}

.ielts-badge {
  display: inline-block;
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.3);
  color: white;
  padding: 0.4rem 1.2rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  margin-bottom: 1rem;
}

.ielts-header h2 {
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 800;
  margin: 0.5rem 0;
  color: white;
}

.ielts-header p {
  font-size: 0.97rem;
  opacity: 0.85;
  max-width: 540px;
  margin: 0 auto 1.5rem;
  line-height: 1.7;
  color: white;
}

.ielts-pills {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6rem;
}

.ielts-pills span {
  background: rgba(255,255,255,0.15);
  border-radius: 999px;
  padding: 0.35rem 1rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: white;
}

/* ---- PROGRESS BAR ---- */
.ielts-progress-bar {
  height: 6px;
  background: #e2e8f0;
  border-radius: 999px;
  margin-bottom: 2rem;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #1a4db8, #0d9488);
  border-radius: 999px;
  transition: width 0.6s ease;
}

/* ---- SECTION HEADER ---- */
.section-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.2rem 1.5rem;
  border-radius: 12px;
  margin-bottom: 1.5rem;
  color: white;
}

.section-header.listening { background: linear-gradient(135deg, #1e40af, #3b82f6); }
.section-header.reading   { background: linear-gradient(135deg, #065f46, #059669); }
.section-header.writing   { background: linear-gradient(135deg, #7c2d12, #ea580c); }

.section-icon { font-size: 2rem; flex-shrink: 0; }

.section-header h3 { font-size: 1.1rem; font-weight: 700; margin: 0 0 0.2rem; color: white; }
.section-header p  { font-size: 0.83rem; opacity: 0.85; margin: 0; color: white; }

.section-meta {
  margin-left: auto;
  font-size: 0.78rem;
  font-weight: 600;
  background: rgba(255,255,255,0.2);
  padding: 0.3rem 0.8rem;
  border-radius: 999px;
  white-space: nowrap;
  flex-shrink: 0;
  color: white;
}

/* ---- AUDIO SIMULATE ---- */
.audio-simulate {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  border-radius: 10px;
  padding: 1rem 1.5rem;
  margin-bottom: 1.2rem;
  font-size: 0.9rem;
  color: #0369a1;
}

.audio-icon { font-size: 1.8rem; }

/* ---- TRANSCRIPT / PASSAGE ---- */
.transcript, .passage {
  background: #fafaf9;
  border-left: 4px solid #1a4db8;
  border-radius: 0 10px 10px 0;
  padding: 1.5rem;
  margin-bottom: 1.8rem;
  font-size: 0.92rem;
  line-height: 1.8;
  color: #374151;
}

.transcript p, .passage p { margin: 0 0 0.8rem; }
.transcript p:last-child, .passage p:last-child { margin-bottom: 0; }
.passage h4 { font-size: 1.05rem; font-weight: 700; margin: 0 0 0.8rem; color: #1a1a2e; }

/* ---- REGISTRATION FORM ---- */
.ielts-form { background: #fff; border: 1px solid #e5e7eb; border-radius: 16px; padding: 2rem; }

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.2rem;
  margin-bottom: 1.2rem;
}

.form-group { display: flex; flex-direction: column; gap: 0.4rem; }

.form-group label {
  font-size: 0.82rem;
  font-weight: 600;
  color: #374151;
  letter-spacing: 0.02em;
}

.req { color: #ef4444; }

.form-group input,
.form-group select {
  padding: 0.75rem 1rem;
  border: 1.5px solid #d1d5db;
  border-radius: 8px;
  font-size: 0.93rem;
  font-family: inherit;
  color: #1f2937;
  transition: border-color 0.2s, box-shadow 0.2s;
  background: #fff;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: #1a4db8;
  box-shadow: 0 0 0 3px rgba(26,77,184,0.1);
}

.form-consent { margin-bottom: 1.5rem; }

.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  font-size: 0.85rem;
  color: #6b7280;
  cursor: pointer;
  font-weight: 400 !important;
}

.checkbox-label input { margin-top: 2px; accent-color: #1a4db8; flex-shrink: 0; }
.checkbox-label a { color: #1a4db8; }

/* ---- BUTTONS ---- */
.ielts-btn {
  display: block;
  width: 100%;
  background: linear-gradient(135deg, #1a4db8, #0d9488);
  color: white;
  border: none;
  padding: 1rem 2rem;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.2s;
  text-decoration: none;
  text-align: center;
  margin-top: 1.5rem;
}

.ielts-btn:hover { opacity: 0.92; transform: translateY(-1px); }

.ielts-btn-outline {
  background: transparent;
  color: #1a4db8;
  border: 2px solid #1a4db8;
  padding: 0.7rem 1.5rem;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  margin: 0.5rem;
  transition: all 0.2s;
}

.ielts-btn-outline:hover { background: #1a4db8; color: white; }

/* ---- QUESTIONS ---- */
.questions { display: flex; flex-direction: column; gap: 1.2rem; margin-bottom: 1.5rem; }

.question-card {
  background: #fff;
  border: 1.5px solid #e5e7eb;
  border-radius: 12px;
  padding: 1.3rem 1.5rem;
  transition: border-color 0.2s;
}

.question-card:hover { border-color: #93c5fd; }
.question-card.answered { border-color: #86efac; background: #f0fdf4; }
.question-card.wrong    { border-color: #fca5a5; background: #fef2f2; }

.question-num {
  font-size: 0.72rem;
  font-weight: 700;
  color: #6b7280;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.question-text {
  font-size: 0.95rem;
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 1rem;
  line-height: 1.5;
}

.options { display: flex; flex-direction: column; gap: 0.5rem; }

.option-label {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 1rem;
  border: 1.5px solid #e5e7eb;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.9rem;
  color: #374151;
  transition: all 0.15s;
  background: #fafafa;
}

.option-label:hover { border-color: #1a4db8; background: #eff6ff; }
.option-label.selected { border-color: #1a4db8; background: #dbeafe; color: #1e40af; font-weight: 600; }

.option-label input[type="radio"] { accent-color: #1a4db8; flex-shrink: 0; }

/* Fill-in input */
.fill-input {
  width: 100%;
  padding: 0.65rem 1rem;
  border: 1.5px solid #d1d5db;
  border-radius: 8px;
  font-size: 0.93rem;
  font-family: inherit;
  color: #1f2937;
  transition: border-color 0.2s;
}

.fill-input:focus { outline: none; border-color: #1a4db8; }

/* ---- RESULTS ---- */
.results-header {
  text-align: center;
  padding: 2rem 1rem 1rem;
}

.trophy { font-size: 4rem; margin-bottom: 0.5rem; }

.results-header h2 {
  font-size: clamp(1.5rem, 3.5vw, 2rem);
  font-weight: 800;
  color: #1a1a2e;
  margin: 0 0 0.5rem;
}

.results-header p { color: #6b7280; font-size: 0.95rem; }

.band-display {
  display: flex;
  align-items: center;
  gap: 2rem;
  background: linear-gradient(135deg, #0f2c6b, #1a4db8);
  color: white;
  border-radius: 20px;
  padding: 2rem 2.5rem;
  margin: 2rem 0;
}

.band-circle {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  border: 5px solid rgba(255,255,255,0.3);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: rgba(255,255,255,0.1);
}

.band-num {
  font-size: 3rem;
  font-weight: 800;
  line-height: 1;
  color: #fcd34d;
}

.band-label { font-size: 0.7rem; opacity: 0.7; text-transform: uppercase; letter-spacing: 0.1em; }

.level-badge {
  display: inline-block;
  background: #fcd34d;
  color: #1a1a2e;
  padding: 0.35rem 1.2rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 800;
  margin-bottom: 0.8rem;
}

.level-desc { font-size: 0.92rem; opacity: 0.85; line-height: 1.6; color: white; }

/* ---- SKILL BARS ---- */
.score-breakdown {
  background: #fff;
  border: 1.5px solid #e5e7eb;
  border-radius: 16px;
  padding: 1.8rem;
  margin-bottom: 1.5rem;
}

.score-breakdown h3 { font-size: 1rem; font-weight: 700; margin: 0 0 1.5rem; color: #1f2937; }

.skill-bar-item { margin-bottom: 1.2rem; }

.skill-bar-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.4rem;
  font-size: 0.88rem;
}

.skill-bar-name { font-weight: 600; color: #374151; }
.skill-bar-score { font-weight: 700; color: #1a4db8; }

.skill-bar-track {
  height: 10px;
  background: #f1f5f9;
  border-radius: 999px;
  overflow: hidden;
}

.skill-bar-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 1s ease;
}

/* ---- RECOMMENDATION ---- */
.recommendation-box {
  background: #fff;
  border: 1.5px solid #e5e7eb;
  border-radius: 16px;
  padding: 1.8rem;
  margin-bottom: 1.5rem;
}

.recommendation-box h3 { font-size: 1.05rem; font-weight: 700; margin: 0 0 1rem; }

.rec-item {
  display: flex;
  gap: 0.8rem;
  align-items: flex-start;
  margin-bottom: 0.8rem;
  padding: 0.9rem 1rem;
  background: #f8fafc;
  border-radius: 10px;
  border-left: 4px solid #1a4db8;
  font-size: 0.88rem;
  color: #374151;
  line-height: 1.6;
}

.rec-icon { font-size: 1.2rem; flex-shrink: 0; }

.cta-block {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1.5px solid #e5e7eb;
  text-align: center;
}

.cta-block p { color: #6b7280; font-size: 0.9rem; margin-bottom: 1rem; }
.cta-note { font-size: 0.78rem !important; color: #9ca3af !important; margin-top: 0.8rem !important; }

/* ---- CERTIFICATE ---- */
.cert-preview {
  border: 2px dashed #d1d5db;
  border-radius: 16px;
  padding: 0.5rem;
  margin: 1.5rem 0;
}

.cert-inner {
  border: 3px solid #1a4db8;
  border-radius: 12px;
  padding: 2.5rem;
  text-align: center;
  background: linear-gradient(135deg, #fefefe, #f0f7ff);
}

.cert-logo { font-size: 0.78rem; font-weight: 700; color: #1a4db8; letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: 1rem; }
.cert-title { font-size: 1.4rem; font-weight: 800; color: #1a1a2e; margin: 0 0 1rem; }
.cert-name { font-size: 1.7rem; font-weight: 700; color: #1a4db8; margin: 0 0 0.5rem; }
.cert-band { font-size: 1.2rem; font-weight: 600; color: #374151; margin: 0 0 0.3rem; }
.cert-level { font-size: 1rem; color: #059669; font-weight: 700; margin: 0 0 1rem; }
.cert-date { font-size: 0.8rem; color: #9ca3af; }

/* ---- PRINT ---- */
@media print {
  .ielts-btn, .ielts-btn-outline, .section-header, .transcript,
  .passage, .questions, .audio-simulate { display: none !important; }
  .cert-preview { border: 3px solid #1a4db8 !important; }
  #step-results { display: block !important; }
}

/* ---- RESPONSIVE ---- */
@media (max-width: 640px) {
  .form-row { grid-template-columns: 1fr; }
  .band-display { flex-direction: column; text-align: center; padding: 1.5rem; }
  .section-meta { display: none; }
  #ielts-wrap { margin: 1rem; }
}

/* ---- LOADING ---- */
.ielts-loading {
  text-align: center;
  padding: 3rem;
  color: #6b7280;
}

.ielts-spinner {
  width: 40px; height: 40px;
  border: 4px solid #e5e7eb;
  border-top-color: #1a4db8;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 1rem;
}

@keyframes spin { to { transform: rotate(360deg); } }
