/* =====================================================================
   IQ Test — glossy Frutiger Aero cards, progress bar, spinner, risultato
   ===================================================================== */
.app.iq {
  padding: 14px 16px 0; gap: 10px; position: relative;
  background:
    radial-gradient(ellipse 80% 40% at 50% 0%, rgba(255,255,255,0.7), rgba(255,255,255,0) 70%),
    linear-gradient(180deg, rgba(225,244,255,0.6), rgba(190,225,255,0.45));
}

/* ---------- toolbar: progress + timer ---------- */
.app.iq .iq-toolbar { flex: none; display: flex; align-items: center; gap: 12px; }
.app.iq .iq-progress-wrap { flex: 1; min-width: 0; }
.app.iq .iq-progress-label { font: 700 0.82rem var(--font); color: #0b3a80; margin-bottom: 4px; }
.app.iq .iq-progress { height: 14px; border-radius: 999px; overflow: hidden; position: relative; padding: 0; }
.app.iq .iq-progress-bar {
  height: 100%; border-radius: 999px;
  background: linear-gradient(180deg, #e2ffb0 0%, #a4f04a 45%, #7ddc2b 52%, #3f9a12 100%);
  box-shadow: 0 0 10px rgba(125,220,43,0.6);
  transition: width 0.4s cubic-bezier(.2,1,.3,1);
}
.app.iq .iq-timer {
  flex: none; width: 52px; height: 40px; border-radius: 12px; display: flex; align-items: baseline; justify-content: center; gap: 2px;
  font: 700 0.85rem var(--font); color: #0b3a80;
}
.app.iq .iq-timer-num { font: 700 1.15rem var(--font-display); }
.app.iq .iq-timer.warn { color: #c2321c; animation: iq-pulse 0.6s ease infinite; }
.app.iq .iq-timer.warn .iq-timer-num { color: #c2321c; }
@keyframes iq-pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.55; } }

/* ---------- glass panel base (local override of size) ---------- */
.app.iq .iq-content { flex: 1; min-height: 0; overflow: auto; display: flex; }
.app.iq .iq-card { flex: 1; display: flex; flex-direction: column; gap: 18px; justify-content: center; padding: 22px; }
.app.iq .iq-q { font: 700 1.25rem/1.35 var(--font-display); color: #0b3a80; text-align: center; text-shadow: 0 1px 0 rgba(255,255,255,0.8); }
.app.iq .iq-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.app.iq .iq-opt {
  border: 0; cursor: pointer; padding: 16px 12px; text-align: center;
  font: 600 1rem var(--font); color: #0b3a80;
}
.app.iq .iq-opt span { position: relative; z-index: 1; }
.app.iq .iq-opt:active { transform: translateY(1px) scale(0.98); }

.app.iq .app-status { flex: none; display: flex; align-items: center; justify-content: space-between; margin: 0 -16px; }
.app.iq .iq-skip { flex: none; }

/* ---------- spinner ---------- */
.app.iq .iq-spinner-wrap { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; }
.app.iq .iq-spinner {
  width: 64px; height: 64px; border-radius: 50%;
  border: 6px solid rgba(58,168,255,0.25); border-top-color: #0b5fd6; border-right-color: #3aa8ff;
  box-shadow: 0 0 16px rgba(120,210,255,0.6);
  animation: iq-spin 0.9s linear infinite;
}
@keyframes iq-spin { to { transform: rotate(360deg); } }
.app.iq .iq-spinner-msg { font: 700 1.05rem var(--font); color: #0b3a80; min-height: 1.4em; text-align: center; }
.app.iq .iq-spinner-msg.flip { animation: iq-flip 0.3s ease both; }
@keyframes iq-flip { from { opacity: 0.2; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- result ---------- */
.app.iq .iq-result-wrap { flex-direction: column; gap: 12px; padding-bottom: 12px; }
.app.iq .iq-result {
  flex: none; text-align: center; padding: 20px 22px;
  opacity: 0; transform: translateY(14px) scale(0.97);
  transition: opacity 0.4s ease, transform 0.4s cubic-bezier(.2,1.3,.3,1);
}
.app.iq .iq-result.show { opacity: 1; transform: none; }
.app.iq .iq-result-score {
  font: 700 3.6rem/1 var(--font-display); color: #0b5fd6;
  text-shadow: 0 2px 6px rgba(0,60,160,0.3), 0 1px 0 rgba(255,255,255,0.8);
}
.app.iq .iq-result.low .iq-result-score { color: #c2321c; }
.app.iq .iq-result.high .iq-result-score { color: #1c7a10; }
.app.iq .iq-result-label { font: 700 1.15rem var(--font-display); color: #0b3a80; margin-top: 4px; }
.app.iq .iq-result-comment { font: 500 0.92rem var(--font); opacity: 0.8; margin-top: 6px; font-style: italic; }
.app.iq .iq-bars { display: flex; flex-direction: column; gap: 8px; margin: 16px 0 6px; text-align: left; }
.app.iq .iq-bar-row { display: grid; grid-template-columns: 70px 1fr 40px; align-items: center; gap: 8px; font: 600 0.8rem var(--font); }
.app.iq .iq-bar { height: 10px; border-radius: 999px; padding: 0; overflow: hidden; }
.app.iq .iq-bar-fill { height: 100%; border-radius: 999px; background: linear-gradient(180deg, #a9ecff 0%, #3aa8ff 45%, #0f7de8 52%, #0b5fd6 100%); }
.app.iq .iq-result-actions { display: flex; gap: 10px; justify-content: center; margin-top: 14px; flex-wrap: wrap; }

.app.iq .iq-history { flex: none; padding: 14px 18px; }
.app.iq .iq-history h3 { margin: 0 0 8px; font: 700 0.95rem var(--font-display); color: #0b3a80; }
.app.iq .iq-history-list { display: flex; flex-direction: column; gap: 6px; }
.app.iq .iq-history-item { display: flex; align-items: center; gap: 10px; font: 500 0.85rem var(--font); }
.app.iq .iq-history-score { font: 700 0.95rem var(--font-display); width: 40px; text-align: right; color: #0b5fd6; }
.app.iq .iq-history-score.low { color: #c2321c; }
.app.iq .iq-history-score.high { color: #1c7a10; }
.app.iq .iq-history-label { opacity: 0.85; }
.app.iq .iq-history-empty { font: 500 0.85rem var(--font); opacity: 0.6; }

.app.iq .iq-toast {
  position: absolute; left: 50%; bottom: 14px; transform: translate(-50%, 20px); opacity: 0;
  padding: 9px 18px; border-radius: 999px; z-index: 5; pointer-events: none; white-space: nowrap;
  font: 700 0.9rem var(--font); color: #fff; text-shadow: 0 -1px 0 rgba(20,80,0,0.6);
  background: linear-gradient(180deg, #e2ffb0 0%, #a4f04a 45%, #7ddc2b 52%, #3f9a12 100%);
  border: 1px solid #2f7a0c; box-shadow: 0 6px 18px rgba(0,40,120,0.35), 0 1px 0 rgba(255,255,255,0.9) inset;
  transition: transform 0.3s cubic-bezier(.2,1.3,.3,1), opacity 0.3s ease;
}
.app.iq .iq-toast.show { transform: translate(-50%, 0); opacity: 1; }

/* =====================================================================
   Mobile
   ===================================================================== */
html.mobile .app.iq { padding: 10px 12px 0; gap: 8px; }
html.mobile .app.iq .iq-timer { width: 44px; height: 36px; }
html.mobile .app.iq .iq-card { padding: 16px; gap: 14px; }
html.mobile .app.iq .iq-q { font-size: 1.1rem; }
html.mobile .app.iq .iq-opts { grid-template-columns: 1fr; gap: 10px; }
html.mobile .app.iq .iq-opt { padding: 14px 10px; min-height: 48px; font-size: 1rem; }
html.mobile .app.iq .app-status { margin: 0 -12px; font-size: 0.8rem; }
html.mobile .app.iq .iq-result-score { font-size: 2.8rem; }
html.mobile .app.iq .iq-bar-row { grid-template-columns: 62px 1fr 36px; font-size: 0.75rem; }
html.mobile .app.iq .iq-result-actions { flex-direction: column; }
html.mobile .app.iq .iq-result-actions .aqua-btn { width: 100%; }
