/* UIA Prep Panel v5 — blue futuristic, eye-comfort focused */
@import url("https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,500;0,9..40,600;1,9..40,400&family=JetBrains+Mono:wght@400;500&display=swap");

.uia-prep-panel {
  --uia-prep-bg: linear-gradient(145deg, #f0f7ff 0%, #e8f2fc 48%, #eef4fb 100%);
  --uia-prep-border: rgba(59, 130, 246, 0.22);
  --uia-prep-accent: #2563eb;
  --uia-prep-accent-soft: rgba(37, 99, 235, 0.12);
  --uia-prep-glow: rgba(59, 130, 246, 0.35);
  --uia-prep-text: #1e3a5f;
  --uia-prep-muted: #64748b;
  --uia-prep-success: #0d9488;
  --uia-prep-error: #dc2626;
  --uia-prep-font: "DM Sans", "Segoe UI", system-ui, sans-serif;
  --uia-prep-mono: "JetBrains Mono", "Cascadia Code", Consolas, monospace;

  margin: 0.75rem 0 0;
  border: 1px solid var(--uia-prep-border);
  border-radius: 14px;
  background: var(--uia-prep-bg);
  box-shadow:
    0 1px 2px rgba(15, 23, 42, 0.04),
    0 8px 24px rgba(37, 99, 235, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.85);
  overflow: hidden;
  font-family: var(--uia-prep-font);
  transition: opacity 0.35s ease, transform 0.35s ease, box-shadow 0.35s ease;
  position: relative;
}

.uia-prep-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 60% at 100% 0%, rgba(96, 165, 250, 0.08), transparent 55%);
  pointer-events: none;
}

.uia-prep-panel.is-active {
  box-shadow:
    0 1px 2px rgba(15, 23, 42, 0.04),
    0 12px 32px rgba(37, 99, 235, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.uia-prep-panel.is-collapsed {
  opacity: 0.94;
}

.uia-prep-panel.hidden {
  display: none !important;
}

.uia-prep-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.7rem 1rem;
  cursor: pointer;
  user-select: none;
  position: relative;
  z-index: 1;
}

.uia-prep-head__left {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  min-width: 0;
}

.uia-prep-head__pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--uia-prep-accent);
  box-shadow: 0 0 0 0 var(--uia-prep-glow);
  flex-shrink: 0;
  animation: uia-prep-pulse 2.4s ease-in-out infinite;
}

.uia-prep-panel.is-done .uia-prep-head__pulse,
.uia-prep-panel.is-error .uia-prep-head__pulse {
  animation: none;
}

.uia-prep-panel.is-done .uia-prep-head__pulse {
  background: var(--uia-prep-success);
  box-shadow: none;
}

.uia-prep-panel.is-error .uia-prep-head__pulse {
  background: var(--uia-prep-error);
  box-shadow: none;
}

.uia-prep-head__title {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--uia-prep-text);
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.uia-prep-head__meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.uia-prep-head__badge {
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--uia-prep-accent);
  background: var(--uia-prep-accent-soft);
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
}

.uia-prep-head__timer-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.uia-prep-head__timer-wrap[hidden] {
  display: none !important;
}

.uia-prep-head__timer-icon {
  width: 14px;
  height: 14px;
  color: var(--uia-prep-muted);
  flex-shrink: 0;
}

.uia-prep-head__timer {
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  color: var(--uia-prep-muted);
  font-family: var(--uia-prep-mono);
}

.uia-prep-head__chevron {
  width: 16px;
  height: 16px;
  color: #94a3b8;
  transition: transform 0.25s ease;
}

.uia-prep-panel.is-collapsed .uia-prep-head__chevron {
  transform: rotate(-90deg);
}

.uia-prep-body {
  padding: 0 1rem 0.875rem;
  position: relative;
  z-index: 1;
}

.uia-prep-body.hidden {
  display: none;
}

.uia-prep-steps {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  margin-bottom: 0.75rem;
}

.uia-prep-step {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.625rem;
  font-size: 0.8125rem;
  color: var(--uia-prep-muted);
}

.uia-prep-step.is-running {
  color: var(--uia-prep-text);
}

.uia-prep-step.is-done {
  color: #0f766e;
}

.uia-prep-step.is-error {
  color: var(--uia-prep-error);
}

.uia-prep-step__icon {
  width: 22px;
  height: 22px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(148, 163, 184, 0.15);
  flex-shrink: 0;
  transition: background 0.3s ease;
}

.uia-prep-step.is-running .uia-prep-step__icon {
  background: var(--uia-prep-accent-soft);
}

.uia-prep-step.is-done .uia-prep-step__icon {
  background: rgba(13, 148, 136, 0.12);
}

.uia-prep-step.is-error .uia-prep-step__icon {
  background: rgba(220, 38, 38, 0.1);
}

.uia-prep-step__icon svg {
  width: 12px;
  height: 12px;
  opacity: 0.55;
}

.uia-prep-step.is-running .uia-prep-step__icon svg {
  opacity: 1;
  color: var(--uia-prep-accent);
}

.uia-prep-step.is-done .uia-prep-step__icon svg {
  opacity: 1;
  color: var(--uia-prep-success);
}

.uia-prep-step__main {
  min-width: 0;
}

.uia-prep-step__label {
  display: block;
  font-weight: 500;
  line-height: 1.3;
  margin-bottom: 0.35rem;
}

.uia-prep-step__bar {
  height: 4px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.2);
  overflow: hidden;
  position: relative;
}

.uia-prep-step__bar-fill {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, #3b82f6 0%, #60a5fa 55%, #93c5fd 100%);
  box-shadow: 0 0 8px rgba(59, 130, 246, 0.35);
  transition: width 0.55s cubic-bezier(0.22, 1, 0.36, 1);
  position: relative;
}

.uia-prep-step__bar-fill::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.45) 50%,
    transparent 100%
  );
  animation: uia-prep-shimmer 2.2s ease-in-out infinite;
  opacity: 0;
}

.uia-prep-step.is-running .uia-prep-step__bar-fill::after {
  opacity: 1;
}

.uia-prep-step.is-done .uia-prep-step__bar-fill {
  background: linear-gradient(90deg, #0d9488 0%, #14b8a6 100%);
  box-shadow: 0 0 6px rgba(13, 148, 136, 0.25);
}

.uia-prep-step.is-error .uia-prep-step__bar-fill {
  background: linear-gradient(90deg, #ef4444 0%, #f87171 100%);
  box-shadow: none;
}

.uia-prep-step__pct {
  font-size: 0.6875rem;
  font-variant-numeric: tabular-nums;
  font-family: var(--uia-prep-mono);
  color: #94a3b8;
  min-width: 2.25rem;
  text-align: right;
}

.uia-prep-step.is-running .uia-prep-step__pct {
  color: var(--uia-prep-accent);
}

.uia-prep-head__timer[data-waiting="1"] {
  display: none;
}

.uia-prep-status {
  margin: 0 1rem 0.75rem;
  padding: 0.4rem 0.625rem;
  border-radius: 10px;
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.45;
  text-align: center;
}

.uia-prep-status.hidden {
  display: none !important;
}

.uia-prep-status.is-folded {
  color: var(--uia-prep-success);
  background: rgba(13, 148, 136, 0.08);
  border: 1px solid rgba(13, 148, 136, 0.12);
}

@keyframes uia-prep-pulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 var(--uia-prep-glow);
    opacity: 1;
  }
  50% {
    box-shadow: 0 0 0 6px transparent;
    opacity: 0.75;
  }
}

@keyframes uia-prep-shimmer {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .uia-prep-panel,
  .uia-prep-step__bar-fill,
  .uia-prep-head__pulse,
  .uia-prep-step__bar-fill::after {
    animation: none !important;
    transition: none !important;
  }
}

@media (max-width: 640px) {
  .uia-prep-head__badge {
    display: none;
  }
}
