:root {
  --ink: #1f2e28;
  --muted: #4a5c54;
  --brand: #1e4d3c;
  --brand-mid: #2a6b52;
  --brand-light: #3d8f6a;
  --cta: #d4552a;
  --cta-hover: #e06030;
  --cta-deep: #a83f1c;
  --gain: #1f7a4c;
  --gain-deep: #156b3f;
  --loss: #b33a3a;
  --line: #b5c6b4;
  --paper: #fffcf7;
  --paper-soft: #faf8f4;
  --bg-deep: #16352c;
  --bg-mid: #1e4d3c;
  --font-ui: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --r: 16px;
  --shadow: 0 12px 40px rgba(15, 40, 32, 0.2);
}

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  background: linear-gradient(165deg, var(--bg-mid) 0%, var(--bg-deep) 55%, #0f241e 100%);
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

button,
input {
  font: inherit;
}

a {
  color: inherit;
}

.hidden {
  display: none !important;
}

/* ── Header laranja ── */
.site-header {
  background: linear-gradient(180deg, var(--cta-hover) 0%, var(--cta) 100%);
  padding: 18px 20px 22px;
  text-align: center;
  border-bottom: 3px solid var(--cta-deep);
  box-shadow: 0 4px 18px rgba(168, 63, 28, 0.28);
}

.site-header-brand {
  display: inline-block;
  width: min(210px, 72vw);
}

.site-header-brand img {
  width: 100%;
  height: auto;
}

/* ── Shell ── */
.shell {
  width: min(100% - 32px, 480px);
  margin: 0 auto;
  padding: 24px 0 48px;
}

.shell-wide {
  width: min(100% - 32px, 720px);
}

/* ── Card modal login ── */
.panel {
  background: var(--paper);
  border: 1px solid rgba(30, 77, 60, 0.1);
  border-radius: calc(var(--r) + 4px);
  box-shadow: var(--shadow);
  padding: 28px 22px 32px;
}

.panel-title {
  margin: 0 0 6px;
  font-size: clamp(1.35rem, 5vw, 1.55rem);
  font-weight: 800;
  color: var(--brand);
  text-align: center;
}

.panel-lead {
  margin: 0 0 22px;
  font-size: 0.95rem;
  color: var(--muted);
  text-align: center;
  line-height: 1.45;
}

/* ── Tabs login ── */
.tab-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 18px;
  padding: 4px;
  background: #e8f0eb;
  border-radius: 12px;
}

.tab-btn {
  border: none;
  border-radius: 10px;
  padding: 11px 12px;
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.tab-btn.is-active {
  background: #fff;
  color: var(--brand);
  box-shadow: 0 2px 8px rgba(30, 77, 60, 0.1);
}

.field {
  margin-bottom: 14px;
}

.field label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--brand-mid);
}

.field input {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  transition: border-color 0.15s ease;
}

.field input:focus {
  outline: none;
  border-color: var(--brand-mid);
}

.field input::placeholder {
  color: #8a9690;
}

.field-input-phone {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

.field input.field-input-phone {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--ink);
}

.field input[type="email"] {
  font-size: 1rem;
}

/* ── Botões ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 48px;
  padding: 12px 18px;
  border: none;
  border-radius: 12px;
  font-weight: 800;
  font-size: 0.95rem;
  line-height: 1.2;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.15s ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn:focus-visible {
  outline: 3px solid var(--brand-light);
  outline-offset: 2px;
}

.btn-primary {
  background: var(--cta);
  color: #fff;
  box-shadow: 0 4px 0 var(--cta-deep);
}

.btn-primary:hover {
  background: var(--cta-hover);
}

.btn-primary:disabled {
  opacity: 0.65;
  cursor: wait;
  transform: none;
}

.btn-ghost {
  background: #fff;
  color: var(--brand);
  border: 2px solid var(--brand-mid);
  box-shadow: none;
}

.btn-outline-light {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border: 1.5px solid rgba(255, 255, 255, 0.45);
  box-shadow: none;
  flex-shrink: 0;
}

.btn-outline-light:hover {
  background: rgba(255, 255, 255, 0.2);
}

.btn-small {
  width: auto;
  min-height: 38px;
  padding: 8px 14px;
  font-size: 0.82rem;
  border-radius: 10px;
}

.form-msg {
  margin: 14px 0 0;
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 600;
  text-align: center;
  line-height: 1.4;
}

.form-msg.is-error {
  background: #fdecec;
  color: var(--loss);
  border: 1px solid rgba(179, 58, 58, 0.25);
}

.form-msg.is-info {
  background: #eef6f1;
  color: var(--brand);
  border: 1px solid rgba(42, 107, 82, 0.2);
}

.no-purchase {
  margin-top: 18px;
  padding: 18px 16px;
  border-radius: 12px;
  background: #fff8f0;
  border: 1px solid rgba(212, 85, 42, 0.25);
  text-align: center;
}

.no-purchase-title {
  margin: 0 0 8px;
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--brand);
}

.no-purchase-text {
  margin: 0 0 14px;
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.45;
}

.login-foot {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  text-align: center;
  font-size: 0.85rem;
  color: var(--muted);
}

.login-foot a {
  color: var(--brand-mid);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.login-support {
  margin-top: 14px;
  text-align: center;
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.45;
}

.support-mail {
  color: var(--brand-mid);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
  word-break: break-all;
}

.site-foot .support-mail {
  color: rgba(255, 255, 255, 0.95);
}

/* ── Dashboard ── */
.dash-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 22px;
  padding: 20px 20px;
  background: var(--paper);
  border-radius: calc(var(--r) + 4px);
  box-shadow: var(--shadow);
  border-left: 4px solid var(--cta);
}

.dash-greet {
  margin: 0;
  font-size: clamp(1.15rem, 4.5vw, 1.4rem);
  font-weight: 800;
  color: var(--brand);
  line-height: 1.25;
}

.dash-sub {
  margin: 6px 0 0;
  font-size: 0.88rem;
  color: var(--muted);
}

.help-box {
  margin-top: 8px;
  margin-bottom: 24px;
  padding: 20px 20px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: calc(var(--r) + 2px);
}

.help-box h2 {
  margin: 0 0 12px;
  font-size: 1rem;
  font-weight: 800;
  color: #fff;
}

.section-block {
  margin-bottom: 28px;
}

.section-label {
  margin: 0 0 14px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.88);
}

.material-list {
  display: grid;
  gap: 16px;
}

/* ── Cards de material — mobile first ── */
.material-card {
  background: var(--paper);
  border-radius: calc(var(--r) + 2px);
  box-shadow: 0 4px 20px rgba(15, 40, 32, 0.14);
  border: 1px solid rgba(30, 77, 60, 0.08);
  overflow: hidden;
}

.material-card-inner {
  display: flex;
  gap: 14px;
  padding: 16px;
  align-items: flex-start;
}

.material-cover {
  flex-shrink: 0;
  width: 72px;
  aspect-ratio: 3 / 4;
  border-radius: 10px;
  overflow: hidden;
  background: #e8f0eb;
  border: 1px solid var(--line);
  box-shadow: 0 2px 8px rgba(15, 40, 32, 0.08);
}

.material-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.material-body {
  flex: 1;
  min-width: 0;
}

.material-body h3 {
  margin: 0 0 6px;
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--brand);
  line-height: 1.3;
}

.material-body p {
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.4;
}

.badge {
  display: inline-block;
  margin-bottom: 8px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.badge-ok {
  background: #e3f5eb;
  color: var(--gain);
}

.badge-lock {
  background: #fff0e8;
  color: var(--cta);
}

.material-card-foot {
  padding: 12px 16px 16px;
  background: var(--paper-soft);
  border-top: 1px solid rgba(181, 198, 180, 0.55);
}

.material-card-foot .btn {
  min-height: 44px;
  font-size: 0.9rem;
  border-radius: 11px;
}

.btn-download {
  background: var(--gain);
  color: #fff;
  box-shadow: 0 3px 0 var(--gain-deep);
}

.btn-download:hover {
  background: #228f58;
}

.download-stack {
  display: grid;
  gap: 8px;
}

.download-alt-hint {
  margin: 0;
  font-size: 0.75rem;
  line-height: 1.35;
  color: var(--muted);
  text-align: center;
}

.btn-download-alt {
  background: var(--paper);
  color: var(--brand);
  border: 1.5px solid var(--brand-mid);
  box-shadow: none;
}

.btn-download-alt:hover {
  background: #eef5f0;
}

.btn-buy {
  background: var(--cta);
  color: #fff;
  box-shadow: 0 3px 0 var(--cta-deep);
}

.btn-buy:hover {
  background: var(--cta-hover);
}

.btn-pending {
  background: #e8f0eb;
  color: var(--muted);
  box-shadow: none;
  cursor: default;
  transform: none;
}

.help-box .help-inner {
  color: rgba(255, 255, 255, 0.9);
}

.help-steps {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.help-steps li {
  position: relative;
  padding-left: 28px;
  margin-bottom: 12px;
  font-size: 0.88rem;
  color: rgba(255, 255, 255, 0.88);
  line-height: 1.45;
}

.help-steps li:last-child {
  margin-bottom: 0;
}

.help-steps li::before {
  content: counter(step);
  counter-increment: step;
  position: absolute;
  left: 0;
  top: 1px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}

.site-foot {
  margin-top: 32px;
  text-align: center;
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.55);
  line-height: 1.5;
}

.site-foot a {
  color: rgba(255, 255, 255, 0.78);
  font-weight: 600;
}

/* ── Overlay modals ── */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background: rgba(15, 36, 30, 0.72);
}

.overlay-card {
  width: min(100%, 400px);
  padding: 28px 24px;
  background: var(--paper);
  border-radius: calc(var(--r) + 4px);
  box-shadow: var(--shadow);
  text-align: center;
}

.overlay-card h2 {
  margin: 0 0 10px;
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--brand);
}

.overlay-card p {
  margin: 0 0 20px;
  font-size: 0.92rem;
  color: var(--muted);
  line-height: 1.5;
}

.overlay-actions {
  display: grid;
  gap: 10px;
}

.loading-state {
  text-align: center;
  padding: 48px 16px;
  color: rgba(255, 255, 255, 0.85);
  font-weight: 600;
}

@media (min-width: 560px) {
  .material-cover {
    width: 88px;
  }

  .material-body h3 {
    font-size: 1.02rem;
  }

  .material-card-inner {
    padding: 18px;
  }

  .material-card-foot {
    padding: 14px 18px 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .btn {
    transition: none;
  }

  .btn:active {
    transform: none;
  }
}
