/* Native practice splash — medical blue, then CareOS splash continues the same beat. */

.ch-practice-splash {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(24px, env(safe-area-inset-top, 0px)) max(24px, env(safe-area-inset-right, 0px))
    max(24px, env(safe-area-inset-bottom, 0px)) max(24px, env(safe-area-inset-left, 0px));
  background: linear-gradient(145deg, #2b7bff 0%, #1e6fea 42%, #123a8c 100%);
  color: #fff;
  opacity: 1;
  transition: opacity 0.28s ease;
  pointer-events: all;
}

.ch-practice-splash.is-exiting {
  opacity: 0;
  pointer-events: none;
}

.ch-practice-splash__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  max-width: min(86vw, 360px);
  text-align: center;
  animation: ch-practice-splash-in 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.ch-practice-splash__logo {
  display: block;
  width: min(220px, 68vw);
  height: auto;
  max-height: 96px;
  object-fit: contain;
  border-radius: 20px;
  background: #fff;
  padding: 16px 20px;
  box-shadow: 0 16px 40px rgba(0, 18, 36, 0.22);
}

.ch-practice-splash__mark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 96px;
  height: 96px;
  border-radius: 26px;
  background: #fff;
  border: 0;
  font-family: var(--ec-font-display, 'Space Grotesk', sans-serif);
  font-size: 2.4rem;
  font-weight: 800;
  color: #1e6fea;
  box-shadow: 0 16px 40px rgba(0, 18, 36, 0.22);
}

.ch-practice-splash__name {
  margin: 4px 0 0;
  font-family: var(--ec-font-display, 'Space Grotesk', sans-serif);
  font-size: clamp(1.35rem, 5.5vw, 1.75rem);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.03em;
  color: #fff;
  text-wrap: balance;
}

.ch-practice-splash__orb {
  width: 36px;
  height: 36px;
  margin-top: 8px;
}

.ch-practice-splash__spinner {
  width: 100%;
  height: 100%;
  display: block;
  animation: ch-practice-splash-rotate 0.9s linear infinite;
  transform-origin: 50% 50%;
}

.ch-practice-splash__track {
  fill: none;
  stroke: rgba(255, 255, 255, 0.28);
  stroke-width: 3.25;
}

.ch-practice-splash__arc {
  fill: none;
  stroke: #fff;
  stroke-width: 3.25;
  stroke-linecap: round;
  stroke-dasharray: 28 72;
  animation: ch-practice-splash-dash 1.15s cubic-bezier(0.45, 0.05, 0.55, 0.95) infinite;
  transform-origin: 50% 50%;
}

.ch-practice-splash__caption {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.72);
}

@keyframes ch-practice-splash-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes ch-practice-splash-rotate {
  to {
    transform: rotate(360deg);
  }
}

@keyframes ch-practice-splash-dash {
  0% {
    stroke-dasharray: 8 92;
    stroke-dashoffset: 0;
  }
  50% {
    stroke-dasharray: 42 58;
    stroke-dashoffset: -18;
  }
  100% {
    stroke-dasharray: 8 92;
    stroke-dashoffset: -100;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ch-practice-splash,
  .ch-practice-splash__inner,
  .ch-practice-splash__spinner,
  .ch-practice-splash__arc {
    animation: none;
    transition: none;
  }

  .ch-practice-splash__arc {
    stroke-dasharray: 40 60;
  }
}

.med-loader {
  --med-ink: var(--ec-platform-ink, #0c1a2e);
  --med-accent: var(--ec-platform-blue, #0360f1);
  --med-track: color-mix(in srgb, var(--med-accent) 14%, transparent);
  display: grid;
  place-items: center;
  grid-gap: 18px;
  gap: 18px;
  padding: 28px 16px;
  text-align: center;
}

.med-loader--compact {
  padding: 12px 8px;
  gap: 10px;
}

.med-loader--splash {
  gap: 16px;
  padding: 0;
}

.med-loader__icon {
  display: block;
  width: 96px;
  height: 96px;
  border-radius: 26px;
  object-fit: cover;
  box-shadow: 0 16px 40px rgba(0, 18, 36, 0.22);
}

.med-loader__mark {
  display: block;
  width: min(240px, 72vw);
  height: auto;
  max-height: 64px;
  object-fit: contain;
  border-radius: 0;
}

.med-loader__mark--light {
  display: none;
}

.med-loader__orb {
  position: relative;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
}

.med-loader--compact .med-loader__orb {
  width: 32px;
  height: 32px;
}

.med-loader--splash .med-loader__orb {
  width: 40px;
  height: 40px;
}

.med-loader__spinner {
  width: 100%;
  height: 100%;
  display: block;
  animation: med-spinner-rotate 0.9s linear infinite;
  transform-origin: 50% 50%;
}

.med-loader__track {
  fill: none;
  stroke: var(--med-track);
  stroke-width: 3.25;
}

.med-loader__arc {
  fill: none;
  stroke: var(--med-accent);
  stroke-width: 3.25;
  stroke-linecap: round;
  stroke-dasharray: 28 72;
  stroke-dashoffset: 0;
  animation: med-spinner-dash 1.15s cubic-bezier(0.45, 0.05, 0.55, 0.95) infinite;
  transform-origin: 50% 50%;
}

.med-loader--compact .med-loader__track,
.med-loader--compact .med-loader__arc {
  stroke-width: 3.5;
}

.med-loader__label {
  margin: 0;
  max-width: 16rem;
  font-family: var(--ec-font-display, 'Space Grotesk', 'Poppins', system-ui, sans-serif);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--med-ink);
  opacity: 0.72;
}

.med-loader--splash .med-loader__label {
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.55;
}

@keyframes med-spinner-rotate {
  to {
    transform: rotate(360deg);
  }
}

@keyframes med-spinner-dash {
  0% {
    stroke-dasharray: 8 92;
    stroke-dashoffset: 0;
  }
  50% {
    stroke-dasharray: 42 58;
    stroke-dashoffset: -18;
  }
  100% {
    stroke-dasharray: 8 92;
    stroke-dashoffset: -100;
  }
}

@media (prefers-reduced-motion: reduce) {
  .med-loader__spinner,
  .med-loader__arc {
    animation: none;
  }

  .med-loader__arc {
    stroke-dasharray: 40 60;
    stroke-dashoffset: 0;
  }
}

