:root {
  --bg-color: #0a0a0a;
  --text-color: #e8e8e8;
  --accent-color: #e25710;
  --accent-hover: #c44a0e;
  --input-bg: #141414;
  --border-color: #2a2a2a;
  --card-bg: #111111;
}

* {
  box-sizing: border-box;
}

body {
  --mx: 50%;
  --my: 12%;
  background: var(--bg-color);
  color: var(--text-color);
  font-family: "Segoe UI", Arial, sans-serif;
  margin: 0;
  padding: 2rem 1.25rem 3rem;
  text-align: center;
  min-height: 100vh;
  position: relative;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(520px circle at var(--mx) var(--my), rgba(226, 87, 16, 0.32) 0%, rgba(226, 87, 16, 0.08) 38%, transparent 68%),
    radial-gradient(ellipse at 50% 0%, rgba(226, 87, 16, 0.12) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

@media (prefers-reduced-motion: reduce) {
  body::before {
    background: radial-gradient(ellipse at 50% 0%, rgba(226, 87, 16, 0.18) 0%, transparent 70%);
  }
}

.page {
  position: relative;
  z-index: 1;
  max-width: 640px;
  margin: 0 auto;
}

.logo-section {
  text-align: center;
  margin-bottom: 1.75rem;
}

.logo {
  max-width: 180px;
  height: auto;
}

.logo-by {
  margin: 0.35rem 0 0;
  font-size: 0.8rem;
  color: #888;
}

.logo-by a {
  color: var(--accent-color);
  text-decoration: none;
}

.logo-by a:hover {
  text-decoration: underline;
}

.header-actions {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.45rem;
  margin: 0.9rem 0 1.15rem;
  flex-wrap: wrap;
}

.lang-switcher {
  display: flex;
  gap: 0.4rem;
  margin: 0;
}

.lang-btn,
.install-app {
  padding: 0.35rem 0.85rem;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.2;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  box-shadow: none;
}

.lang-btn {
  border: 1px solid var(--border-color);
  background: #1a1a1a;
  color: var(--text-color);
}

.lang-btn:hover,
.lang-btn[aria-current="page"],
.lang-btn[aria-current="true"] {
  background: var(--accent-color);
  border-color: var(--accent-color);
  color: #fff;
}

.install-app {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: var(--accent-color);
  border: 1px solid #e25710;
}

.install-app:hover:not(:disabled) {
  background: transparent;
  color: #fff;
  border-color: #e25710;
  transform: none;
  box-shadow: none;
}

h1 {
  font-size: 2.35rem;
  font-weight: 800;
  color: #fff;
  margin: 0.35rem 0 0.45rem;
  letter-spacing: -0.02em;
}

h1 span {
  color: var(--accent-color);
}

.subtitle {
  font-size: 0.95rem;
  color: #9a9a9a;
  margin: 0 0 0.45rem;
}

.tagline {
  font-size: 0.85rem;
  color: #888;
  margin: 0;
  line-height: 1.45;
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 1.5rem;
  text-align: center;
}

.preset-btns {
  display: flex;
  justify-content: center;
  gap: 0.45rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.preset-btns button {
  background: #1a1a1a;
  border: 1px solid var(--border-color);
  padding: 0.5rem 0.95rem;
  border-radius: 8px;
  color: var(--text-color);
  box-shadow: none;
  min-width: 0;
  font-size: 0.9rem;
}

.preset-btns button:hover {
  background: var(--accent-color);
  border-color: var(--accent-color);
  color: #fff;
  transform: none;
  box-shadow: none;
}

.preset-btns button.active {
  background: var(--accent-color);
  border-color: var(--accent-color);
  color: #fff;
  box-shadow: none;
}

input,
select,
textarea {
  width: 100%;
  padding: 0.85rem 1rem;
  margin: 0;
  background: #0e0e0e;
  border: 1px solid var(--border-color);
  color: var(--text-color);
  border-radius: 10px;
  font-size: 1rem;
  font-family: inherit;
  box-shadow: none;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent-color);
  box-shadow: none;
}

input::placeholder,
textarea::placeholder {
  color: #666;
}

select {
  cursor: pointer;
}

textarea {
  min-height: 88px;
  resize: vertical;
}

.panel {
  display: none;
  width: 100%;
  margin: 0 auto 1rem;
}

.panel.active {
  display: block;
}

.fields {
  display: grid;
  gap: 0.7rem;
  text-align: left;
}

.fields label {
  display: block;
  font-size: 0.85rem;
  color: #aaa;
  margin-bottom: 0.3rem;
}

.check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #aaa;
  font-size: 0.9rem;
}

.check input {
  width: auto;
  margin: 0;
}

.help-text {
  display: none;
  color: #888;
}

.help-text.show {
  display: inline;
}

.color-row {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin: 1rem 0;
  flex-wrap: wrap;
}

.color-field {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: #aaa;
}

.color-field input[type="color"] {
  width: 44px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--border-color);
  background: none;
  cursor: pointer;
  box-shadow: none;
}

.action-btns {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.75rem;
  margin: 1.25rem 0 0;
  flex-wrap: wrap;
  width: 100%;
}

button {
  padding: 0.85rem 1.5rem;
  cursor: pointer;
  background: var(--accent-color);
  border: none;
  color: #fff;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 600;
  font-family: inherit;
  box-shadow: none;
}

#generate-btn {
  width: 100%;
}

button:hover:not(:disabled) {
  background: var(--accent-hover);
  box-shadow: none;
  transform: none;
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

button.secondary {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-color);
}

button.secondary:hover:not(:disabled) {
  background: #1a1a1a;
  color: #fff;
}

#error {
  display: none;
  color: #ffb4a2;
  background: rgba(226, 87, 16, 0.12);
  border: 1px solid var(--accent-color);
  border-radius: 8px;
  padding: 0.6rem 1rem;
  margin: 0.75rem auto 0;
}

#error.show {
  display: block;
}

#status {
  display: none;
  color: #c8f0c8;
  margin: 0.5rem 0 0;
}

#status.show {
  display: block;
}

#qr-output {
  margin-top: 1.25rem;
  padding: 1.25rem;
  background: #fff;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  min-height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
}

#qr-output:empty {
  background: #0e0e0e;
}

#qr-output svg {
  max-width: 100%;
  height: auto;
}

#qr-actions {
  display: none;
  margin: 1.25rem 0 0;
}

#qr-actions.show {
  display: block;
}

footer {
  margin-top: 2rem;
  font-size: 0.85rem;
  color: #888;
}

.brand-link,
footer a {
  color: var(--accent-color);
  text-decoration: none;
}

.brand-link:hover,
footer a:hover {
  text-decoration: underline;
}

.footer-links {
  margin-top: 0.75rem;
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

small {
  display: block;
  margin-top: 0.5rem;
  color: #666;
}

p {
  color: #aaa;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

body.legal {
  text-align: left;
}

body.legal .logo-section,
body.legal .card {
  max-width: 760px;
  margin-left: auto;
  margin-right: auto;
}

body.legal h1 {
  text-align: center;
}

.legal-content h2 {
  color: var(--accent-color);
  font-size: 1.2rem;
  margin-top: 1.8rem;
}

.legal-content p,
.legal-content li {
  color: #ccc;
  line-height: 1.65;
}

.legal-content ul {
  padding-left: 1.2rem;
}

.notfound h1 {
  font-size: 3rem;
  color: #fff;
}

.notfound h1 span {
  color: var(--accent-color);
}

@media (max-width: 600px) {
  body {
    padding: 1.25rem 0.9rem 2rem;
  }

  h1 {
    font-size: 1.85rem;
  }

  .card {
    padding: 1.15rem;
  }

  .preset-btns button {
    padding: 0.45rem 0.7rem;
    font-size: 0.85rem;
  }

  .action-btns {
    flex-direction: column;
    align-items: stretch;
  }

  .action-btns button {
    width: 100%;
  }
}

.donate {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 14px;
  align-items: center;
  margin: 0 0 1.25rem;
  padding: 12px 14px;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  text-align: left;
}

.donate h2 {
  margin: 0;
  font-size: 14px;
  font-weight: 650;
  color: #fff;
}

.donate #donateLead {
  margin: 2px 0 0;
  font-size: 12px;
  color: #9a9a9a;
}

.donate-track {
  grid-column: 1 / -1;
}

.donate-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 6px;
  color: #9a9a9a;
  font-size: 12px;
}

.donate-meta #donatePct {
  color: var(--accent-color);
  font-weight: 650;
}

.donate-btn {
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 7px 14px;
  border-radius: 999px;
  cursor: pointer;
  color: var(--accent-color);
  background: transparent;
  border: 1px solid #e2571088;
  box-shadow: none;
}

.donate-btn:hover:not(:disabled) {
  background: #e2571014;
  border-color: var(--accent-color);
  color: var(--accent-color);
  transform: none;
  box-shadow: none;
}

.bar {
  height: 6px;
  background: #2a2724;
  border-radius: 99px;
  overflow: hidden;
}

.bar i {
  display: block;
  height: 100%;
  width: 0;
  background: var(--accent-color);
  transition: width 0.3s;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal[hidden] {
  display: none;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: #000000b8;
}

.modal-card {
  position: relative;
  width: min(440px, 100%);
  max-height: 90vh;
  overflow: auto;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 22px 22px 20px;
  text-align: left;
}

.modal-card h2 {
  margin: 0 28px 8px 0;
  font-size: 18px;
  font-weight: 650;
  color: #fff;
}

.modal-x {
  position: absolute;
  top: 12px;
  right: 12px;
  background: none;
  border: 0;
  color: #888;
  font: inherit;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  padding: 4px 8px;
  box-shadow: none;
}

.modal-x:hover:not(:disabled) {
  background: none;
  color: #fff;
  transform: none;
}

.presets {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 16px;
}

.presets button {
  font: inherit;
  padding: 12px 8px;
  border-radius: 12px;
  cursor: pointer;
  background: #0f0f10;
  color: var(--text-color);
  border: 1px solid var(--border-color);
  box-shadow: none;
}

.presets button.on,
.presets button:hover:not(:disabled) {
  border-color: var(--accent-color);
  background: #e2571014;
  color: var(--text-color);
  transform: none;
  box-shadow: none;
}

.modal-card input[type="number"] {
  font: inherit;
  border-radius: 12px;
  background: #0f0f10;
  color: var(--text-color);
  border: 1px solid var(--border-color);
  padding: 12px;
  outline: none;
}

.coin-label {
  color: #9a9a9a;
  font-size: 13px;
  margin: 16px 0 8px;
}

.coins {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  max-height: 196px;
  overflow: auto;
}

.coins button {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font: inherit;
  font-size: 11px;
  padding: 10px 6px;
  border-radius: 12px;
  cursor: pointer;
  background: #0f0f10;
  color: var(--text-color);
  border: 1px solid var(--border-color);
  box-shadow: none;
}

.coins button.on,
.coins button:hover:not(:disabled) {
  border-color: var(--accent-color);
  background: #e2571014;
  color: var(--text-color);
  transform: none;
  box-shadow: none;
}

.coins img {
  width: 26px;
  height: 26px;
}
.coins button.pix span {
  font-size: 10px;
  font-weight: 700;
  text-align: center;
  line-height: 1.2;
}

.donate-close {
  display: block;
  width: 100%;
  margin-top: 10px;
  padding: 11px 16px;
  font: inherit;
  cursor: pointer;
  border-radius: 12px;
  background: transparent;
  color: #888;
  border: 1px solid var(--border-color);
  box-shadow: none;
}

.donate-close:hover:not(:disabled) {
  color: #fff;
  border-color: #fff;
  background: transparent;
  transform: none;
  box-shadow: none;
}

.donate-pay-head {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 4px 0 14px;
  font-weight: 700;
  color: #fff;
}

#donateTimer {
  font: 13px/1 ui-monospace, monospace;
  color: #ff9800;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 8px;
  background: #ff98001f;
  border: 1px solid #ff98004d;
}

.donate-qr-wrap {
  width: 188px;
  height: 188px;
  margin: 0 auto 14px;
  padding: 10px;
  background: #fff;
  border-radius: 12px;
}

#donateQr {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.donate-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0 0 10px;
}

.donate-field > span {
  color: #9a9a9a;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.donate-copy-row {
  display: flex;
  overflow: hidden;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  background: #0f0f10;
}

.donate-copy-row input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--text-color);
  font: 13px/1.3 ui-monospace, monospace;
  padding: 10px;
  outline: none;
  border-radius: 0;
}

.donate-copy-row button {
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  padding: 10px 12px;
  color: var(--accent-color);
  background: #ffffff0d;
  border: 0;
  border-left: 1px solid var(--border-color);
  border-radius: 0;
  box-shadow: none;
}

.donate-copy-row button:hover:not(:disabled) {
  background: #ffffff14;
  color: var(--accent-color);
  transform: none;
  box-shadow: none;
}

.donate-actions {
  display: flex;
  gap: 8px;
  margin-top: 6px;
}

.donate-actions .donate-close {
  width: auto;
  flex: 1;
  margin-top: 0;
}

.donate-wait {
  flex: 1.4;
  padding: 11px 12px;
  border-radius: 12px;
  font: inherit;
  font-weight: 700;
  color: #26a17b;
  background: #26a17b22;
  border: 1px solid #26a17b55;
  cursor: default;
  box-shadow: none;
}

.donate-wait.ok {
  color: #fff;
  background: #26a17b;
  border-color: #26a17b;
}

.donate-wait.bad {
  color: #ff6b5a;
  background: #ff6b5a22;
  border-color: #ff6b5a55;
}

.donate-err {
  color: #ffb4a2;
  font-size: 13px;
  margin: 10px 0 0;
}

.donate-err[hidden] {
  display: none;
}

#donatePay.go {
  width: 100%;
  margin-top: 12px;
}

.hint {
  color: #9a9a9a;
  font-size: 13px;
}

@media (max-width: 520px) {
  .donate {
    grid-template-columns: 1fr;
  }

  .donate-btn {
    justify-self: start;
  }
}
