/* LegendaEtraduz — design tokens */
:root {
  --bg-deep: #070a12;
  --bg-elevated: rgba(18, 22, 36, 0.72);
  --bg-card: rgba(22, 27, 44, 0.85);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --accent: #38bdf8;
  --accent-dim: rgba(56, 189, 248, 0.15);
  --accent-hover: #0ea5e9;
  --success: #34d399;
  --danger: #f87171;
  --vip: #fbbf24;
  --vip-bg: rgba(251, 191, 36, 0.12);
  --input-elevated: rgba(36, 44, 68, 0.95);
  --input-elevated-focus: rgba(44, 54, 82, 0.98);
  --gold-glow: 0 0 0 1px rgba(234, 179, 8, 0.35), 0 0 24px rgba(250, 204, 21, 0.12);
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --shadow-lg: 0 24px 48px -12px rgba(0, 0, 0, 0.55);
  --shadow-glow: 0 0 0 1px rgba(56, 189, 248, 0.2);
  --font: "Inter", system-ui, -apple-system, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font);
  background-color: var(--bg-deep);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 24px 20px 64px;
  background-image:
    radial-gradient(ellipse 120% 80% at 50% -20%, rgba(56, 189, 248, 0.18), transparent 50%),
    radial-gradient(ellipse 80% 50% at 100% 50%, rgba(139, 92, 246, 0.08), transparent 45%),
    radial-gradient(ellipse 60% 40% at 0% 80%, rgba(52, 211, 153, 0.06), transparent 40%);
}

body.page-home {
  padding-top: 96px;
}

/* Fixed top navbar */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(7, 10, 18, 0.82);
  border-bottom: 1px solid var(--border-subtle);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 16px;
  max-width: 1100px;
  margin: 0 auto;
  padding: 12px 20px;
}

.site-nav__brand {
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  text-decoration: none;
  background: linear-gradient(135deg, #f8fafc 0%, #94a3b8 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  flex-shrink: 0;
}

.site-nav__brand:hover {
  filter: brightness(1.08);
}

.site-nav__account {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  flex: 1 1 200px;
  min-width: 0;
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.45;
  text-align: left;
}

.site-nav__greeting {
  display: block;
}

.site-nav__balance {
  color: var(--success);
  font-weight: 600;
}

.site-nav__balance--vip {
  color: var(--vip);
}

.site-nav__ref {
  display: block;
  font-size: 11px;
  color: var(--accent);
  user-select: all;
  word-break: break-all;
  max-width: 100%;
}

.site-nav__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px 10px;
  margin-left: auto;
}

.site-nav__lang {
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-size: 12px;
  cursor: pointer;
  outline: none;
  backdrop-filter: blur(12px);
  transition: border-color 0.2s, box-shadow 0.2s;
  font-family: inherit;
}

.site-nav__lang:hover,
.site-nav__lang:focus {
  border-color: var(--accent);
  box-shadow: var(--shadow-glow);
}

.site-nav__lang:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.site-nav__link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 6px;
  transition: background 0.2s, color 0.2s;
  white-space: nowrap;
}

.site-nav__link:hover {
  background: var(--accent-dim);
}

.site-nav__link--danger {
  color: var(--danger);
}

.site-nav__link--danger:hover {
  background: rgba(248, 113, 113, 0.12);
}

.site-nav__link--register {
  color: var(--success);
}

.badge-vip {
  color: var(--vip);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 4px 8px;
}

.btn-vip--nav {
  padding: 6px 12px;
  font-size: 11px;
}

/* Main card */
.container {
  width: 100%;
  max-width: 520px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 28px 32px 36px;
  text-align: center;
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(20px);
  margin-bottom: 32px;
}

h1 {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
  color: var(--text-primary);
  background: linear-gradient(135deg, #f8fafc 0%, #94a3b8 100%);
  -webkit-background-clip: text;
  background-clip: text;
}

@supports (-webkit-background-clip: text) or (background-clip: text) {
  h1 {
    -webkit-text-fill-color: transparent;
    color: transparent;
  }
}

.description {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 20px;
  line-height: 1.6;
}

.pricing-info {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.08) 0%, rgba(22, 27, 44, 0.9) 100%);
  border: 1px solid var(--border-subtle);
  border-left: 3px solid var(--accent);
  padding: 14px 16px;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 24px;
  border-radius: var(--radius-md);
  text-align: left;
  line-height: 1.55;
}

.pricing-info strong {
  color: var(--text-primary);
  font-weight: 600;
}

form.main-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* Upload dropzone */
.upload-dropzone {
  position: relative;
  min-height: 150px;
  border: 2px dashed rgba(148, 163, 184, 0.45);
  border-radius: var(--radius-md);
  background: rgba(15, 18, 30, 0.55);
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

.upload-dropzone:hover,
.upload-dropzone:focus-within {
  border-color: rgba(56, 189, 248, 0.65);
  background: rgba(56, 189, 248, 0.06);
}

.upload-dropzone.is-dragover {
  border-color: var(--accent);
  background: rgba(56, 189, 248, 0.1);
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.25);
}

.upload-dropzone__input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  z-index: 2;
  font-size: 0;
}

.upload-dropzone__ui {
  position: relative;
  z-index: 1;
  pointer-events: none;
  min-height: 150px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 20px 16px;
}

.upload-dropzone__icon {
  color: var(--accent);
  opacity: 0.9;
  flex-shrink: 0;
}

.upload-dropzone__hint {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.45;
  max-width: 280px;
  text-align: center;
}

.upload-dropzone__filename {
  font-size: 12px;
  color: var(--accent);
  font-weight: 600;
  word-break: break-all;
  max-width: 100%;
  min-height: 1.2em;
}

select,
input[type="color"] {
  padding: 12px 14px;
  background: rgba(15, 18, 30, 0.75);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 14px;
  cursor: pointer;
  outline: none;
  width: 100%;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.main-form select.form-select {
  background: var(--input-elevated);
  border-color: rgba(255, 255, 255, 0.1);
}

.main-form select.form-select:hover {
  background: var(--input-elevated-focus);
  border-color: rgba(255, 255, 255, 0.14);
}

.main-form select.form-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(15, 23, 42, 0.85), 0 0 0 4px rgba(56, 189, 248, 0.28);
}

.main-form select.form-select:focus-visible {
  outline: none;
}

select:focus,
input[type="color"]:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

/* Primary buttons */
button[type="submit"],
button:not([type]) {
  background: linear-gradient(180deg, #38bdf8 0%, #0ea5e9 100%);
  color: #0c1222;
  border: none;
  padding: 14px 20px;
  font-size: 15px;
  font-weight: 700;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.25s ease, filter 0.2s ease;
  box-shadow: 0 4px 14px rgba(14, 165, 233, 0.35);
  font-family: inherit;
}

button[type="submit"]:hover,
button:not([type]):hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(14, 165, 233, 0.4);
}

.main-form .btn-process {
  width: 100%;
  margin-top: 4px;
  padding: 16px 24px;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.02em;
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, #5ec8fb 0%, #0ea5e9 55%, #0284c7 100%);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.12) inset,
    0 4px 20px rgba(14, 165, 233, 0.45),
    0 12px 32px -8px rgba(14, 165, 233, 0.35);
}

.main-form .btn-process:hover {
  filter: brightness(1.08);
  transform: translateY(-2px) scale(1.01);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.18) inset,
    0 8px 28px rgba(14, 165, 233, 0.55),
    0 20px 40px -12px rgba(56, 189, 248, 0.4);
}

.main-form .btn-process:active {
  transform: translateY(0) scale(0.995);
  filter: brightness(0.98);
}

.main-form .btn-process:focus-visible {
  outline: none;
  box-shadow:
    0 0 0 2px var(--bg-deep),
    0 0 0 5px rgba(56, 189, 248, 0.45),
    0 4px 20px rgba(14, 165, 233, 0.45);
}

.btn-vip {
  background: linear-gradient(180deg, #fcd34d 0%, var(--vip) 100%);
  color: #1c1917;
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 700;
  border-radius: var(--radius-sm);
  text-decoration: none;
  display: inline-block;
  border: none;
  cursor: pointer;
  font-family: inherit;
  box-shadow: 0 2px 10px rgba(251, 191, 36, 0.35);
  transition: transform 0.15s, filter 0.2s;
}

.btn-vip:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
}

/* VIP panel */
.vip-panel {
  background: rgba(15, 18, 30, 0.65);
  border: 1px solid rgba(251, 191, 36, 0.35);
  border-radius: var(--radius-md);
  padding: 16px;
  text-align: left;
}

.vip-panel__title {
  color: var(--vip);
  font-weight: 700;
  margin-bottom: 12px;
  font-size: 14px;
  letter-spacing: 0.02em;
}

.vip-preview-wrap {
  width: 100%;
  height: 120px;
  background: linear-gradient(145deg, #3d4458 0%, #1e2338 50%, #2a3148 100%);
  border-radius: var(--radius-md);
  margin-bottom: 14px;
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 14px;
  border: 1px solid var(--border-subtle);
}

.vip-preview-text {
  font-size: 24px;
  padding: 6px 16px;
  border-radius: 6px;
  text-align: center;
  max-width: 90%;
}

.vip-panel label {
  font-size: 13px;
  color: var(--text-secondary);
  display: block;
}

.vip-panel select[name="fonte"] {
  margin-bottom: 10px;
  margin-top: 6px;
}

.vip-row-colors {
  display: flex;
  gap: 14px;
  margin-bottom: 14px;
}

.vip-row-colors > div {
  flex: 1;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
  margin-top: 6px;
  cursor: pointer;
}

.vip-upsell {
  background: linear-gradient(145deg, rgba(45, 36, 14, 0.5) 0%, rgba(15, 18, 30, 0.82) 100%);
  border: 1px solid rgba(234, 179, 8, 0.42);
  border-radius: var(--radius-md);
  padding: 18px 16px;
  text-align: center;
  box-shadow:
    var(--gold-glow),
    inset 0 1px 0 rgba(253, 224, 71, 0.06);
}

.vip-upsell p {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 14px;
  line-height: 1.5;
}

/* Loading & progress */
#loading {
  display: none;
  margin-top: 24px;
  padding-top: 8px;
}

#loading p {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 14px;
}

.progress-container {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
}

.progress-bar {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), #8b5cf6);
  transition: width 0.4s ease;
}

.spinner {
  border: 3px solid rgba(255, 255, 255, 0.1);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border-left-color: var(--accent);
  animation: spin 0.9s linear infinite;
  margin: 16px auto 0;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.footer {
  position: absolute;
  bottom: 20px;
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

/* Revisar page */
body.page-revisar .container {
  max-width: 720px;
}

#revisarForm textarea {
  width: 100%;
  margin-bottom: 18px;
  padding: 16px;
  background: rgba(15, 18, 30, 0.75);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: ui-monospace, "Cascadia Code", "Consolas", monospace;
  font-size: 13px;
  line-height: 1.5;
  resize: vertical;
  min-height: 320px;
  outline: none;
}

#revisarForm textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

/* Auth & payment pages (login, cadastro, comprar) */
body.page-auth,
body.page-pay {
  padding: 40px 20px;
}

.auth-card,
.pay-card {
  width: 100%;
  max-width: 400px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 36px 32px;
  text-align: center;
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(20px);
}

.auth-card h2,
.pay-card h2 {
  margin: 0 0 8px;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.pay-card p {
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 24px;
}

.auth-card form,
.pay-card form {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.auth-card input[type="email"],
.auth-card input[type="password"],
.pay-card input[type="number"] {
  width: 100%;
  padding: 14px 16px;
  margin: 10px 0;
  background: rgba(15, 18, 30, 0.75);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  border-radius: var(--radius-md);
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.auth-card input:focus,
.pay-card input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.auth-card button[type="submit"] {
  margin-top: 8px;
}

.btn-register {
  background: linear-gradient(180deg, #34d399 0%, #059669 100%);
  color: #052e1f;
  box-shadow: 0 4px 14px rgba(5, 150, 105, 0.35);
}

.btn-register:hover {
  box-shadow: 0 8px 24px rgba(5, 150, 105, 0.4);
}

.pay-card button[type="submit"] {
  width: 100%;
}

.btn-stripe {
  background: linear-gradient(180deg, #a78bfa 0%, #7c3aed 100%);
  color: #faf5ff;
  box-shadow: 0 4px 14px rgba(124, 58, 237, 0.35);
}

.btn-stripe:hover {
  box-shadow: 0 8px 24px rgba(124, 58, 237, 0.45);
}

.auth-card .link-back,
.pay-card .link-back {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  display: inline-block;
  margin-top: 20px;
  transition: color 0.2s;
}

.auth-card .link-back:hover,
.pay-card .link-back:hover {
  color: var(--accent);
}

.erro {
  color: var(--danger);
  font-size: 14px;
  margin-bottom: 12px;
  padding: 10px 12px;
  background: rgba(248, 113, 113, 0.1);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(248, 113, 113, 0.25);
}

.pay-card form + form {
  margin-top: 12px;
}
