/* Gafxtrading — shared styles for the public site, onboarding and client area.
   The trading platform (plataforma.html) has its own dark terminal styles. */
:root {
  --paper: #f4f5f1;
  --card: #ffffff;
  --card-2: #f0f2ee;
  --ink: #0e1422;
  --ink-2: #2b3346;
  --muted: #5d6577;
  --line: #e1e4df;
  --line-2: #cfd4cc;
  --brand: #0a8a68;
  --brand-ink: #066147;
  --brand-soft: #e1f2ec;
  --brand-on: #ffffff;
  --amber: #d9932a;
  --amber-soft: #fbf0dd;
  --danger: #c93c3c;
  --danger-soft: #fbe7e7;
  --info-soft: #e7eef8;
  --night: #0f1525;
  --night-2: #182036;
  --night-line: #263049;
  --night-text: #d6dde9;
  --night-muted: #7f8aa1;
  --up: #12b886;
  --dn: #f0475c;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(14,20,34,.05), 0 8px 28px rgba(14,20,34,.06);
  --f-display: 'Bricolage Grotesque', 'Plus Jakarta Sans', system-ui, sans-serif;
  --f-body: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --f-mono: 'IBM Plex Mono', ui-monospace, Consolas, monospace;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --paper: #0c111d;
  --card: #141b2b;
  --card-2: #1a2235;
  --ink: #e6ebf3;
  --ink-2: #c3cbd8;
  --muted: #8b95a8;
  --line: #242d42;
  --line-2: #334058;
  --brand: #2cc196;
  --brand-ink: #5fd8b4;
  --brand-soft: rgba(44,193,150,.13);
  --brand-on: #04241b;
  --amber: #f0b453;
  --amber-soft: rgba(240,180,83,.13);
  --danger: #f06a6a;
  --danger-soft: rgba(240,106,106,.13);
  --info-soft: rgba(96,140,220,.14);
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 28px rgba(0,0,0,.25);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--f-body);
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--paper);
}
h1, h2, h3, h4 { font-family: var(--f-display); line-height: 1.12; margin: 0; text-wrap: balance; letter-spacing: -.02em; color: var(--ink); }
p { margin: 0; }
a { color: inherit; }
img { max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
.mono { font-family: var(--f-mono); font-variant-numeric: tabular-nums; }
.up { color: var(--up); }
.dn { color: var(--dn); }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding-inline: 20px; }
@media (max-width: 600px) { .wrap { padding-inline: 16px; } }

/* ---------- logo ---------- */
.logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.logo svg { width: 30px; height: 30px; flex-shrink: 0; }
.logo b { font-family: var(--f-display); font-size: 20px; font-weight: 700; letter-spacing: -.03em; }
.logo b span { color: var(--brand); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 22px; border-radius: 999px;
  font-weight: 600; font-size: 14px; text-decoration: none; white-space: nowrap;
  border: 1.5px solid transparent; cursor: pointer;
  transition: background .15s, border-color .15s, transform .1s, opacity .15s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--ink); color: var(--paper); }
.btn-primary:hover { background: var(--ink-2); }
.btn-brand { background: var(--brand); color: var(--brand-on); }
.btn-brand:hover { background: var(--brand-ink); }
:root[data-theme="dark"] .btn-brand:hover { background: #3fd3a8; }
.btn-ghost { background: transparent; border-color: var(--ink); color: var(--ink); }
.btn-ghost:hover { background: var(--card-2); }
.btn-soft { background: var(--card-2); color: var(--ink); }
.btn-soft:hover { background: var(--line); }
.btn-sm { height: 36px; padding: 0 16px; font-size: 13px; }
.btn-lg { height: 52px; padding: 0 30px; font-size: 15px; }
.btn-block { width: 100%; }
.btn[disabled], .btn.is-disabled { opacity: .4; pointer-events: none; }

/* ---------- forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.input, .select {
  width: 100%; height: 48px; padding: 0 14px;
  background: var(--card); border: 1.5px solid var(--line-2); border-radius: 10px;
  outline: none; transition: border-color .15s, box-shadow .15s;
}
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%235d6577' stroke-width='1.8'%3E%3Cpath d='M1 1.5l5 5 5-5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px; }
.input:focus, .select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.input.is-invalid, .select.is-invalid { border-color: var(--danger); }
.field-error { font-size: 12px; color: var(--danger); min-height: 0; }
.field-hint { font-size: 12px; color: var(--muted); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 640px) { .grid-2 { grid-template-columns: 1fr; } }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; color: var(--ink-2); cursor: pointer; }
.check input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--brand); flex-shrink: 0; }

/* choice tiles (questionnaire) */
.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 640px) { .choices { grid-template-columns: 1fr; } }
.choice {
  display: flex; align-items: center; gap: 14px; min-height: 60px; padding: 14px 18px;
  background: var(--card-2); border: 1.5px solid transparent; border-radius: 12px;
  text-align: left; cursor: pointer; transition: border-color .12s, background .12s;
}
.choice:hover { border-color: var(--line-2); }
.choice .dot { width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid var(--muted); flex-shrink: 0; position: relative; background: var(--card); }
.choice.multi .dot { border-radius: 5px; }
.choice[aria-checked="true"] { border-color: var(--ink); background: var(--card); }
.choice[aria-checked="true"] .dot { border-color: var(--brand); background: var(--brand); }
.choice[aria-checked="true"] .dot::after { content: ''; position: absolute; inset: 5px; border-radius: 50%; background: var(--card); }
.choice.multi[aria-checked="true"] .dot::after { inset: 4px 3px 6px; border: solid var(--brand-on); border-width: 0 0 2px 2px; border-radius: 0; background: none; transform: rotate(-45deg); }

/* ---------- notices / chips ---------- */
.notice { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 10px; background: var(--info-soft); font-size: 13.5px; color: var(--ink-2); }
.notice svg { width: 20px; height: 20px; flex-shrink: 0; margin-top: 1px; }
.notice.ok { background: var(--brand-soft); }
.notice.warn { background: var(--amber-soft); }
.notice.err { background: var(--danger-soft); }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.chip.ok { background: var(--brand-soft); color: var(--brand-ink); }
.chip.warn { background: var(--amber-soft); color: var(--amber); }
:root:not([data-theme="dark"]) .chip.warn { color: #9a6413; }
.chip.err { background: var(--danger-soft); color: var(--danger); }
.chip.neutral { background: var(--card-2); color: var(--muted); }
.chip.demo { background: #5b3fd1; color: #fff; }
.chip.beta { background: var(--amber, #f5b942); color: #1a1205; }
.placeholder-text { background: var(--amber-soft); color: inherit; padding: 0 4px; border-radius: 4px; }

/* ---------- toast & modal ---------- */
.toast-host { position: fixed; right: 16px; bottom: 16px; z-index: 300; display: flex; flex-direction: column; gap: 8px; max-width: calc(100vw - 32px); }
.toast { padding: 12px 16px; border-radius: 10px; background: var(--ink); color: var(--paper); font-size: 14px; box-shadow: var(--shadow); animation: toastIn .2s ease; max-width: 380px; }
.toast.err { background: var(--danger); color: #fff; }
.toast.ok { background: var(--brand); color: var(--brand-on); }
@keyframes toastIn { from { transform: translateY(8px); opacity: 0; } }
.modal-back { position: fixed; inset: 0; z-index: 200; background: rgba(10,14,24,.5); display: grid; place-items: center; padding: 16px; }
.modal { width: 100%; max-width: 520px; max-height: calc(100vh - 32px); overflow: auto; background: var(--card); border-radius: 20px; padding: 28px; box-shadow: var(--shadow); position: relative; }
.modal h3 { font-size: 24px; margin-bottom: 6px; text-align: center; }
.modal-x { position: absolute; top: 16px; right: 16px; width: 36px; height: 36px; border-radius: 50%; border: 0; background: transparent; cursor: pointer; display: grid; place-items: center; color: var(--muted); }
.modal-x:hover { background: var(--card-2); }

/* ---------- risk band ---------- */
.risk { font-size: 12.5px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 14px; }
.risk b { display: block; color: var(--ink-2); font-weight: 600; margin-bottom: 2px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
