/* SuperPC — sistema de design
   Página clara e calma; as "telas" (painéis do produto) são escuras como um monitor.
   Display: Unbounded · Texto: Manrope · Telemetria: JetBrains Mono */

:root {
  --paper: #F4F6FB;
  --paper-2: #FFFFFF;
  --ink: #0B1020;
  --ink-2: #1B2340;
  --slate: #5B6480;
  --line: #DDE2EE;
  --ultra: #2B3CFF;
  --ultra-deep: #1F2CCB;
  --ultra-soft: #E7E9FF;
  --ember: #FF6A3D;
  --ember-soft: #FFE6DC;
  --signal: #17E68C;
  --amber: #FFC247;
  --danger: #FF4D6D;
  --screen: #0F1530;
  --screen-2: #161D3F;
  --screen-line: rgba(255,255,255,.08);
  --screen-text: #E8ECFF;
  --screen-muted: #8B93B8;

  --font-display: "Unbounded", "Manrope", system-ui, sans-serif;
  --font-body: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 20px 60px -30px rgba(11,16,32,.35);
  --max: 1160px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; cursor: pointer; }
input, select, textarea { font: inherit; }
:focus-visible { outline: 3px solid var(--ultra); outline-offset: 3px; border-radius: 6px; }
[hidden] { display: none !important; }

.wrap { width: min(var(--max), calc(100% - 40px)); margin-inline: auto; }
@media (max-width: 600px) { .wrap { width: calc(100% - 32px); } }

/* ---------- tipografia ---------- */
h1, h2, h3, .display { font-family: var(--font-display); letter-spacing: -0.01em; line-height: 1.08; margin: 0; }
h1 { font-size: clamp(2.1rem, 5.2vw, 4.2rem); font-weight: 800; }
h2 { font-size: clamp(1.6rem, 3.2vw, 2.5rem); font-weight: 700; }
h3 { font-size: 1.15rem; font-weight: 700; }
p { margin: 0; }
.lead { font-size: clamp(1.05rem, 1.6vw, 1.25rem); color: var(--slate); max-width: 40ch; }
.eyebrow {
  font-family: var(--font-mono); font-size: .75rem; letter-spacing: .12em; text-transform: uppercase;
  color: var(--ultra); font-weight: 600;
}
.mono { font-family: var(--font-mono); }
.muted { color: var(--slate); }
.small { font-size: .875rem; }

/* ---------- botões ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 14px 22px; border-radius: 14px; border: 1.5px solid transparent;
  font-weight: 700; text-decoration: none; transition: transform .15s ease, background .2s ease, box-shadow .2s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--ultra); color: #fff; box-shadow: 0 10px 30px -12px rgba(43,60,255,.6); }
.btn-primary:hover { background: var(--ultra-deep); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--ink); }
.btn-ember { background: var(--ember); color: #fff; box-shadow: 0 10px 30px -12px rgba(255,106,61,.7); }
.btn-ember:hover { filter: brightness(1.05); }
.btn-dark { background: var(--ink); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-sm { padding: 9px 14px; border-radius: 10px; font-size: .875rem; }
.btn-lg { padding: 18px 28px; font-size: 1.05rem; border-radius: 16px; }
.btn-block { width: 100%; }

/* ---------- cards e telas ---------- */
.card {
  background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 28px; box-shadow: var(--shadow);
}
.screen {
  background: radial-gradient(120% 120% at 100% 0%, #1B2450 0%, var(--screen) 55%);
  color: var(--screen-text); border-radius: var(--radius); border: 1px solid var(--screen-line);
  padding: 28px; position: relative; overflow: hidden;
}
.screen .muted { color: var(--screen-muted); }
.screen::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(255,255,255,.018) 0 1px, transparent 1px 3px);
  mix-blend-mode: overlay;
}

/* ---------- pill de status ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px;
  font-family: var(--font-mono); font-size: .75rem; letter-spacing: .06em; text-transform: uppercase;
  border: 1px solid var(--screen-line); background: rgba(255,255,255,.04);
}
.pill::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.pill.off { color: var(--screen-muted); }
.pill.starting { color: var(--amber); }
.pill.starting::before { animation: blink 1s ease-in-out infinite; }
.pill.ready { color: var(--signal); }
.pill.ready::before { box-shadow: 0 0 0 4px rgba(23,230,140,.18); }
.pill.stopping { color: var(--amber); }
.pill.error { color: var(--danger); }
.pill.light { border-color: var(--line); background: var(--paper); }
.pill.light.off { color: var(--slate); }
.pill.light.ready { color: #0A9B5B; }
.pill.light.starting { color: #B27500; }
.pill.light.error { color: var(--danger); }
.pill.light.pending { color: #B27500; }
.pill.light.active { color: #0A9B5B; }
.pill.light.cancelled, .pill.light.past_due { color: var(--danger); }

@keyframes blink { 0%,100% { opacity: 1 } 50% { opacity: .25 } }

/* ---------- O ANEL DE ENERGIA (assinatura visual) ---------- */
.ring {
  --size: 220px; --p: 0; --ring-color: var(--screen-muted);
  width: var(--size); height: var(--size); position: relative; margin-inline: auto;
  display: grid; place-items: center; border-radius: 50%;
  background:
    conic-gradient(var(--ring-color) calc(var(--p) * 1%), rgba(255,255,255,.07) 0);
  transition: --p .6s ease;
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 10px), #000 calc(100% - 9px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 10px), #000 calc(100% - 9px));
}
.ring-wrap { position: relative; width: var(--size, 220px); height: var(--size, 220px); margin-inline: auto; }
.ring-wrap .ring { position: absolute; inset: 0; }
.ring-wrap.starting .ring { --ring-color: var(--amber); animation: spin 1.6s linear infinite; --p: 30; }
.ring-wrap.ready .ring { --ring-color: var(--signal); --p: 100; animation: none; }
.ring-wrap.stopping .ring { --ring-color: var(--amber); --p: 100; animation: spin 1.6s linear infinite reverse; }
.ring-wrap.error .ring { --ring-color: var(--danger); --p: 100; }
.ring-wrap.ready::after {
  content: ""; position: absolute; inset: -18px; border-radius: 50%;
  background: radial-gradient(circle, rgba(23,230,140,.28), transparent 70%); z-index: -1;
  animation: breathe 3s ease-in-out infinite;
}
@keyframes spin { to { transform: rotate(360deg) } }
@keyframes breathe { 0%,100% { opacity: .6; transform: scale(1) } 50% { opacity: 1; transform: scale(1.06) } }

.power {
  position: absolute; inset: 18px; border-radius: 50%; border: none;
  background: var(--screen-2); color: var(--screen-text);
  display: grid; place-items: center; gap: 6px; align-content: center;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 20px 40px -20px rgba(0,0,0,.8);
  transition: background .25s ease, transform .15s ease;
}
.power:hover { transform: scale(1.02); }
.power:disabled { cursor: progress; }
.power .icon { width: 44px; height: 44px; }
.power .label { font-family: var(--font-display); font-weight: 800; font-size: .9rem; letter-spacing: .04em; }
.power .sub { font-family: var(--font-mono); font-size: .7rem; color: var(--screen-muted); letter-spacing: .08em; }
.ring-wrap.off .power { background: linear-gradient(180deg, #FF7A50, var(--ember)); color: #fff; }
.ring-wrap.off .power .sub { color: rgba(255,255,255,.75); }
.ring-wrap.ready .power { background: var(--screen-2); }
.ring-wrap.ready .power .icon { color: var(--signal); }
.ring-wrap.starting .power .icon, .ring-wrap.stopping .power .icon { color: var(--amber); }

/* ---------- telemetria ---------- */
.telemetry { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.tele {
  border: 1px solid var(--screen-line); border-radius: 12px; padding: 12px 14px;
  background: rgba(255,255,255,.03);
}
.tele .k { font-family: var(--font-mono); font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; color: var(--screen-muted); }
.tele .v { font-family: var(--font-mono); font-size: 1.35rem; font-weight: 600; margin-top: 4px; }
.tele .v small { font-size: .75rem; color: var(--screen-muted); font-weight: 500; }
@media (max-width: 480px) { .telemetry { grid-template-columns: repeat(2, 1fr); } }

/* ---------- formulários ---------- */
.field { display: grid; gap: 6px; }
.field label { font-size: .85rem; font-weight: 600; color: var(--ink-2); }
.input {
  width: 100%; padding: 13px 14px; border-radius: 12px; border: 1.5px solid var(--line); background: #fff;
  color: var(--ink); transition: border-color .15s ease;
}
.input:focus { border-color: var(--ultra); outline: none; }
.screen .input { background: rgba(255,255,255,.05); border-color: var(--screen-line); color: var(--screen-text); }
.form-grid { display: grid; gap: 14px; }
.error-box { background: #FFF0F3; color: #B3123A; border: 1px solid #FFD0DB; padding: 12px 14px; border-radius: 12px; font-size: .9rem; }
.ok-box { background: #EAFBF2; color: #0A6B3F; border: 1px solid #BFF0D6; padding: 12px 14px; border-radius: 12px; font-size: .9rem; }
.note-box { background: var(--ultra-soft); color: var(--ultra-deep); border: 1px solid #CDD2FF; padding: 12px 14px; border-radius: 12px; font-size: .9rem; }

/* ---------- modal ---------- */
.modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; background: rgba(11,16,32,.55); backdrop-filter: blur(6px); }
.modal-card { width: min(560px, 100%); max-height: calc(100vh - 40px); overflow: auto; }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.x { background: transparent; border: none; color: inherit; font-size: 1.4rem; line-height: 1; padding: 4px 8px; border-radius: 8px; opacity: .7; }
.x:hover { opacity: 1; }

/* ---------- tabelas ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { text-align: left; padding: 12px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; white-space: nowrap; }
th { font-family: var(--font-mono); font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; color: var(--slate); font-weight: 600; }

/* ---------- nav e rodapé ---------- */
.nav { display: flex; align-items: center; justify-content: space-between; padding: 22px 0; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--font-display); font-weight: 800; font-size: 1.1rem; letter-spacing: -.02em; }
.brand .dot { width: 12px; height: 12px; border-radius: 50%; background: var(--ember); box-shadow: 0 0 0 4px var(--ember-soft); }
.nav-links { display: flex; gap: 22px; align-items: center; font-weight: 600; font-size: .95rem; }
.nav-links a { text-decoration: none; color: var(--ink-2); }
.nav-links a:hover { color: var(--ultra); }
@media (max-width: 760px) { .nav-links .hide-m { display: none; } }
footer { padding: 40px 0 60px; color: var(--slate); font-size: .9rem; border-top: 1px solid var(--line); margin-top: 80px; }
footer .wrap { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
