/* ==========================================================================
   Paxeco Prime — Design System
   Tokens, reset e componentes compartilhados entre o painel e a pagina publica
   Estetica: SaaS moderno — grafite/azul-escuro solido, destaque laranja
   vibrante, tipografia sans geometrica, cards de cantos arredondados.
   ========================================================================== */

:root {
  /* ================================================================ paleta */

  /* Escala grafite/azul-escuro (superficies e texto) */
  --slate-950: #0b1120;
  --slate-900: #0f172a; /* fundo principal */
  --slate-850: #18233a; /* superficie elevada */
  --slate-800: #1e293b; /* cards */
  --slate-700: #263449;
  --slate-600: #334155;
  --slate-500: #64748b;
  --slate-400: #94a3b8;
  --slate-300: #cbd5e1;
  --slate-100: #f1f5f9;

  /* Laranja de acao */
  --accent-100: #ffedd5;
  --accent-300: #fdba74;
  --accent-400: #fb923c;
  --accent-500: #f97316; /* cor de acao principal */
  --accent-600: #ea580c;
  --accent-700: #c2410c;
  --accent-hot: #ff5722;

  /* Apoio */
  --sky-400: #38bdf8;
  --sky-500: #0ea5e9;

  --danger-400: #f87171;
  --danger-500: #ef4444;
  --success-400: #4ade80;
  --success-500: #22c55e;
  --warn-400: #fbbf24;

  /* --------------------------------------------------------- texto e fundo */
  --text: var(--slate-100);
  --text-soft: var(--slate-300);
  --text-muted: var(--slate-400);
  --text-faint: var(--slate-500);

  --bg: var(--slate-900);
  --bg-deep: var(--slate-950);

  /* Superficies solidas (nada de vidro translucido) */
  --surface: var(--slate-850);
  --surface-strong: var(--slate-800);
  --surface-hover: #22304a;

  --line: rgba(148, 163, 184, 0.16);
  --line-strong: rgba(148, 163, 184, 0.3);
  --line-accent: rgba(249, 115, 22, 0.45);

  /* ----------------------------------------------------------------- cards */
  --card-bg: var(--slate-800);
  --card-bg-raised: var(--slate-850);
  --card-border: 1px solid var(--line);
  --card-shadow: 0 1px 2px rgba(0, 0, 0, 0.4),
    0 12px 28px -20px rgba(0, 0, 0, 0.8);
  --card-shadow-hover: 0 18px 40px -22px rgba(0, 0, 0, 0.9),
    0 0 0 1px var(--line-accent);

  /* ---------------------------------------------------------------- laranja */
  --accent-grad: linear-gradient(135deg, #fdba74 0%, #f97316 48%, #ea580c 100%);
  --accent-grad-soft: linear-gradient(
    135deg,
    rgba(249, 115, 22, 0.18),
    rgba(249, 115, 22, 0.04)
  );
  /* Hover: esquenta para o laranja profundo da marca */
  --accent-grad-hot: linear-gradient(
    135deg,
    #fb923c 0%,
    #f97316 42%,
    var(--accent-hot) 100%
  );
  /* ------------------------------------------------------------ geometria */
  --r-xs: 8px;
  --r-sm: 10px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 20px;
  --r-pill: 999px;

  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 22px;
  --sp-6: 30px;
  --sp-7: 42px;
  --sp-8: 60px;

  /* ---------------------------------------------------------- tipografia */
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  --font-display: "Plus Jakarta Sans", "Inter", -apple-system,
    BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  /* ------------------------------------------------------------- movimento */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --t-fast: 0.15s;
  --t-base: 0.24s;
  --t-slow: 0.5s;

  --z-drawer: 900;
  --z-modal: 1000;
  --z-toast: 1100;
}

/* ==========================================================================
   Reset
   ========================================================================== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "cv11" 1, "ss01" 1;
}

h1,
h2,
h3,
h4,
p {
  margin: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

img {
  max-width: 100%;
  display: block;
}

code {
  font-variant-ligatures: none;
}

[hidden] {
  display: none !important;
}

/* ==========================================================================
   Scrollbar
   ========================================================================== */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(249, 115, 22, 0.35) transparent;
}

*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

*::-webkit-scrollbar-track {
  background: transparent;
}

*::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.28);
  border: 3px solid transparent;
  border-radius: var(--r-pill);
  background-clip: content-box;
}

*::-webkit-scrollbar-thumb:hover {
  background: rgba(249, 115, 22, 0.55);
  background-clip: content-box;
}

/* ==========================================================================
   Fundo ambiente — brilhos suaves sobre o grafite
   ========================================================================== */
.ambient {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background: radial-gradient(
      120% 90% at 50% -20%,
      var(--slate-800) 0%,
      var(--slate-900) 45%,
      var(--slate-950) 100%
    );
}

.ambient__blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.42;
  will-change: transform;
}

/* Brilho laranja da marca */
.ambient__blob--accent {
  width: 46vmax;
  height: 46vmax;
  top: -16vmax;
  right: -12vmax;
  background: radial-gradient(
    circle,
    rgba(249, 115, 22, 0.4) 0%,
    rgba(249, 115, 22, 0) 68%
  );
  animation: drift-a 24s var(--ease-out) infinite alternate;
}

.ambient__blob--blue {
  width: 52vmax;
  height: 52vmax;
  bottom: -22vmax;
  left: -16vmax;
  background: radial-gradient(
    circle,
    rgba(56, 189, 248, 0.28) 0%,
    rgba(56, 189, 248, 0) 70%
  );
  animation: drift-b 30s var(--ease-out) infinite alternate;
}

.ambient__blob--soft {
  width: 34vmax;
  height: 34vmax;
  top: 32%;
  left: 46%;
  background: radial-gradient(
    circle,
    rgba(148, 163, 184, 0.16) 0%,
    rgba(148, 163, 184, 0) 70%
  );
  animation: drift-a 38s var(--ease-out) infinite alternate-reverse;
}

/* Textura sutil de granulado para tirar o aspecto "digital chapado" */
.ambient__grain {
  position: absolute;
  inset: -50%;
  opacity: 0.1;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
}

@keyframes drift-a {
  from {
    transform: translate3d(0, 0, 0) scale(1);
  }
  to {
    transform: translate3d(-8vmax, 6vmax, 0) scale(1.15);
  }
}

@keyframes drift-b {
  from {
    transform: translate3d(0, 0, 0) scale(1.1);
  }
  to {
    transform: translate3d(9vmax, -7vmax, 0) scale(0.95);
  }
}

/* ==========================================================================
   Card — superficie solida de cantos arredondados
   ========================================================================== */
.card {
  position: relative;
  background: var(--card-bg);
  border: var(--card-border);
  border-radius: var(--r-lg);
  box-shadow: var(--card-shadow);
}

/* ==========================================================================
   Botoes
   ========================================================================== */
.btn {
  --btn-bg: var(--surface);
  --btn-fg: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: 10px 18px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  white-space: nowrap;
  transition: transform var(--t-fast) var(--ease-out),
    background var(--t-fast) linear, border-color var(--t-fast) linear,
    box-shadow var(--t-base) var(--ease-out), color var(--t-fast) linear,
    filter var(--t-fast) linear;
  -webkit-tap-highlight-color: transparent;
}

.btn:hover {
  background: var(--surface-hover);
  border-color: var(--line-strong);
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0) scale(0.985);
}

.btn:focus-visible {
  outline: 2px solid var(--accent-400);
  outline-offset: 2px;
}

.btn:disabled,
.btn[aria-busy="true"] {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

/* Acao principal: laranja vivo, hover com brilho e elevacao */
.btn--primary {
  background: var(--accent-500);
  background-image: var(--accent-grad);
  border-color: transparent;
  color: #0b1120;
  box-shadow: 0 8px 22px -12px rgba(249, 115, 22, 0.85),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.btn--primary:hover {
  background-color: var(--accent-500);
  background-image: var(--accent-grad-hot);
  border-color: transparent;
  filter: saturate(1.15) brightness(1.06);
  transform: translateY(-2px);
  box-shadow: 0 16px 34px -14px rgba(249, 115, 22, 0.95),
    0 0 0 4px rgba(249, 115, 22, 0.14);
}

.btn--primary:active {
  transform: translateY(0) scale(0.985);
  box-shadow: 0 8px 20px -12px rgba(249, 115, 22, 0.8);
}

.btn--ghost {
  background: transparent;
  border-color: transparent;
}

.btn--ghost:hover {
  background: var(--surface);
  border-color: var(--line);
}

.btn--danger {
  color: var(--danger-400);
  border-color: rgba(239, 68, 68, 0.32);
  background: rgba(239, 68, 68, 0.09);
}

.btn--danger:hover {
  background: rgba(239, 68, 68, 0.18);
  border-color: rgba(239, 68, 68, 0.5);
}

.btn--sm {
  padding: 7px 13px;
  font-size: 12.5px;
}

.btn--icon {
  padding: 9px;
  width: 38px;
  height: 38px;
}

.btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* ==========================================================================
   Formularios
   ========================================================================== */
.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.field__label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.field__hint {
  font-size: 11.5px;
  color: var(--text-faint);
  line-height: 1.45;
}

.field__error {
  font-size: 11.5px;
  color: var(--danger-400);
}

.input,
.textarea,
.select {
  width: 100%;
  padding: 11px 14px;
  background: rgba(11, 17, 32, 0.6);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  color: var(--text);
  font-size: 14px;
  transition: border-color var(--t-fast) linear,
    box-shadow var(--t-base) var(--ease-out), background var(--t-fast) linear;
}

.input::placeholder,
.textarea::placeholder {
  color: rgba(100, 116, 139, 0.9);
}

.input:hover,
.textarea:hover,
.select:hover {
  border-color: var(--line-strong);
}

.input:focus,
.textarea:focus,
.select:focus {
  outline: none;
  border-color: var(--accent-500);
  background: rgba(11, 17, 32, 0.85);
  box-shadow: 0 0 0 4px rgba(249, 115, 22, 0.14);
}

.input[aria-invalid="true"],
.textarea[aria-invalid="true"] {
  border-color: rgba(239, 68, 68, 0.6);
}

.textarea {
  resize: vertical;
  min-height: 84px;
  line-height: 1.55;
}

.select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 38px;
}

.select option {
  background: var(--slate-850);
  color: var(--text);
}

/* Campo de input com prefixo (ex: URL base + slug) */
.input-group {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: rgba(11, 17, 32, 0.6);
  overflow: hidden;
  transition: border-color var(--t-fast) linear,
    box-shadow var(--t-base) var(--ease-out);
}

.input-group:focus-within {
  border-color: var(--accent-500);
  box-shadow: 0 0 0 4px rgba(249, 115, 22, 0.14);
}

.input-group__prefix {
  display: flex;
  align-items: center;
  padding: 0 6px 0 14px;
  font-size: 13px;
  color: var(--text-faint);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.input-group .input {
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.input-group .input:focus {
  box-shadow: none;
  background: transparent;
}

/* Interruptor (toggle) */
.switch {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}

.switch input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.switch__track {
  position: relative;
  width: 42px;
  height: 24px;
  border-radius: var(--r-pill);
  background: var(--slate-600);
  border: 1px solid var(--line);
  transition: background var(--t-base) var(--ease-out),
    border-color var(--t-base) linear;
  flex-shrink: 0;
}

.switch__track::before {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--slate-300);
  transition: transform var(--t-base) var(--ease-spring),
    background var(--t-base) linear;
}

.switch input:checked + .switch__track {
  background: var(--accent-500);
  border-color: transparent;
}

.switch input:checked + .switch__track::before {
  transform: translateX(18px);
  background: #fff;
}

.switch input:focus-visible + .switch__track {
  outline: 2px solid var(--accent-400);
  outline-offset: 2px;
}

.switch__label {
  font-size: 13.5px;
  color: var(--text-soft);
}

/* ==========================================================================
   Badges
   ========================================================================== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3.5px 10px;
  border-radius: var(--r-pill);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text-muted);
  white-space: nowrap;
}

.badge--accent {
  background: rgba(249, 115, 22, 0.14);
  border-color: var(--line-accent);
  color: var(--accent-300);
}

.badge--on {
  background: rgba(34, 197, 94, 0.13);
  border-color: rgba(34, 197, 94, 0.34);
  color: var(--success-400);
}

.badge--off {
  background: rgba(148, 163, 184, 0.1);
  border-color: rgba(148, 163, 184, 0.24);
  color: var(--text-faint);
}

.badge svg {
  width: 12px;
  height: 12px;
}

/* ==========================================================================
   Icones Lucide
   ========================================================================== */
.lucide {
  stroke-width: 2;
}

/* ==========================================================================
   Estados: skeleton, vazio, erro
   ========================================================================== */
.skeleton {
  position: relative;
  overflow: hidden;
  background: rgba(148, 163, 184, 0.12);
  border-radius: var(--r-sm);
}

.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.08),
    transparent
  );
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  100% {
    transform: translateX(100%);
  }
}

.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-8) var(--sp-5);
  text-align: center;
  color: var(--text-muted);
}

.empty__icon {
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--accent-400);
}

.empty__icon svg {
  width: 26px;
  height: 26px;
}

.empty__title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-soft);
}

.empty__text {
  font-size: 13.5px;
  max-width: 380px;
}

/* ==========================================================================
   Aviso (banner)
   ========================================================================== */
.alert {
  display: flex;
  gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-5);
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: 13.5px;
  line-height: 1.55;
}

.alert svg {
  width: 19px;
  height: 19px;
  flex-shrink: 0;
  margin-top: 1px;
}

.alert__title {
  font-weight: 700;
  margin-bottom: 4px;
}

.alert--warn {
  border-color: rgba(251, 191, 36, 0.34);
  background: rgba(251, 191, 36, 0.09);
  color: #ffe6ac;
}

.alert--error {
  border-color: rgba(239, 68, 68, 0.34);
  background: rgba(239, 68, 68, 0.1);
  color: #ffd4d4;
}

.alert--info {
  border-color: rgba(56, 189, 248, 0.34);
  background: rgba(56, 189, 248, 0.1);
  color: #d6e6ff;
}

.alert code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  padding: 1px 6px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--line);
}

/* ==========================================================================
   Animacoes de entrada
   ========================================================================== */
@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

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

.animate-in {
  animation: fade-up 0.45s var(--ease-out) both;
}

/* Respeita quem prefere menos movimento */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ==========================================================================
   Acessibilidade
   ========================================================================== */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

