/* Play+ · Painel — base: página, texto, foco, ícones e campos de formulário.
   Só regras para elementos e para o que vale na página inteira. Componentes ficam em components.css. */

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

* {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.16) transparent;
}

[hidden] {
  display: none !important;
}

html {
  background: var(--bg);
  color: var(--text);
  -webkit-text-size-adjust: 100%;
  scrollbar-gutter: stable; /* a página não "pula" quando a barra de rolagem aparece ou some */
}

body {
  margin: 0;
  min-height: 100vh;
  font: var(--fw-regular) var(--fs-body) / 1.5 var(--font-sans);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Brilho muito sutil da cor de destaque no topo da página (o fundo fica no <html>, este brilho por cima dele). */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(920px 380px at 60% -150px, color-mix(in srgb, var(--accent) 12%, transparent), transparent 72%),
    radial-gradient(680px 300px at 6% -130px, rgba(120, 150, 255, 0.045), transparent 70%);
}

/* ---------- Texto ---------- */

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

h1 {
  font-size: var(--fs-title);
  font-weight: var(--fw-bold);
  line-height: 1.15;
  letter-spacing: -0.028em;
}

h2 {
  font-size: var(--fs-section);
  font-weight: var(--fw-semi);
  line-height: 1.3;
  letter-spacing: -0.012em;
}

h3 {
  font-size: 13.5px;
  font-weight: var(--fw-semi);
  line-height: 1.3;
  letter-spacing: -0.005em;
}

b,
strong {
  font-weight: 650;
}

a {
  color: inherit;
}

::selection {
  background: color-mix(in srgb, var(--accent) 42%, transparent);
  color: #fff;
}

/* Foco por teclado sempre visível. Botões e campos trocam este contorno por um anel (components.css). */
:focus-visible {
  outline: 2px solid var(--accent-text);
  outline-offset: 2px;
  border-radius: var(--r-xs);
}

/* ---------- Ícones (um conjunto só, traço fino; desenhos em js/icons.js) ---------- */

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

.icon--sm {
  width: 16px;
  height: 16px;
}

.icon--lg {
  width: 20px;
  height: 20px;
}

.icon--xl {
  width: 24px;
  height: 24px;
  stroke-width: 1.6;
}

.icon--fill {
  fill: currentColor;
}

.icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

/* ---------- Campos ---------- */

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

button {
  cursor: pointer;
}

input,
select,
textarea {
  width: 100%;
  height: var(--control-h);
  padding: 0 12px;
  font: var(--fw-regular) var(--fs-body) / 1.4 var(--font-sans);
  color: var(--text);
  background: var(--field);
  border: 1px solid var(--line-2);
  border-radius: var(--r-md);
  outline: none;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.03),
    inset 0 1px 2px rgba(0, 0, 0, 0.35);
  transition:
    border-color var(--t-fast) var(--ease),
    box-shadow var(--t-fast) var(--ease),
    background var(--t-fast) var(--ease);
}

textarea {
  height: auto;
  min-height: 88px;
  padding: 9px 12px;
  line-height: 1.5;
  resize: vertical;
}

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

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  background: rgba(3, 4, 6, 0.8);
  box-shadow: var(--ring);
}

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

input:disabled,
select:disabled,
textarea:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* O navegador pinta o preenchimento automático com a cor dele: mantém o campo escuro. */
input:-webkit-autofill {
  -webkit-text-fill-color: #f4f5f7;
  caret-color: #f4f5f7;
  box-shadow: 0 0 0 1000px #0b0d12 inset;
}

input:-webkit-autofill:focus {
  box-shadow:
    0 0 0 1000px #0b0d12 inset,
    var(--ring);
}

select {
  appearance: none;
  padding-right: 36px;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-opacity='.6' stroke-width='1.75' 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 11px center;
  background-size: 16px;
}

select option {
  background: #11141b;
  color: #f2f3f5;
}

input[type='checkbox'],
input[type='radio'] {
  width: 16px;
  height: 16px;
  padding: 0;
  flex: none;
  accent-color: var(--accent);
  box-shadow: none;
  cursor: pointer;
}

input[type='color'] {
  width: 46px;
  padding: 3px;
  flex: none;
  cursor: pointer;
}

input[type='color']::-webkit-color-swatch-wrapper {
  padding: 0;
}

input[type='color']::-webkit-color-swatch {
  border: 0;
  border-radius: 6px;
}

input[type='file'] {
  width: auto;
  max-width: 100%;
  height: auto;
  padding: 0;
  font-size: var(--fs-small);
  color: var(--text-3);
  background: transparent;
  border: 0;
  border-radius: var(--r-sm);
  box-shadow: none;
  cursor: pointer;
}

input[type='file']:focus {
  background: transparent;
  box-shadow: none;
}

input[type='file']:focus-visible {
  box-shadow: var(--ring);
}

input[type='file']::file-selector-button {
  height: 28px;
  margin-right: 10px;
  padding: 0 12px;
  font: inherit;
  font-weight: 550;
  color: var(--text);
  background: var(--fill-2);
  border: 1px solid var(--line-2);
  border-radius: 7px;
  cursor: pointer;
}

input[type='search']::-webkit-search-cancel-button {
  cursor: pointer;
  filter: invert(1) opacity(0.6);
}

/* Rótulo em cima do campo: <label>Texto<input></label> */
label {
  display: grid;
  align-content: start;
  gap: 6px;
  font-size: var(--fs-caption);
  font-weight: var(--fw-medium);
  color: var(--text-2);
}

.help {
  font-size: var(--fs-caption);
  font-weight: var(--fw-regular);
  line-height: 1.45;
  color: var(--text-3);
}

.help a,
.link {
  color: var(--accent-text);
  text-decoration: none;
  text-underline-offset: 3px;
}

.help a:hover,
.link:hover {
  text-decoration: underline;
}

/* Mensagens de formulário */
.error,
.ok-msg {
  padding: 9px 12px;
  font-size: var(--fs-small);
  line-height: 1.45;
  white-space: pre-line;
  border-radius: var(--r-md);
}

.error {
  color: var(--danger);
  background: var(--danger-soft);
  border: 1px solid var(--danger-line);
}

/* Campo que o servidor recusou (ex.: endereço do DNS): borda vermelha até a pessoa mexer nele. */
input[aria-invalid='true'] {
  border-color: var(--danger);
}

.ok-msg {
  color: var(--ok);
  background: var(--ok-soft);
  border: 1px solid var(--ok-line);
}

/* ---------- Movimento ---------- */

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

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@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;
  }
}

/* ---------- Tema claro (29/10/2026) ----------
   Só o que aqui foi escrito para o fundo escuro. :where() deixa a regra com o mesmo peso da original. */

:where([data-theme='light']) * {
  scrollbar-color: rgba(15, 17, 21, 0.22) transparent;
}

:where([data-theme='light']) body::before {
  background: radial-gradient(920px 380px at 60% -150px, color-mix(in srgb, var(--accent) 6%, transparent), transparent 72%);
}

:where([data-theme='light']) ::selection {
  background: color-mix(in srgb, var(--accent) 22%, transparent);
  color: var(--text);
}

:where([data-theme='light']) input,
:where([data-theme='light']) select,
:where([data-theme='light']) textarea {
  box-shadow: inset 0 1px 2px rgba(15, 17, 21, 0.04);
}

:where([data-theme='light']) input:focus,
:where([data-theme='light']) select:focus,
:where([data-theme='light']) textarea:focus {
  background: #fff;
  box-shadow: var(--ring);
}

:where([data-theme='light']) input:-webkit-autofill {
  -webkit-text-fill-color: var(--text);
  caret-color: var(--text);
  box-shadow: 0 0 0 1000px #fff inset;
}

:where([data-theme='light']) input:-webkit-autofill:focus {
  box-shadow:
    0 0 0 1000px #fff inset,
    var(--ring);
}

/* Setinha do select em cinza-escuro */
:where([data-theme='light']) select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230f1115' stroke-opacity='.55' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
}

:where([data-theme='light']) select option {
  background: #fff;
  color: var(--text);
}
