:root {
  --page: #f9f9f7;
  --surface: #fcfcfb;
  --surface-2: #f3f2ee;
  --surface-3: #ebeae5;
  --border: rgba(11, 11, 11, 0.1);
  --border-strong: rgba(11, 11, 11, 0.18);
  --text: #0b0b0b;
  --text-dim: #52514e;
  --text-faint: #898781;
  --grid: #e1e0d9;
  --axis: #c3c2b7;

  --accent: #2a78d6;
  --accent-hover: #1c5cab;
  --accent-soft: rgba(42, 120, 214, 0.08);
  --accent-contrast: #ffffff;

  --danger: #d03b3b;
  --danger-soft: rgba(208, 59, 59, 0.08);
  --good: #0ca30c;
  --good-soft: rgba(12, 163, 12, 0.08);
  --warning: #b9790a;
  --warning-soft: rgba(237, 161, 0, 0.12);

  /* series de dados (categoricas, ordem fixa) */
  --series-1: #2a78d6;
  --series-2: #eb6834;
  --series-3: #1baf7a;
  --series-4: #eda100;

  /* rampa ordinal (funil) */
  --funnel-1: #104281;
  --funnel-2: #256abf;
  --funnel-3: #5598e7;
  --funnel-4: #86b6ef;

  --shopee: #ff7a1a;
  --ml: #ffd400;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --shadow-md: 0 8px 24px -12px rgba(11, 11, 11, 0.14);
  --shadow-lg: 0 24px 60px -24px rgba(11, 11, 11, 0.18);
  --font: system-ui, -apple-system, "Segoe UI", "Inter", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  color-scheme: light;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background: var(--page);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

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

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

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -0.01em;
}

.brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  display: block;
  flex-shrink: 0;
  object-fit: contain;
}

button {
  font-family: inherit;
  cursor: pointer;
}

.container {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 20px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-size: 14.5px;
  font-weight: 600;
  transition: transform 0.15s ease, background-color 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;
  white-space: nowrap;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--accent);
  color: var(--accent-contrast);
}

.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-ghost {
  background: transparent;
  border-color: var(--border-strong);
  color: var(--text);
}

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

.btn-block {
  width: 100%;
}

.btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: left;
}

.field label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dim);
}

.field input[type="text"],
.field input[type="email"],
.field input[type="password"],
.field select {
  height: 44px;
  padding: 0 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  font-size: 14.5px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field textarea,
textarea {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  resize: vertical;
  min-height: 72px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field input:focus,
.field select:focus,
.field textarea:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  color: var(--text-dim);
}

.checkbox-row input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

.form-error {
  display: none;
  font-size: 13px;
  color: var(--danger);
  background: var(--danger-soft);
  border: 1px solid rgba(208, 59, 59, 0.25);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}

.form-error.visible {
  display: block;
}

.form-success {
  display: none;
  font-size: 13px;
  color: #067606;
  background: var(--good-soft);
  border: 1px solid rgba(12, 163, 12, 0.25);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}

.form-success.visible {
  display: block;
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(11, 11, 11, 0.45);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 100;
}

.modal-overlay.open {
  display: flex;
}

.modal {
  width: 100%;
  max-width: 380px;
  max-height: 86vh;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 28px 26px 26px;
  position: relative;
  animation: modal-in 0.18s ease;
}

@keyframes modal-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--text-faint);
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close:hover {
  background: var(--surface-2);
  color: var(--text);
}

.modal h2 {
  font-size: 19px;
  margin-bottom: 4px;
}

.modal .modal-subtitle {
  font-size: 13.5px;
  color: var(--text-dim);
  margin-bottom: 22px;
}

.modal form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

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