/* Identidade visual Duby — tokens e componentes base.
   Origem: duby_analytics/frontend/static/styles.css (tokens, .btn, .field, login landing, fundo do portal). */

:root {
  color-scheme: dark;
  --bg: #0c0f14;
  --bg-elevated: #151a22;
  --surface: #1a2230;
  --border: rgba(148, 163, 184, 0.18);
  --border-strong: rgba(148, 163, 184, 0.32);
  --text: #e8eef7;
  --muted: #94a3b8;
  --accent: #38bdf8;
  --accent-dim: rgba(56, 189, 248, 0.14);
  --danger: #f87171;
  --danger-soft: rgba(248, 113, 113, 0.15);
  --success: #4ade80;
  --success-soft: rgba(74, 222, 128, 0.14);
  --warning: #fbbf24;
  --warning-soft: rgba(251, 191, 36, 0.14);
  --brand: #412884;
  --brand-violet: #c084fc;
  --brand-violet-soft: rgba(192, 132, 252, 0.14);
  --brand-lilac: #e9d5ff;
  --brand-gradient: linear-gradient(90deg, #e0c3fc 0%, #8ec5fc 100%);
  --card-bg: rgba(18, 22, 36, 0.65);
  --card-border: rgba(148, 163, 184, 0.18);
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 24px 48px rgba(0, 0, 0, 0.45);
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

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

[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* Fundo do portal Duby: roxo/azul noturno */
  background-color: #050110;
  background-image: radial-gradient(ellipse 80% 58% at 50% 36%, rgba(72, 48, 108, 0.42) 0%, transparent 58%),
    radial-gradient(ellipse 100% 48% at 50% 88%, rgba(28, 18, 45, 0.35) 0%, transparent 55%),
    linear-gradient(180deg, #080410 0%, #050110 42%, #030208 100%);
  background-attachment: fixed;
  background-repeat: no-repeat;
}

:is(input, button, textarea, select) {
  font: inherit;
}

a {
  color: var(--brand-violet);
  text-decoration: none;
}

a:hover {
  color: var(--brand-lilac);
}

:focus-visible {
  outline: 2px solid rgba(192, 132, 252, 0.6);
  outline-offset: 2px;
}

.ico {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.muted {
  color: var(--muted);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ----- Botões ----- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.55rem 1rem;
  border-radius: var(--radius-sm);
  font-weight: 550;
  line-height: 1.3;
  cursor: pointer;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  white-space: nowrap;
  transition: filter 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn--primary {
  background: var(--brand-gradient);
  color: #0a0a12;
  font-weight: 700;
  border: none;
}

.btn--primary:hover:not(:disabled) {
  filter: brightness(1.07);
}

.btn--ghost {
  border-color: var(--border);
}

.btn--ghost:hover:not(:disabled) {
  border-color: rgba(192, 132, 252, 0.35);
  background: rgba(255, 255, 255, 0.05);
}

.btn--danger-outline {
  border-color: rgba(248, 113, 113, 0.45);
  color: var(--danger);
}

.btn--danger-outline:hover:not(:disabled) {
  background: var(--danger-soft);
}

.btn--sm {
  padding: 0.35rem 0.65rem;
  font-size: 0.82rem;
}

.btn--block {
  width: 100%;
}

.btn--icon {
  padding: 0.45rem;
}

/* ----- Campos ----- */
.field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.field + .field {
  margin-top: 0.8rem;
}

.field label {
  font-weight: 500;
  color: #a0a0a0;
}

.field input,
.field select,
.field textarea,
.input {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border-radius: 11px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(6, 8, 18, 0.85);
  color: #ffffff;
  line-height: 1.4;
}

.field input::placeholder,
.input::placeholder {
  color: rgba(160, 160, 160, 0.65);
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.input:focus {
  outline: none;
  border-color: rgba(192, 132, 252, 0.45);
  box-shadow: 0 0 0 3px rgba(192, 132, 252, 0.14);
}

.field input:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.field-hint {
  font-size: 0.82rem;
  color: var(--muted);
}

.check {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: #a0a0a0;
  cursor: pointer;
}

.check input {
  accent-color: var(--brand-violet);
  width: 16px;
  height: 16px;
}

.field-password-wrap {
  position: relative;
}

.field-password-wrap > input {
  padding-right: 2.75rem;
}

.toggle-pass {
  position: absolute;
  right: 4px;
  top: 4px;
  bottom: 4px;
  width: 2.05rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 7px;
  background: rgba(14, 16, 26, 0.92);
  color: rgba(200, 195, 222, 0.95);
  cursor: pointer;
}

.toggle-pass:hover {
  border-color: rgba(192, 132, 252, 0.35);
  color: #f0e8ff;
}

.alert {
  padding: 0.55rem 0.8rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
}

.alert[hidden] {
  display: none;
}

.alert--erro {
  background: var(--danger-soft);
  border-color: rgba(248, 113, 113, 0.35);
  color: #fecaca;
}

.alert--ok {
  background: var(--success-soft);
  border-color: rgba(74, 222, 128, 0.35);
  color: #bbf7d0;
}
