/* arbat.pw shared UI primitives */
@import url("tokens.css");

.hidden { display: none !important; }

.arbat-loading {
  display: grid;
  place-content: center;
  text-align: center;
  gap: 12px;
  color: var(--arbat-muted, var(--muted));
}

.arbat-loading-mark {
  width: 56px;
  height: 56px;
  margin: 0 auto;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 1.4rem;
  color: #fff;
  background: linear-gradient(135deg, var(--arbat-accent, var(--accent)), #8b5cf6);
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.25);
}

.arbat-loading-dots {
  display: inline-flex;
  gap: 6px;
  justify-content: center;
}

.arbat-loading-dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--arbat-accent, var(--accent));
  opacity: 0.35;
  animation: arbat-pulse 1.2s ease-in-out infinite;
}

.arbat-loading-dots span:nth-child(2) { animation-delay: 0.15s; }
.arbat-loading-dots span:nth-child(3) { animation-delay: 0.3s; }

@keyframes arbat-pulse {
  0%, 80%, 100% { opacity: 0.35; transform: scale(1); }
  40% { opacity: 1; transform: scale(1.15); }
}

.arbat-card {
  background: var(--arbat-bg-elevated, var(--bg-elevated));
  border: 1px solid var(--arbat-border, var(--border));
  border-radius: var(--arbat-radius-lg, var(--radius-lg, 20px));
  box-shadow: var(--arbat-shadow, var(--shadow));
}

.arbat-tabs {
  display: grid;
  gap: 4px;
  padding: 3px;
  background: var(--arbat-bg-inset, var(--bg-inset));
  border: 1px solid var(--arbat-border, var(--border));
  border-radius: var(--arbat-radius-sm, var(--radius-sm, 12px));
}

.arbat-tab {
  border: none;
  border-radius: 10px;
  padding: 11px 14px;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  touch-action: manipulation;
  background: transparent;
  color: var(--arbat-muted, var(--muted));
  transition: background 0.15s, color 0.15s;
}

.arbat-tab.active {
  background: var(--arbat-bg-elevated, var(--bg-elevated));
  color: var(--arbat-text, var(--text));
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.arbat-btn {
  border: none;
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  touch-action: manipulation;
}

.arbat-btn.primary {
  background: var(--arbat-accent, var(--accent));
  color: #fff;
}

.arbat-btn.ghost {
  background: transparent;
  color: var(--arbat-muted, var(--muted));
  border: 1px solid var(--arbat-border, var(--border));
}

.arbat-input {
  width: 100%;
  border: 1px solid var(--arbat-border, var(--border));
  border-radius: var(--arbat-radius-sm, var(--radius-sm, 12px));
  padding: 12px 14px;
  background: var(--arbat-bg-inset, var(--bg-inset));
  color: var(--arbat-text, var(--text));
  font-size: 1rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.arbat-input:focus {
  outline: none;
  border-color: var(--arbat-accent, var(--accent));
  box-shadow: 0 0 0 3px var(--arbat-accent-dim, rgba(99, 102, 241, 0.18));
}

.arbat-error {
  color: var(--arbat-danger, #ef4444);
  font-size: 0.9rem;
  margin-top: 10px;
}

.arbat-error.ok {
  color: var(--arbat-success, #22c55e);
}

@media (prefers-reduced-motion: reduce) {
  .arbat-loading-dots span {
    animation: none;
    opacity: 0.7;
  }

  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

.version-tag {
  font-size: 0.75rem;
  opacity: 0.55;
  margin-top: 8px;
}