/* Hares Design System v0.1
   Tokens e primitivas compartilhadas.
   Não altera regras, motores ou fluxos funcionais. */

:root {
  --hares-navy-950: #071426;
  --hares-navy-900: #0f172a;
  --hares-blue-600: #1273DE;
  --hares-blue-500: #0099FF;
  --hares-cyan-400: #00BFFF;
  --hares-purple-600: #7B2FF7;

  --hares-bg: #ffffff;
  --hares-surface: #f8fbff;
  --hares-surface-2: #eef7ff;
  --hares-text: #0f172a;
  --hares-muted: #526078;
  --hares-border: #dce6f3;
  --hares-border-brand: rgba(18,115,222,.16);

  --hares-radius-sm: 10px;
  --hares-radius-md: 14px;
  --hares-radius-lg: 20px;
  --hares-radius-xl: 28px;
  --hares-radius-pill: 999px;

  --hares-shadow-sm: 0 8px 22px rgba(15,23,42,.07);
  --hares-shadow-md: 0 16px 36px rgba(15,23,42,.14);
  --hares-shadow-lg: 0 24px 54px rgba(15,23,42,.18);
  --hares-shadow-brand: 0 18px 42px rgba(18,115,222,.18);

  --hares-gradient-brand: linear-gradient(135deg, #1273DE 0%, #00A9F4 52%, #6e42d3 118%);
  --hares-gradient-text: linear-gradient(115deg, #1273DE 0%, #00AEEF 48%, #7B2FF7 100%);

  --hares-motion-fast: 160ms;
  --hares-motion-base: 240ms;
  --hares-motion-slow: 420ms;
  --hares-ease-standard: cubic-bezier(.2,.8,.2,1);
  --hares-ease-emphasis: cubic-bezier(.16,1,.3,1);
}

html[data-theme="dark"] {
  --hares-bg: #071426;
  --hares-surface: #0c1d33;
  --hares-surface-2: #102640;
  --hares-text: #eef6ff;
  --hares-muted: #b7c7d9;
  --hares-border: #27425f;
  --hares-border-brand: rgba(56,189,248,.22);
  --hares-shadow-sm: 0 8px 22px rgba(0,0,0,.18);
  --hares-shadow-md: 0 16px 36px rgba(0,0,0,.28);
  --hares-shadow-lg: 0 24px 54px rgba(0,0,0,.38);
}

/* Primitivas reutilizáveis — adoção gradual por página. */
.hares-ds-surface {
  background: var(--hares-surface);
  color: var(--hares-text);
  border: 1px solid var(--hares-border);
  border-radius: var(--hares-radius-lg);
  box-shadow: var(--hares-shadow-sm);
}

.hares-ds-card {
  background: var(--hares-bg);
  color: var(--hares-text);
  border: 1px solid var(--hares-border-brand);
  border-radius: var(--hares-radius-lg);
  box-shadow: var(--hares-shadow-sm);
  transition:
    transform var(--hares-motion-base) var(--hares-ease-standard),
    box-shadow var(--hares-motion-base) var(--hares-ease-standard),
    border-color var(--hares-motion-base) var(--hares-ease-standard);
}

.hares-ds-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--hares-shadow-md);
  border-color: rgba(18,115,222,.30);
}

.hares-ds-button {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .55rem;
  padding: .8rem 1.15rem;
  border-radius: var(--hares-radius-md);
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  transition:
    transform var(--hares-motion-fast) var(--hares-ease-standard),
    box-shadow var(--hares-motion-base) var(--hares-ease-standard),
    background-color var(--hares-motion-fast) ease,
    border-color var(--hares-motion-fast) ease;
}

.hares-ds-button--primary {
  color: #fff;
  background: var(--hares-gradient-brand);
  border: 1px solid rgba(255,255,255,.22);
  box-shadow: 0 12px 30px rgba(18,115,222,.20);
}

.hares-ds-button--primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--hares-shadow-brand);
}

.hares-ds-button--secondary {
  color: var(--hares-blue-600);
  background: color-mix(in srgb, var(--hares-bg) 88%, transparent);
  border: 1px solid rgba(18,115,222,.32);
  box-shadow: var(--hares-shadow-sm);
}

.hares-ds-badge {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  width: fit-content;
  padding: .38rem .68rem;
  border-radius: var(--hares-radius-pill);
  border: 1px solid rgba(18,115,222,.18);
  background: rgba(18,115,222,.08);
  color: var(--hares-blue-600);
  font-size: .76rem;
  font-weight: 850;
  letter-spacing: .01em;
}

.hares-ds-focus:focus-visible,
.hares-ds-button:focus-visible,
.hares-ds-card:focus-visible {
  outline: 3px solid rgba(0,191,255,.42);
  outline-offset: 4px;
}

.hares-ds-gradient-text {
  background: var(--hares-gradient-text);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Tipografia editorial Hares.
   Aplicar somente a textos corridos; títulos, labels, listas, CTAs e textos curtos
   mantêm o alinhamento definido pelo componente. */
.hares-copy {
  text-align: justify;
  text-align-last: left;
  text-justify: inter-word;
  -webkit-hyphens: auto;
  hyphens: auto;
  overflow-wrap: break-word;
}

.hares-copy--left {
  text-align: left;
  text-align-last: auto;
}

.hares-copy--center {
  text-align: center;
  text-align-last: center;
}

/* Estados padronizados para ferramentas e ações assíncronas.
   A camada visual não define regras de negócio nem dispara requisições. */
.hares-state {
  display: flex;
  align-items: flex-start;
  gap: .8rem;
  width: 100%;
  padding: 1rem 1.05rem;
  border: 1px solid var(--hares-border);
  border-radius: var(--hares-radius-md);
  background: var(--hares-surface);
  color: var(--hares-text);
  box-shadow: var(--hares-shadow-sm);
}

.hares-state__content {
  min-width: 0;
  flex: 1;
}

.hares-state__title {
  margin: 0 0 .2rem;
  font-size: .96rem;
  font-weight: 850;
  line-height: 1.35;
}

.hares-state__text {
  margin: 0;
  color: var(--hares-muted);
  font-size: .9rem;
  line-height: 1.55;
}

.hares-state--loading {
  border-color: rgba(18,115,222,.20);
  background: color-mix(in srgb, var(--hares-surface) 92%, var(--hares-blue-500) 8%);
}

.hares-state--empty {
  border-style: dashed;
}

.hares-state--error {
  border-color: rgba(220,38,38,.26);
  background: color-mix(in srgb, var(--hares-surface) 92%, #dc2626 8%);
}

.hares-state--success {
  border-color: rgba(5,150,105,.24);
  background: color-mix(in srgb, var(--hares-surface) 92%, #059669 8%);
}

.hares-spinner {
  width: 1.2rem;
  height: 1.2rem;
  flex: 0 0 1.2rem;
  margin-top: .08rem;
  border: 2px solid rgba(18,115,222,.20);
  border-top-color: var(--hares-blue-600);
  border-radius: 50%;
  animation: hares-spin .72s linear infinite;
}

@keyframes hares-spin {
  to { transform: rotate(360deg); }
}

/* Em telas estreitas, priorizar legibilidade sobre justificação visual. */
@media (max-width: 640px) {
  .hares-copy {
    text-align: left;
    text-align-last: auto;
  }

  .hares-state {
    padding: .9rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hares-ds-card,
  .hares-ds-button {
    transition: none !important;
    animation: none !important;
    transform: none !important;
  }

  .hares-spinner {
    animation: none !important;
    border-color: rgba(18,115,222,.22);
    border-top-color: var(--hares-blue-600);
  }
}
