/* EcoSwim — tokens e base visual. Forma do Aldeia Focus, paleta teal da marca.
   As fontes (Poppins) são carregadas no <head> de cada página. */
:root {
  --primary: #1f9a9a;
  --primary-dark: #177b7b;
  --primary-ink: #0f7a7a;
  --primary-soft: #e3f5f5;
  --ink: #0f2e30;
  --text: #3d5a5c;
  --muted: #5f7a7c;
  --subtle: #6b8585;
  --bg: #f4f8f8;
  --surface: #fff;
  --surface-soft: #eef5f5;
  --surface-raised: #fff;
  --border: rgba(15, 75, 79, 0.14);
  --border-soft: rgba(15, 75, 79, 0.08);
  --control-bg: #fbfdfd;
  --control-border: #cfe0e0;
  --blue: #397e9b;
  --green: #1f7a6a;
  --yellow: #926313;
  --purple: #79609f;
  --pink: #bf5048;
  --danger: #b3261e;
  --success-soft: #e6f4f1;
  --warning-soft: #fbf3e3;
  --danger-soft: #fbeeea;
  --radius: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --shadow-sm: 0 1px 2px rgba(10, 45, 48, 0.03);
  --shadow: 0 4px 16px rgba(10, 45, 48, 0.06);
  --shadow-lg: 0 16px 64px rgba(8, 36, 40, 0.18);
  --font-head: "Poppins", sans-serif;
  --font-body: "Poppins", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Consolas, monospace;
  --sidebar-w: 240px;
  --header-h: 68px;
  --ease: cubic-bezier(0.23, 1, 0.32, 1);
}

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

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

html {
  scrollbar-gutter: stable;
}

body {
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-head);
  color: var(--ink);
  line-height: 1.25;
  margin: 0;
  font-weight: 700;
  text-wrap: balance;
}

h1 {
  letter-spacing: -0.045em;
}

h2 {
  letter-spacing: -0.025em;
}

p {
  text-wrap: pretty;
}

a {
  color: var(--primary-ink);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

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

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

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

input,
textarea {
  min-width: 0;
}

input::placeholder,
textarea::placeholder {
  color: var(--subtle);
}

/* Checkbox e radio no padrão da marca (o visual nativo do navegador não combina) */
input[type="checkbox"],
input[type="radio"] {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  flex: none;
  margin: 0;
  border: 1.5px solid var(--control-border);
  background: var(--control-bg);
  display: inline-grid;
  place-content: center;
  cursor: pointer;
  transition: background 0.14s, border-color 0.14s, box-shadow 0.14s;
}
input[type="checkbox"] {
  border-radius: 5px;
}
input[type="radio"] {
  border-radius: 50%;
}
input[type="checkbox"]::before,
input[type="radio"]::before {
  content: "";
  width: 9px;
  height: 9px;
  transform: scale(0);
  transition: transform 0.12s var(--ease);
  background: #fff;
}
input[type="checkbox"]::before {
  clip-path: polygon(14% 44%, 0 65%, 42% 100%, 100% 16%, 80% 0, 42% 62%);
  width: 10px;
  height: 10px;
}
input[type="radio"]::before {
  border-radius: 50%;
}
input[type="checkbox"]:checked,
input[type="radio"]:checked {
  background: var(--primary);
  border-color: var(--primary);
}
input[type="checkbox"]:checked::before,
input[type="radio"]:checked::before {
  transform: scale(1);
}
input[type="checkbox"]:hover:not(:disabled),
input[type="radio"]:hover:not(:disabled) {
  border-color: var(--primary);
}
input[type="checkbox"]:focus-visible,
input[type="radio"]:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 25%, transparent);
}
input[type="checkbox"]:disabled,
input[type="radio"]:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Select (lista suspensa) com seta própria e a mesma altura dos campos */
select {
  appearance: none;
  -webkit-appearance: none;
  min-height: 40px;
  padding: 9px 36px 9px 12px;
  border: 1px solid var(--control-border);
  border-radius: var(--radius);
  background-color: var(--control-bg);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%235f7a7c' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  color: var(--ink);
  font-size: 13px;
  cursor: pointer;
  transition: border-color 0.16s, box-shadow 0.16s;
}
select:hover:not(:disabled) {
  border-color: var(--primary);
}
select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 14%, transparent);
}
select:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
select::-ms-expand {
  display: none;
}
body.theme-dark select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238fabab' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
}

:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--primary) 55%, transparent);
  outline-offset: 3px;
}

[hidden],
.hidden {
  display: none !important;
}

::selection {
  background: var(--primary-soft);
  color: var(--primary-ink);
}

::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}

::-webkit-scrollbar-thumb {
  background: var(--control-border);
  border: 2px solid var(--bg);
  border-radius: 20px;
}

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

.small {
  font-size: 12px;
}

.stack {
  display: flex;
  flex-direction: column;
}

.row {
  display: flex;
  align-items: center;
}

.gap-8 {
  gap: 8px;
}

.gap-12 {
  gap: 12px;
}

.gap-16 {
  gap: 16px;
}

.spacer {
  flex: 1;
}

.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.af-icon {
  width: 20px;
  height: 20px;
  display: inline-block;
  vertical-align: middle;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.eyebrow {
  font-size: 10px;
  line-height: 1.4;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--primary-ink);
  margin-bottom: 8px;
}

/* Tema escuro (preferência do usuário, guardada no navegador) */
body.theme-dark {
  color-scheme: dark;
  --bg: #0b1a1b;
  --surface: #112628;
  --surface-soft: #173234;
  --surface-raised: #1a3a3c;
  --ink: #e6f2f2;
  --text: #bcd3d3;
  --muted: #8fabab;
  --subtle: #7f9c9c;
  --border: rgba(180, 230, 230, 0.15);
  --border-soft: rgba(180, 230, 230, 0.08);
  --control-bg: #0f2224;
  --control-border: #2b4f51;
  --primary: #2fa8a8;
  --primary-dark: #258f8f;
  --primary-ink: #8fd9d9;
  --primary-soft: #173b3c;
  --green: #8dd5ab;
  --danger: #f0a396;
  --danger-soft: #3b2825;
  --shadow-sm: 0 1px 2px #0002;
  --shadow: 0 4px 16px #0002;
  --shadow-lg: 0 20px 64px #0007;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
