:root {
  color-scheme: dark;
  --bg: #0a0a0a;
  --bg-soft: #111111;
  --card: rgba(18, 18, 18, 0.92);
  --card-2: rgba(24, 24, 24, 0.95);
  --text: #f6f2e9;
  --muted: #c6bb9c;
  --line: rgba(255, 255, 255, 0.09);
  --gold: #d4af37;
  --gold-strong: #b89022;
  --gold-soft: rgba(212, 175, 55, 0.08);
  --white: #ffffff;
  --danger: #d84d4d;
  --ok: #5fb97b;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.38);
  --radius-lg: 28px;
  --radius-md: 20px;
  --radius-sm: 14px;
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #f8f6f1;
  --bg-soft: #f1ece1;
  --card: rgba(255, 255, 255, 0.94);
  --card-2: rgba(252, 249, 242, 0.98);
  --text: #1c1710;
  --muted: #6f6041;
  --line: rgba(184, 144, 34, 0.16);
  --gold: #b89022;
  --gold-strong: #8d6a14;
  --gold-soft: rgba(184, 144, 34, 0.1);
  --white: #ffffff;
  --danger: #c53e3e;
  --ok: #2f855a;
  --shadow: 0 24px 70px rgba(28, 23, 16, 0.12);
}

@media (prefers-color-scheme: light) {
  html[data-theme="system"] {
    color-scheme: light;
    --bg: #f8f6f1;
    --bg-soft: #f1ece1;
    --card: rgba(255, 255, 255, 0.94);
    --card-2: rgba(252, 249, 242, 0.98);
    --text: #1c1710;
    --muted: #6f6041;
    --line: rgba(184, 144, 34, 0.16);
    --gold: #b89022;
    --gold-strong: #8d6a14;
    --gold-soft: rgba(184, 144, 34, 0.1);
    --white: #ffffff;
    --danger: #c53e3e;
    --ok: #2f855a;
    --shadow: 0 24px 70px rgba(28, 23, 16, 0.12);
  }
}

html[data-theme="dark"],
html[data-theme="system"] {
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.035), transparent 28rem),
    radial-gradient(circle at bottom right, rgba(212, 175, 55, 0.035), transparent 26rem),
    var(--bg);
  color: var(--text);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

.page-glow {
  position: fixed;
  z-index: -1;
  width: 18rem;
  height: 18rem;
  border-radius: 999px;
  filter: blur(58px);
  opacity: 0.28;
}

.glow-a {
  top: 2rem;
  left: -6rem;
  background: rgba(255, 255, 255, 0.08);
}

.glow-b {
  right: -7rem;
  bottom: 4rem;
  background: rgba(212, 175, 55, 0.18);
}

.topbar,
.app-shell {
  width: min(1080px, calc(100% - 32px));
  margin-inline: auto;
}

.topbar {
  min-height: 92px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: var(--card-2);
  color: var(--text);
  border: 1px solid rgba(212, 175, 55, 0.34);
  font-weight: 900;
  letter-spacing: -0.04em;
  box-shadow: 0 12px 30px rgba(212, 175, 55, 0.25);
}

.brand-copy strong,
.brand-copy small {
  display: block;
}

.brand-copy strong {
  font-size: 1.02rem;
}

.brand-copy small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.9rem;
}

.theme-dropdown {
  position: relative;
}

.theme-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 150px;
  display: grid;
  gap: 6px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--card-2);
  box-shadow: var(--shadow);
}

.theme-menu button {
  border: 0;
  border-radius: 12px;
  padding: 10px 12px;
  text-align: left;
  background: transparent;
  color: var(--text);
  cursor: pointer;
}

.theme-menu button:hover,
.theme-menu button.active {
  background: var(--gold-soft);
  color: var(--gold);
}

.app-shell {
  padding: 14px 0 30px;
}

.shell-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--card);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
  padding: 22px;
}

.status-panel {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  padding: 12px 15px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card-2);
  color: var(--muted);
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--ok);
  box-shadow: 0 0 0 7px rgba(95, 185, 123, 0.12);
}

.status-dot.wait {
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 7px rgba(212, 175, 55, 0.12);
}

.status-dot.danger {
  background: var(--danger);
  box-shadow: 0 0 0 7px rgba(216, 77, 77, 0.12);
}

.route-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.route-head h1,
.route-head h2 {
  margin: 0;
  letter-spacing: -0.04em;
}

.icon-control {
  width: 46px;
  height: 46px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card-2);
  color: var(--text);
  cursor: pointer;
  transition: transform .18s ease, border-color .18s ease, background .18s ease;
}

.icon-control:hover {
  transform: translateY(-1px);
  border-color: rgba(212, 175, 55, 0.34);
  background: var(--gold-soft);
}

.hero-layout,
.info-grid,
.choice-grid {
  display: grid;
  gap: 16px;
}

.hero-layout {
  grid-template-columns: 1.2fr .8fr;
  align-items: stretch;
}

.hero-card,
.info-card,
.choice-card,
.panel-card {
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--card-2);
}

.hero-card {
  padding: clamp(24px, 4vw, 38px);
}

.hero-card h1 {
  margin: 0;
  font-size: clamp(2.1rem, 5vw, 4rem);
  line-height: 0.98;
  letter-spacing: -0.07em;
}

.hero-card p {
  margin: 16px 0 0;
  color: var(--muted);
  line-height: 1.75;
  font-size: 1.03rem;
}

.hero-side {
  display: grid;
  gap: 16px;
}

.info-card {
  padding: 20px;
}

.info-card h3 {
  margin: 0 0 10px;
  letter-spacing: -0.03em;
}

.info-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.primary-btn {
  border: 0;
  border-radius: 16px;
  padding: 14px 18px;
  background: var(--card-2);
  color: var(--text);
  border: 1px solid rgba(212, 175, 55, 0.34);
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 14px 28px rgba(212, 175, 55, 0.2);
}

.secondary-btn {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px 16px;
  background: var(--card-2);
  color: var(--text);
  font-weight: 700;
  cursor: pointer;
}

.cta-row {
  margin-top: 22px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.info-grid {
  margin-top: 16px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.choice-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.choice-card {
  padding: 18px;
  cursor: pointer;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.choice-card:hover {
  transform: translateY(-2px);
}

.choice-card.active {
  border-color: rgba(212, 175, 55, 0.42);
  box-shadow: 0 12px 28px rgba(212, 175, 55, 0.12);
}

.choice-card .choice-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: var(--card-2);
  color: var(--text);
  border: 1px solid rgba(212, 175, 55, 0.24);
  font-weight: 900;
  margin-bottom: 10px;
}

.choice-card strong,
.choice-card small {
  display: block;
}

.choice-card small {
  margin-top: 6px;
  color: var(--muted);
  line-height: 1.6;
}

.panel-card {
  padding: 20px;
}

.panel-card h3 {
  margin: 0 0 8px;
}

.panel-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.form-block {
  margin-top: 16px;
  display: grid;
  gap: 8px;
}

.form-block label {
  font-weight: 700;
}

.text-input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 15px 16px;
  background: var(--bg-soft);
  color: var(--text);
  outline: none;
}

.text-input:focus {
  border-color: rgba(212, 175, 55, 0.44);
}

.connect-box,
.download-box {
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--card-2);
  padding: 22px;
}

.connect-box p,
.download-box p,
.helper-text {
  color: var(--muted);
  line-height: 1.7;
}

.qr-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 20px;
  align-items: center;
}

.qr-image {
  width: 260px;
  max-width: 100%;
  padding: 10px;
  border-radius: 22px;
  background: white;
}

.code-chip {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 15px 18px;
  border-radius: 18px;
  background: var(--bg-soft);
  color: var(--text);
  border: 1px solid rgba(212, 175, 55, 0.28);
  font-size: clamp(1.6rem, 6vw, 3rem);
  font-weight: 950;
  letter-spacing: 0.08em;
}

.countdown-chip {
  width: fit-content;
  display: inline-flex;
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg-soft);
  color: var(--text);
  font-weight: 700;
}

.spacer-top {
  margin-top: 18px;
}

.download-link {
  display: inline-flex;
  width: fit-content;
}

.empty-state {
  padding: 16px 0 4px;
}

@media (max-width: 820px) {
  .hero-layout,
  .choice-grid,
  .info-grid,
  .qr-layout {
    grid-template-columns: 1fr;
  }

  .brand-copy small {
    max-width: 230px;
    line-height: 1.45;
  }
}

@media (max-width: 620px) {
  .topbar,
  .app-shell {
    width: min(100%, calc(100% - 20px));
  }

  .shell-card {
    padding: 16px;
  }

  .route-head {
    align-items: flex-start;
  }

  .brand {
    align-items: flex-start;
  }

  .brand-mark {
    width: 48px;
    height: 48px;
  }

  .status-panel {
    width: 100%;
  }
}


.icon-svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.theme-dropdown {
  z-index: 80;
}

.theme-menu {
  z-index: 9999;
}

.brand-mark {
  border: 1px solid rgba(212, 175, 55, 0.38);
}

.primary-btn:hover,
.choice-card:hover,
.icon-control:hover {
  border-color: rgba(212, 175, 55, 0.48);
}

.uptime-card strong {
  font-size: 1.35rem;
  letter-spacing: -0.04em;
}

/* refinamento: logo textual */
.brand-text-logo {
  padding: 10px 0;
}

.brand-text-logo .brand-copy strong {
  font-size: clamp(1.35rem, 4vw, 2.2rem);
  letter-spacing: -0.07em;
  line-height: 0.95;
}

.brand-text-logo .brand-copy small {
  max-width: 420px;
}

/* remove qualquer espaço/visual antigo do pseudo-logo NC */
.brand-mark {
  display: none !important;
}

/* correção real do menu de tema */
.theme-dropdown {
  position: relative;
  z-index: 10000;
}

.theme-menu {
  z-index: 10001;
}

.theme-menu[hidden] {
  display: none !important;
}

/* dourado apenas como detalhe no tema escuro */
html[data-theme="dark"] .primary-btn,
html[data-theme="system"] .primary-btn {
  background: var(--card-2);
  color: var(--text);
  border: 1px solid rgba(212, 175, 55, 0.34);
  box-shadow: none;
}

html[data-theme="dark"] .choice-icon,
html[data-theme="system"] .choice-icon,
html[data-theme="dark"] .code-chip,
html[data-theme="system"] .code-chip {
  background: var(--bg-soft);
  color: var(--text);
  border: 1px solid rgba(212, 175, 55, 0.28);
}

html[data-theme="dark"] .status-dot.wait,
html[data-theme="system"] .status-dot.wait {
  background: rgba(255, 255, 255, 0.45);
  box-shadow: 0 0 0 7px rgba(255, 255, 255, 0.08);
}

.uptime-card strong {
  display: block;
  margin: 8px 0;
  font-size: clamp(1.25rem, 4vw, 2rem);
  line-height: 1.15;
  letter-spacing: -0.05em;
  color: var(--text);
}
