/* ============================================================
   Idiomasofía® — English Test For Schools
   styles.css · Brand: Sky Blue + Orange · Fredoka One + Nunito
   ============================================================ */

/* ── Variables ─────────────────────────────────────────────── */
:root {
  --blue:         #1AACCF;
  --blue-dark:    #0E8CAD;
  --blue-light:   #E6F7FB;
  --blue-mid:     #B3E8F5;
  --orange:       #FF7A2F;
  --orange-light: #FFF0E8;
  --white:        #FFFFFF;
  --gray-100:     #F4F6F8;
  --gray-300:     #D1D9E0;
  --gray-500:     #8A97A4;
  --gray-700:     #3D4F5C;
  --dark:         #1C2B35;
  --green:        #4CAF50;
  --green-light:  #E8F8EE;
  --red:          #EF5350;
  --red-light:    #FFF0F0;
  --whatsapp:     #25D366;

  --font-display: 'Fredoka One', cursive;
  --font-body:    'Nunito', sans-serif;

  --radius-sm:  8px;
  --radius-md:  14px;
  --radius-lg:  20px;
  --radius-xl:  28px;

  --shadow-card: 0 16px 48px rgba(26,172,207,.14), 0 2px 12px rgba(0,0,0,.05);
  --shadow-btn:  0 8px 24px rgba(26,172,207,.40);
  --shadow-orange: 0 8px 24px rgba(255,122,47,.38);

  --transition: all .2s ease;
}

/* ── Reset ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font-body);
  background: linear-gradient(145deg, var(--blue-light) 0%, #fff 50%, var(--orange-light) 100%);
  min-height: 100vh;
  color: var(--dark);
  -webkit-font-smoothing: antialiased;
}

/* ── App shell ─────────────────────────────────────────────── */
#app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px 16px;
  position: relative;
  overflow: hidden;
}

/* Decorative circles */
#app::before {
  content: '';
  position: fixed;
  top: -80px; right: -80px;
  width: 280px; height: 280px;
  border-radius: 50%;
  background: rgba(26,172,207,.10);
  pointer-events: none;
  z-index: 0;
}
#app::after {
  content: '';
  position: fixed;
  bottom: -60px; left: -60px;
  width: 220px; height: 220px;
  border-radius: 50%;
  background: rgba(255,122,47,.08);
  pointer-events: none;
  z-index: 0;
}

/* ── Card ──────────────────────────────────────────────────── */
.card {
  background: var(--white);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card);
  padding: 36px 32px;
  width: 100%;
  max-width: 520px;
  position: relative;
  z-index: 1;
}
@media (max-width: 540px) {
  .card { padding: 28px 20px; border-radius: var(--radius-lg); }
}

/* ── Badge ─────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--blue-light);
  color: var(--blue-dark);
  border-radius: 50px;
  padding: 5px 14px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .03em;
  margin-bottom: 18px;
}
.badge.orange {
  background: var(--orange-light);
  color: var(--orange);
}

/* ── Logo ──────────────────────────────────────────────────── */
.logo {
  font-family: var(--font-display);
  font-size: 26px;
  color: var(--blue);
  margin-bottom: 2px;
  line-height: 1;
}
.logo-sm {
  font-family: var(--font-display);
  font-size: 17px;
  color: var(--blue);
}

/* ── Typography ────────────────────────────────────────────── */
h1.display {
  font-family: var(--font-display);
  font-size: 36px;
  color: var(--dark);
  line-height: 1.15;
  margin-bottom: 8px;
}
h2.section-title {
  font-family: var(--font-display);
  font-size: 20px;
  color: var(--dark);
  margin-bottom: 14px;
}
.subtitle {
  font-size: 15px;
  color: var(--gray-500);
  line-height: 1.55;
  margin-bottom: 24px;
}
.caption {
  font-size: 12px;
  color: var(--gray-500);
  font-weight: 600;
  letter-spacing: .02em;
}

/* ── Info Grid ─────────────────────────────────────────────── */
.info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 28px;
}
.info-item {
  background: var(--gray-100);
  border-radius: var(--radius-md);
  padding: 14px 10px;
  text-align: center;
}
.info-item .icon   { font-size: 20px; margin-bottom: 4px; }
.info-item .label  { font-size: 11px; color: var(--gray-500); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.info-item .value  { font-size: 15px; color: var(--dark); font-weight: 800; margin-top: 2px; }

/* ── Buttons ───────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: var(--radius-md);
  padding: 14px 24px;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  transition: var(--transition);
  width: 100%;
  text-decoration: none;
}
.btn:active { transform: scale(.98); }

.btn-primary {
  background: linear-gradient(135deg, var(--blue), var(--blue-dark));
  color: var(--white);
  box-shadow: var(--shadow-btn);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(26,172,207,.50); }

.btn-orange {
  background: linear-gradient(135deg, var(--orange), #e56020);
  color: var(--white);
  box-shadow: var(--shadow-orange);
}
.btn-orange:hover { transform: translateY(-2px); }

.btn-whatsapp {
  background: var(--whatsapp);
  color: var(--white);
  box-shadow: 0 8px 24px rgba(37,211,102,.40);
  border-radius: var(--radius-md);
}
.btn-whatsapp:hover { background: #1ebe5d; transform: translateY(-2px); }

.btn-disabled {
  background: var(--gray-300);
  color: var(--white);
  cursor: not-allowed;
  box-shadow: none;
}
.btn-disabled:hover { transform: none; }

/* ── Form ──────────────────────────────────────────────────── */
.form-group {
  margin-bottom: 16px;
}
.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--gray-700);
  margin-bottom: 6px;
}
.form-group .required {
  color: var(--orange);
  margin-left: 2px;
}
.form-control {
  width: 100%;
  padding: 12px 14px;
  border: 2px solid var(--gray-300);
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--dark);
  background: var(--white);
  transition: var(--transition);
  outline: none;
  -webkit-appearance: none;
}
.form-control:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(26,172,207,.15);
}
.form-control.error {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(239,83,80,.12);
}
.form-control::placeholder { color: var(--gray-300); }
.error-msg {
  font-size: 12px;
  color: var(--red);
  margin-top: 4px;
  font-weight: 600;
  display: none;
}
.error-msg.visible { display: block; }

/* ── Progress ──────────────────────────────────────────────── */
.progress-wrap {
  margin-bottom: 18px;
}
.progress-bar {
  height: 6px;
  background: var(--gray-300);
  border-radius: 6px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--blue), var(--orange));
  transition: width .4s ease;
}
.progress-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.q-counter {
  font-size: 13px;
  font-weight: 700;
  color: var(--gray-500);
  background: var(--white);
  padding: 3px 12px;
  border-radius: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,.07);
}

/* ── Top bar ───────────────────────────────────────────────── */
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  width: 100%;
  max-width: 520px;
  position: relative;
  z-index: 1;
}

/* ── Question card ─────────────────────────────────────────── */
.question-type-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 30px;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 14px;
}
.question-type-badge.conversation { background: var(--blue-light); color: var(--blue-dark); }
.question-type-badge.grammar      { background: var(--orange-light); color: var(--orange); }

.q-number {
  font-size: 12px;
  font-weight: 700;
  color: var(--gray-500);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.q-prompt {
  font-family: var(--font-display);
  font-size: 21px;
  color: var(--dark);
  line-height: 1.3;
  margin-bottom: 6px;
}
.q-instruction {
  font-size: 13px;
  color: var(--gray-500);
  font-style: italic;
  margin-bottom: 20px;
}

/* ── Options ───────────────────────────────────────────────── */
.option-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 13px 14px;
  border: 2px solid var(--gray-300);
  border-radius: var(--radius-md);
  background: var(--white);
  color: var(--gray-700);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  margin-bottom: 9px;
  transition: var(--transition);
  position: relative;
}
.option-btn:hover:not(.confirmed) {
  background: var(--blue-light);
  border-color: var(--blue-mid);
}
.option-btn.selected {
  background: var(--blue-light);
  border-color: var(--blue);
  color: var(--blue-dark);
  box-shadow: 0 4px 14px rgba(26,172,207,.18);
}
.option-btn.correct {
  background: var(--green-light);
  border-color: var(--green);
  color: #2E7D32;
  box-shadow: 0 4px 12px rgba(76,175,80,.20);
}
.option-btn.wrong {
  background: var(--red-light);
  border-color: var(--red);
  color: #C62828;
}
.option-btn.confirmed { cursor: default; }

.letter-badge {
  min-width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--gray-300);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
  flex-shrink: 0;
  transition: background .2s;
}
.option-btn.selected .letter-badge  { background: var(--blue); }
.option-btn.correct  .letter-badge  { background: var(--green); }
.option-btn.wrong    .letter-badge  { background: var(--red); }

.option-text { flex: 1; line-height: 1.35; }
.check-icon  { font-size: 15px; margin-left: auto; }

/* ── Action row ────────────────────────────────────────────── */
.action-row { margin-top: 10px; }

/* ── Results ───────────────────────────────────────────────── */
.score-circle {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
}
.score-num {
  font-family: var(--font-display);
  font-size: 44px;
  color: var(--white);
  line-height: 1;
}
.score-of { font-size: 13px; color: rgba(255,255,255,.8); font-weight: 700; }

.level-badge {
  display: inline-block;
  color: var(--white);
  border-radius: 50px;
  padding: 8px 26px;
  font-family: var(--font-display);
  font-size: 20px;
  margin-bottom: 6px;
}
.level-name  { font-size: 15px; color: var(--gray-500); font-weight: 700; margin-bottom: 10px; }
.level-desc  { font-size: 15px; color: var(--gray-700); line-height: 1.6; margin-bottom: 26px; text-align: center; }

.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  margin-bottom: 24px;
}
.stat-item {
  background: var(--gray-100);
  border-radius: var(--radius-md);
  padding: 12px 8px;
  text-align: center;
}
.stat-val   { font-family: var(--font-display); font-size: 24px; color: var(--dark); }
.stat-label { font-size: 11px; color: var(--gray-500); font-weight: 700; margin-top: 2px; }

.recommendations-box {
  background: var(--gray-100);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 14px;
  text-align: left;
}
.recommendations-box h3 {
  font-size: 14px;
  font-weight: 800;
  color: var(--dark);
  margin-bottom: 10px;
}
.rec-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.rec-list li {
  font-size: 13px;
  color: var(--gray-700);
  display: flex;
  align-items: flex-start;
  gap: 7px;
  line-height: 1.45;
}
.rec-list li::before {
  content: '→';
  color: var(--blue);
  font-weight: 800;
  flex-shrink: 0;
  margin-top: 1px;
}

.cambridge-box {
  background: var(--blue-light);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.cambridge-box .icon { font-size: 22px; flex-shrink: 0; }
.cambridge-box .text { font-size: 13px; color: var(--blue-dark); font-weight: 700; line-height: 1.4; }
.cambridge-box .text span { display: block; font-weight: 400; color: var(--gray-700); font-size: 12px; margin-top: 2px; }

.cta-box {
  background: var(--blue-light);
  border-radius: var(--radius-lg);
  padding: 22px 20px;
  text-align: center;
  margin-bottom: 16px;
}
.cta-box p { font-size: 14px; color: var(--gray-700); margin-bottom: 14px; line-height: 1.5; }
.cta-box strong { color: var(--dark); }

/* ── Sending state ─────────────────────────────────────────── */
.sending-overlay {
  text-align: center;
  padding: 20px 0;
}
.spinner {
  width: 40px; height: 40px;
  border: 4px solid var(--blue-light);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  margin: 0 auto 14px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Animations ────────────────────────────────────────────── */
@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeOut {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(-10px); }
}

.animate-in  { animation: fadeSlideUp .30s ease both; }
.animate-out { animation: fadeOut .25s ease both; }

/* ── Divider ───────────────────────────────────────────────── */
.divider {
  height: 1px;
  background: var(--gray-300);
  margin: 20px 0;
}

/* ── Footer ────────────────────────────────────────────────── */
.footer-note {
  font-size: 11px;
  color: var(--gray-500);
  text-align: center;
  margin-top: 20px;
  position: relative;
  z-index: 1;
}

/* ── Scrollbar ─────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--gray-100); }
::-webkit-scrollbar-thumb { background: var(--blue-mid); border-radius: 3px; }
