/* ══════════════════════════════════════════════════════════════
   Manic Pixels Web OS — Controles nativos unificados
   Garante que nenhum elemento nativo vaze o estilo do SO do usuário.
   Sprint 13
   ══════════════════════════════════════════════════════════════ */

/* ── select ──────────────────────────────────────────────────── */
select {
  appearance: none;
  -webkit-appearance: none;
  background-color: var(--mp-bg-secondary);
  border: 1px solid var(--mp-glass-border);
  border-radius: 4px;
  color: var(--mp-text-primary);
  font-family: var(--mp-font-ui);
  font-size: var(--mp-font-size-base);
  padding: 5px 28px 5px 10px;
  cursor: pointer;
  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='%23a0a8b8' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  outline: none;
  transition: border-color .15s;
}
select:focus { border-color: var(--mp-accent); }
select:hover { border-color: rgba(255,255,255,.25); }
select option { background: var(--mp-bg-secondary); color: var(--mp-text-primary); }

/* ── input[type="number"] ────────────────────────────────────── */
input[type="number"] {
  appearance: none;
  -webkit-appearance: none;
  background: var(--mp-bg-secondary);
  border: 1px solid var(--mp-glass-border);
  border-radius: 4px;
  color: var(--mp-text-primary);
  font-family: var(--mp-font-ui);
  font-size: var(--mp-font-size-base);
  padding: 5px 8px;
  outline: none;
  transition: border-color .15s;
}
input[type="number"]:focus { border-color: var(--mp-accent); }
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button { display: none; }
input[type="number"] { -moz-appearance: textfield; }

/* ── input[type="range"] ─────────────────────────────────────── */
input[type="range"] {
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  width: 100%;
  height: 18px;
  cursor: pointer;
  outline: none;
}
input[type="range"]::-webkit-slider-runnable-track {
  height: 4px;
  background: rgba(255,255,255,.15);
  border-radius: 2px;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--mp-accent);
  margin-top: -5px;
  transition: transform .1s;
}
input[type="range"]::-webkit-slider-thumb:hover { transform: scale(1.2); }
input[type="range"]::-moz-range-track {
  height: 4px;
  background: rgba(255,255,255,.15);
  border-radius: 2px;
}
input[type="range"]::-moz-range-thumb {
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--mp-accent);
  border: none;
}

/* ── input[type="text"], url, search, email ──────────────────── */
/* :not(.mp-login-input) exclui os campos da tela de login, que têm
   estilo pill-rounded próprio e não devem herdar o visual padrão aqui. */
input[type="text"]:not(.mp-login-input),
input[type="url"]:not(.mp-login-input),
input[type="search"]:not(.mp-login-input),
input[type="email"]:not(.mp-login-input) {
  appearance: none;
  background: var(--mp-bg-secondary);
  border: 1px solid var(--mp-glass-border);
  border-radius: 4px;
  color: var(--mp-text-primary);
  font-family: var(--mp-font-ui);
  font-size: var(--mp-font-size-base);
  padding: 5px 10px;
  outline: none;
  transition: border-color .15s;
}
input[type="text"]:not(.mp-login-input):focus,
input[type="url"]:not(.mp-login-input):focus,
input[type="search"]:not(.mp-login-input):focus,
input[type="email"]:not(.mp-login-input):focus { border-color: var(--mp-accent); }
input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-decoration { -webkit-appearance: none; }

/* ── input[type="checkbox"] ──────────────────────────────────── */
input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 16px; height: 16px;
  border: 1.5px solid var(--mp-glass-border);
  border-radius: 3px;
  background: var(--mp-bg-secondary);
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
  transition: background .15s, border-color .15s;
}
input[type="checkbox"]:checked { background: var(--mp-accent); border-color: var(--mp-accent); }
input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  left: 4px; top: 1px;
  width: 5px; height: 9px;
  border: 2px solid #fff;
  border-top: none; border-left: none;
  transform: rotate(45deg);
}

/* ── input[type="radio"] ─────────────────────────────────────── */
input[type="radio"] {
  appearance: none;
  -webkit-appearance: none;
  width: 16px; height: 16px;
  border: 1.5px solid var(--mp-glass-border);
  border-radius: 50%;
  background: var(--mp-bg-secondary);
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
  transition: border-color .15s;
}
input[type="radio"]:checked { border-color: var(--mp-accent); }
input[type="radio"]:checked::after {
  content: '';
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: var(--mp-accent);
}

/* ── input[type="file"] ──────────────────────────────────────── */
input[type="file"] {
  color: var(--mp-text-secondary);
  font-family: var(--mp-font-ui);
  font-size: 12px;
}
input[type="file"]::file-selector-button {
  appearance: none;
  background: var(--mp-bg-tertiary);
  border: 1px solid var(--mp-glass-border);
  border-radius: 4px;
  color: var(--mp-text-primary);
  font-family: var(--mp-font-ui);
  font-size: 12px;
  padding: 4px 10px;
  cursor: pointer;
  margin-right: 8px;
  transition: background .15s;
}
input[type="file"]::file-selector-button:hover { background: rgba(255,255,255,.1); }

/* ── textarea ────────────────────────────────────────────────── */
textarea {
  appearance: none;
  background: var(--mp-bg-secondary);
  border: 1px solid var(--mp-glass-border);
  border-radius: 4px;
  color: var(--mp-text-primary);
  font-family: var(--mp-font-ui);
  font-size: var(--mp-font-size-base);
  padding: 8px 10px;
  outline: none;
  resize: vertical;
  transition: border-color .15s;
}
textarea:focus { border-color: var(--mp-accent); }

/* ── button — reset base (não sobrescreve classes .mp-*) ─────── */
button { font-family: var(--mp-font-ui); }

/* ── Scrollbar global (Webkit) ───────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,.15); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.25); }
