/* Identidade liza orçamentos — roxo #7152E3 + menta #00E5BB (wmw systems) */
:root {
  --primary: #7152E3;
  --primary-dark: #5B3FD4;
  --primary-deep: #241F4E;
  --accent: #00E5BB;
  --ink: #23204A;
  --muted: #6F6895;
  --line: #E5E0FB;
  --card: #FFFFFF;
  --bg-soft: #F4F2FD;
  --error-bg: #FDEDEF;
  --error-line: #F3B7C2;
  --error-ink: #B4233C;
  --ok-bg: #E6FBF6;
  --ok-line: #7FE9D2;
  --ok-ink: #0A6B57;
}
* { box-sizing: border-box; }

/* ---------- base ---------- */
body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(620px 420px at 85% -5%, rgba(0, 229, 187, .18), transparent 60%),
    radial-gradient(720px 520px at -10% 110%, rgba(0, 229, 187, .12), transparent 60%),
    linear-gradient(135deg, #262152 0%, #4A3AA8 55%, var(--primary) 100%);
}
body.page-app { display: block; padding: 0; }
body.page-center {
  display: grid;
  place-items: center;
  padding: 24px;
}

/* ---------- barra superior (páginas internas) ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 28px;
  color: #fff;
  background: rgba(24, 18, 64, .55);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid rgba(255, 255, 255, .14);
}
.topbar .brandline { display: flex; align-items: center; gap: 12px; }
.topbar .brand-mark {
  width: 38px; height: 38px; flex: 0 0 38px;
  display: grid; place-items: center;
  font-size: 20px; font-weight: 700; color: #fff;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent) 0%, #4BE3C3 55%, var(--primary) 130%);
  position: relative;
}
.topbar .brand-name { margin: 0; font-size: 17px; font-weight: 700; letter-spacing: -.3px; }
.topbar .brand-name span { font-weight: 400; opacity: .85; }
.topbar .who { font-size: 13px; opacity: .85; margin-right: 12px; }
.topbar .logout { display: inline; }
.linklike {
  background: none; border: 0; padding: 0; cursor: pointer;
  color: #fff; font-size: 13px; text-decoration: underline;
  text-underline-offset: 3px;
  margin: 0;
  box-shadow: none;
}

/* ---------- cartão / conteúdo ---------- */
.shell { max-width: 1080px; margin: 0 auto; padding: 28px 24px 48px; }
.card {
  background: var(--card);
  border-radius: 20px;
  padding: 32px 30px;
  box-shadow: 0 24px 64px rgba(20, 12, 60, .45);
}
.card.narrow { width: 100%; max-width: 400px; padding: 40px 36px 28px; }
.card.medium { width: 100%; max-width: 640px; }
.center-wrap { display: grid; place-items: center; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 6px; }
.page-head h2 { margin: 0; font-size: 24px; color: var(--primary-deep); letter-spacing: -.4px; }
.page-head p { margin: 4px 0 0; font-size: 13px; color: var(--muted); }

/* ---------- marca (login) ---------- */
.brand { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.brand-mark {
  width: 52px; height: 52px; flex: 0 0 52px;
  display: grid; place-items: center;
  font-size: 28px; font-weight: 700; color: #fff;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 60%, #3E2FA0 100%);
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .15);
  position: relative;
}
.brand-mark::after {
  content: ""; position: absolute; right: 9px; bottom: 9px;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--accent);
}
.brand-name { margin: 0; font-size: 24px; font-weight: 700; letter-spacing: -.5px; color: var(--primary-deep); }
.brand-name span { font-weight: 400; color: var(--primary); }
.brand-sub { margin: 2px 0 0; font-size: 13px; color: var(--muted); }
.rule {
  height: 4px; border: 0; border-radius: 999px; margin: 0 0 24px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
}
footer.brand-foot { margin-top: 24px; text-align: center; font-size: 12px; color: var(--muted); }
footer.brand-foot strong { color: var(--primary-deep); font-weight: 700; }

/* ---------- alertas ---------- */
.alert { margin: 0 0 16px; padding: 12px 14px; font-size: 14px; border-radius: 12px; border: 1px solid; }
.alert.error { color: var(--error-ink); background: var(--error-bg); border-color: var(--error-line); }
.alert.ok { color: var(--ok-ink); background: var(--ok-bg); border-color: var(--ok-line); }

/* ---------- formulários ---------- */
form.grid { display: grid; gap: 6px; }
label { font-size: 13px; font-weight: 600; color: var(--primary-deep); margin-top: 10px; }
label:first-of-type { margin-top: 0; }
.hint { font-size: 12px; color: var(--muted); margin: 2px 0 0; }
input[type="text"], input[type="password"], input[type="url"] {
  width: 100%;
  padding: 12px 14px;
  font-size: 15px;
  color: var(--ink);
  background: #FAF9FF;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
input:focus {
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(113, 82, 227, .18);
}
input[readonly] { background: var(--bg-soft); }
.field-error { font-size: 12px; color: var(--error-ink); margin: 2px 0 0; }
.checkline { display: flex; align-items: flex-start; gap: 10px; margin-top: 14px; padding: 12px 14px; background: var(--bg-soft); border-radius: 12px; }
.checkline input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--primary); }
.checkline label { margin: 0; }
.checkline small { display: block; font-weight: 400; color: var(--muted); }

/* ---------- botões ---------- */
.btn {
  display: inline-block;
  margin-top: 20px;
  padding: 13px 22px;
  font-size: 15px; font-weight: 700; text-decoration: none;
  color: #fff; cursor: pointer;
  border: 0; border-radius: 12px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  box-shadow: 0 8px 20px rgba(113, 82, 227, .35);
  transition: transform .12s ease, box-shadow .12s ease, filter .12s ease;
}
button.btn { font-size: 16px; }
.btn:hover { filter: brightness(1.06); transform: translateY(-1px); box-shadow: 0 12px 24px rgba(113, 82, 227, .42); }
.btn:active { transform: translateY(0); }
.btn:focus-visible, .btn-ghost:focus-visible, .iconbtn:focus-visible, .linklike:focus-visible {
  outline: 3px solid var(--accent); outline-offset: 2px;
}
.btn-ghost {
  display: inline-block;
  margin-top: 20px; margin-left: 10px;
  padding: 12px 20px;
  font-size: 15px; font-weight: 600; text-decoration: none;
  color: var(--primary-deep); cursor: pointer;
  border: 1.5px solid var(--line); border-radius: 12px; background: #fff;
}
.btn-ghost:hover { border-color: var(--primary); }
.btn-danger {
  background: linear-gradient(135deg, #D63A52, #B4233C);
  box-shadow: 0 8px 20px rgba(180, 35, 60, .3);
}

/* ---------- tabela ---------- */
.table-wrap { overflow-x: auto; margin-top: 18px; border: 1px solid var(--line); border-radius: 14px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; background: #fff; }
thead th {
  text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .5px;
  color: var(--muted); background: var(--bg-soft);
  padding: 12px 14px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
tbody td { padding: 12px 14px; border-bottom: 1px solid #F0EDFD; vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #FAF9FF; }
.mono { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: 13px; }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }
.empty { text-align: center; color: var(--muted); padding: 28px 14px; }
.badge {
  display: inline-block; padding: 3px 10px; font-size: 12px; font-weight: 700;
  color: var(--primary-deep); background: #EFEAFF; border-radius: 999px; white-space: nowrap;
}
.badge.ok { color: var(--ok-ink); background: var(--ok-bg); }
.actions { white-space: nowrap; text-align: right; }
.iconbtn {
  display: inline-block; padding: 7px 12px; margin-left: 6px;
  font-size: 13px; font-weight: 600; text-decoration: none;
  color: var(--primary-dark); background: #EFEAFF; border: 0; border-radius: 9px; cursor: pointer;
}
.iconbtn:hover { background: #E2D8FF; }
.iconbtn.danger { color: #B4233C; background: var(--error-bg); }
.iconbtn.danger:hover { background: #FADCE1; }

/* ---------- token exibido uma vez ---------- */
.tokenbox {
  margin: 18px 0 0; padding: 18px;
  background: var(--primary-deep); color: #fff; border-radius: 14px;
}
.tokenbox p { margin: 0 0 10px; font-size: 13px; color: #CFC8F5; }
.tokenrow { display: flex; gap: 10px; align-items: stretch; }
.tokenrow code {
  flex: 1; overflow-x: auto; padding: 12px 14px;
  font-size: 13px; word-break: break-all;
  background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(255, 255, 255, .2); border-radius: 10px;
}
.copybtn {
  flex: 0 0 auto; padding: 0 18px; margin: 0;
  font-size: 14px; font-weight: 700; color: var(--primary-deep);
  background: var(--accent); border: 0; border-radius: 10px; cursor: pointer;
}
.copybtn:hover { filter: brightness(1.05); }

@media (max-width: 640px) {
  .card { padding: 24px 18px; }
  .card.narrow { padding: 32px 24px 24px; }
  .page-head { flex-direction: column; align-items: stretch; }
  .tokenrow { flex-direction: column; }
  .copybtn { padding: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .btn, .iconbtn, input { transition: none; }
}
