/* Base compartilhada: paleta escura (mesma do app Python), tipografia, campos, cards e alertas. */
:root {
  --bg: #121214;
  --card: #202024;
  --inner: #29292e;
  --border: #323238;
  --accent: #8257e5;
  --accent-hover: #9466ff;
  --text: #e1e1e6;
  --muted: #a8a8b3;
  --gold: #e6b450;
  --ok: #04d361;
  --danger: #f75a68;
  --menu: #18181c;
  --menu-hover: #2f2f38;
  --disabled: #5c5c66;
  --radius: 12px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

section.card { background: var(--card); border-radius: var(--radius); padding: 18px 16px 20px; }
.card h2 { margin: 0 0 2px; font-size: 1.125rem; color: var(--accent-hover); }
.help { margin: 0 0 14px; color: var(--muted); font-size: .875rem; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field:last-child { margin-bottom: 0; }
label, .label { font-weight: 700; font-size: .9375rem; }
.req { color: var(--accent-hover); }
input:is([type="text"], [type="password"]), textarea {
  width: 100%;
  background: var(--inner);
  color: var(--text);
  border: 2px solid var(--border);
  border-radius: 8px;
  font: inherit;
  font-size: 16px; /* evita zoom automático no iOS */
}
input:is([type="text"], [type="password"]) { height: 46px; padding: 0 12px; }
textarea { min-height: 88px; padding: 10px 12px; resize: vertical; }
input:is([type="text"], [type="password"])::placeholder, textarea::placeholder { color: #6e6e78; }
input:is([type="text"], [type="password"]):focus, textarea:focus { outline: none; border-color: var(--accent); }
.invalid, .dd.invalid .dd-btn { border-color: var(--danger) !important; }
.hint { color: var(--muted); font-size: .8125rem; margin: 0; }

.alert {
  display: none;
  position: relative;
  background: rgba(247, 90, 104, .12);
  border: 1px solid var(--danger);
  border-radius: 10px;
  padding: 12px 40px 12px 14px;
  font-size: .9rem;
}
.alert.show { display: block; }
.alert.success { background: rgba(4, 211, 97, .1); border-color: var(--ok); }
.alert ul { margin: 6px 0 0; padding-left: 20px; }
.alert-close {
  position: absolute; top: 6px; right: 6px;
  width: 32px; height: 32px;
  border: 0; border-radius: 6px;
  background: transparent; color: var(--text);
  font-size: 1.1rem; cursor: pointer;
}

/* Botões */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 18px; border-radius: 10px;
  border: 2px solid var(--accent); background: var(--inner); color: #fff;
  font: inherit; font-weight: 700; text-decoration: none; cursor: pointer; touch-action: manipulation;
}
.btn:hover { background: var(--border); }
.btn:disabled { opacity: .6; cursor: wait; }
.btn-primary { background: var(--accent); border-color: var(--accent); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-danger { border-color: var(--danger); }
.btn-danger:hover { background: rgba(247, 90, 104, .18); }
.btn-small { min-height: 38px; padding: 0 12px; font-size: .875rem; }
.btn:focus-visible { outline: 2px solid var(--accent-hover); outline-offset: 2px; }
.msg { margin: 0; font-weight: 700; font-size: .9rem; }
.msg:empty { display: none; }
.msg.ok { color: var(--ok); }
.msg.bad { color: var(--danger); }
