/* =========================================================
   KARMA WAITING / AUTH SPLASH — строго и финтех-дорого
   На базе tokens.css, без блобов и хардкодных цветов
   ========================================================= */

html,
body {
  height: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
  background: var(--bg-canvas);
  color: var(--text-primary);
  font-family: var(--font-sans);
}

.k-wait-screen {
  position: relative;
  min-height: 100dvh;
  width: 100%;
  background: var(--bg-app-glow), var(--bg-canvas);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: calc(var(--space-6) + env(safe-area-inset-top, 0px)) var(--space-5)
    calc(var(--space-8) + env(safe-area-inset-bottom, 0px));
  box-sizing: border-box;
}

.k-wait-core {
  width: 100%;
  max-width: 360px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--space-5);
}

/* Эмблема с мягким дыханием ореола */
.k-wait-emblem-wrap {
  position: relative;
  width: 112px;
  height: 112px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.k-wait-halo {
  position: absolute;
  inset: -18px;
  border-radius: var(--radius-full);
  background: var(--waiting-halo);
  animation: k-wait-breathe 2.6s ease-in-out infinite;
}

.k-wait-ring {
  position: absolute;
  inset: 0;
  border-radius: var(--radius-full);
  border: 1.5px solid var(--border-subtle);
  border-top-color: var(--accent-primary-light);
  animation: k-wait-spin 1.15s linear infinite;
}

.k-wait-logo-box {
  position: relative;
  z-index: var(--z-base);
  width: 76px;
  height: 76px;
  border-radius: var(--radius-xl);
  background: var(--surface-1);
  border: 1px solid var(--border-default);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  justify-content: center;
}

.k-wait-logo-img {
  width: 44px;
  height: 44px;
  object-fit: contain;
}

.k-wait-brand {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.k-wait-brand__title {
  margin: 0;
  font-size: var(--text-2xl);
  font-weight: 800;
  letter-spacing: 0.16em;
  color: var(--text-primary);
}

.k-wait-brand__sub {
  margin: 0;
  font-size: var(--text-sm);
  color: var(--text-muted);
  font-weight: 500;
}

/* Прецизионный прогресс-бар */
.k-wait-progress {
  width: 180px;
  height: 3px;
  border-radius: var(--radius-pill);
  background: var(--surface-pill);
  overflow: hidden;
}

.k-wait-progress__fill {
  height: 100%;
  width: 0;
  border-radius: var(--radius-pill);
  background: var(--gradient-accent);
  animation: k-wait-progress-fill 1.1s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

/* Состояние ошибки */
.k-wait-error {
  width: 100%;
  max-width: 340px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--space-3);
}

.k-wait-error__icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-full);
  background: var(--status-danger-soft);
  border: 1px solid var(--status-danger-border);
  color: var(--status-danger-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-xl);
}

.k-wait-error__actions {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-top: var(--space-2);
}

.k-wait-version {
  position: fixed;
  bottom: calc(var(--space-4) + env(safe-area-inset-bottom, 0px));
  left: 50%;
  transform: translateX(-50%);
  padding: 4px var(--space-3);
  border-radius: var(--radius-pill);
  background: var(--surface-interactive);
  border: 1px solid var(--border-subtle);
  color: var(--text-subtle);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  pointer-events: none;
}

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

@keyframes k-wait-breathe {
  0%, 100% { transform: scale(0.92); opacity: 0.55; }
  50% { transform: scale(1.06); opacity: 1; }
}

@keyframes k-wait-progress-fill {
  0% { width: 8%; }
  100% { width: 100%; }
}
