:root {
  --page-bg: #0a0a0d;
  --surface-bg: #131318;
  --surface-hover: #181820;
  --card-bg: rgba(19, 19, 24, 0.7);
  --border-subtle: #23232b;
  --border-strong: #32323e;
  --border-focus: #17c0fd;
  
  --brand-cyan: #17c0fd;
  --brand-glow: rgba(23, 192, 253, 0.15);
  --brand-glow-strong: rgba(23, 192, 253, 0.35);
  
  --text-strong: #ffffff;
  --text-medium: #d4d4dc;
  --text-weak: #8e8e9c;
  --text-muted: #5a5a68;
  
  --font-sans: "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  
  --trans-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --trans-smooth: 250ms cubic-bezier(0.16, 1, 0.3, 1);
}

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

body {
  background-color: var(--page-bg);
  color: var(--text-medium);
  font-family: var(--font-sans);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

body.gate-travado {
  overflow: hidden !important;
  touch-action: none;
}

a {
  color: var(--brand-cyan);
  text-decoration: none;
  transition: opacity var(--trans-fast);
}

a:hover {
  opacity: 0.85;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(10, 10, 13, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
  padding: 16px 24px;
}

.header-container {
  max-width: 1040px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-strong);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -0.01em;
}

.brand-badge {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  background: var(--brand-glow);
  color: var(--brand-cyan);
  border: 1px solid rgba(23, 192, 253, 0.3);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.nav-btn {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-medium);
  padding: 8px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--surface-bg);
  transition: all var(--trans-fast);
}

.nav-btn:hover {
  background: var(--surface-hover);
  border-color: var(--border-strong);
  color: var(--text-strong);
}

.nav-btn.primary {
  background: var(--text-strong);
  color: #000000;
  border-color: var(--text-strong);
}

.nav-btn.primary:hover {
  opacity: 0.9;
}

/* Vitrine de Materiais */
.vitrine-wrapper {
  max-width: 960px;
  margin: 0 auto;
  padding: 60px 24px 100px;
}

.vitrine-hero {
  text-align: center;
  margin-bottom: 50px;
}

.vitrine-tag {
  display: inline-block;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--brand-cyan);
  background: var(--brand-glow);
  border: 1px solid rgba(23, 192, 253, 0.3);
  padding: 4px 12px;
  border-radius: var(--radius-full);
  margin-bottom: 16px;
}

.vitrine-hero h1 {
  font-size: 38px;
  font-weight: 700;
  color: var(--text-strong);
  letter-spacing: -0.03em;
  margin-bottom: 12px;
}

.vitrine-hero p {
  font-size: 18px;
  color: var(--text-weak);
  max-width: 600px;
  margin: 0 auto;
}

.materiais-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
}

.material-card {
  background: var(--card-bg);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 28px;
  display: flex;
  flex-direction: column;
  transition: all var(--trans-smooth);
  backdrop-filter: blur(8px);
}

.material-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
}

.material-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-weak);
  margin-bottom: 14px;
}

.meta-pill {
  background: var(--surface-bg);
  border: 1px solid var(--border-subtle);
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  color: var(--text-medium);
}

.material-card h2 {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-strong);
  letter-spacing: -0.02em;
  margin-bottom: 10px;
  line-height: 1.35;
}

.material-card p {
  font-size: 14px;
  color: var(--text-weak);
  line-height: 1.6;
  margin-bottom: 24px;
  flex-grow: 1;
}

.material-card-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  padding: 10px 16px;
  border-radius: var(--radius-md);
  background: var(--surface-bg);
  border: 1px solid var(--border-strong);
  color: var(--text-strong);
  transition: all var(--trans-fast);
}

.material-card:hover .material-card-cta {
  background: var(--brand-cyan);
  border-color: var(--brand-cyan);
  color: #000000;
}

/* Leitura de Material & Proteção */
.leitura-container {
  max-width: 740px;
  margin: 0 auto;
  padding: 50px 24px 120px;
}

.leitura-header {
  margin-bottom: 36px;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 28px;
}

.leitura-voltar {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-weak);
  margin-bottom: 20px;
}

.leitura-voltar:hover {
  color: var(--text-strong);
}

.leitura-header h1 {
  font-size: 34px;
  font-weight: 700;
  color: var(--text-strong);
  letter-spacing: -0.025em;
  line-height: 1.3;
  margin-bottom: 16px;
}

.leitura-meta-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 13px;
  color: var(--text-weak);
}

.status-acesso-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: var(--radius-full);
}

.status-acesso-badge.livre {
  background: var(--brand-glow);
  color: var(--brand-cyan);
  border: 1px solid rgba(23, 192, 253, 0.3);
}

.status-acesso-badge.liberado {
  background: rgba(34, 197, 94, 0.15);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.3);
}

/* Tipografia do Artigo */
.material-corpo {
  font-size: 17px;
  line-height: 1.8;
  color: var(--text-medium);
}

.material-corpo p {
  margin-bottom: 22px;
}

.material-corpo p.lead {
  font-size: 20px;
  color: var(--text-strong);
  font-weight: 400;
  line-height: 1.6;
  margin-bottom: 28px;
}

.material-corpo h2 {
  font-size: 24px;
  font-weight: 600;
  color: var(--text-strong);
  margin: 44px 0 18px;
  letter-spacing: -0.02em;
}

.material-corpo code {
  font-family: var(--font-mono);
  font-size: 14px;
  background: #17171f;
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--brand-cyan);
}

.destaque-box {
  background: rgba(23, 192, 253, 0.05);
  border-left: 3px solid var(--brand-cyan);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: 18px 22px;
  margin: 28px 0;
  font-size: 16px;
  color: var(--text-strong);
}

.tabela-container {
  overflow-x: auto;
  margin: 28px 0;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}

.tabela-metricas {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  text-align: left;
}

.tabela-metricas th {
  background: #15151c;
  padding: 12px 16px;
  color: var(--text-strong);
  font-weight: 600;
  border-bottom: 1px solid var(--border-subtle);
}

.tabela-metricas td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-subtle);
}

.tabela-metricas tr:last-child td {
  border-bottom: none;
}

.tabela-metricas td.positivo {
  color: #4ade80;
  font-weight: 600;
}

.checklist {
  list-style: none;
  margin: 24px 0;
}

.checklist li {
  position: relative;
  padding-left: 28px;
  margin-bottom: 12px;
}

.checklist li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--brand-cyan);
  font-weight: bold;
}

.nota-conclusao {
  background: var(--surface-bg);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 22px;
  margin-top: 36px;
}

/* Corte Dissolvido (Gate Severed Content) */
.corte-wrapper {
  position: relative;
  margin-top: -80px;
  padding-top: 80px;
}

.corte-dissolve {
  height: 120px;
  background: linear-gradient(180deg, rgba(10, 10, 13, 0) 0%, rgba(10, 10, 13, 0.85) 60%, var(--page-bg) 100%);
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  pointer-events: none;
}

.card-gate-inline {
  position: relative;
  z-index: 10;
  background: #14141a;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 36px 32px;
  text-align: center;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
  margin-top: 20px;
}

.card-gate-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  background: var(--brand-glow);
  color: var(--brand-cyan);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  margin-bottom: 16px;
  border: 1px solid rgba(23, 192, 253, 0.3);
}

.card-gate-inline h3 {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-strong);
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.card-gate-inline p {
  font-size: 15px;
  color: var(--text-weak);
  max-width: 480px;
  margin: 0 auto 24px;
}

.btn-abrir-gate {
  background: var(--brand-cyan);
  color: #000000;
  font-weight: 600;
  font-size: 15px;
  padding: 12px 28px;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: all var(--trans-fast);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-abrir-gate:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(23, 192, 253, 0.4);
}

/* Modal em Tela Cheia (Gate Overlay) */
.gate-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 999;
  background: rgba(6, 6, 9, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--trans-smooth);
}

.gate-modal-overlay.ativo {
  opacity: 1;
  pointer-events: auto;
}

.gate-modal-container {
  width: 100%;
  max-width: 460px;
  background: #14141a;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 36px 32px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.8);
  transform: translateY(12px);
  transition: transform var(--trans-smooth);
}

.gate-modal-overlay.ativo .gate-modal-container {
  transform: translateY(0);
}

.gate-modal-header {
  text-align: center;
  margin-bottom: 24px;
}

.gate-badge-modal {
  display: inline-block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--brand-cyan);
  background: var(--brand-glow);
  border: 1px solid rgba(23, 192, 253, 0.3);
  padding: 3px 10px;
  border-radius: var(--radius-full);
  margin-bottom: 12px;
}

.gate-modal-header h3 {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-strong);
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.gate-modal-header p {
  font-size: 14px;
  color: var(--text-weak);
  line-height: 1.5;
}

/* Formulário e Campos */
.gate-form-group {
  margin-bottom: 16px;
  text-align: left;
}

.gate-form-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-medium);
  margin-bottom: 6px;
}

.gate-input {
  width: 100%;
  background: #0d0d12;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  font-size: 14px;
  color: var(--text-strong);
  outline: none;
  transition: border-color var(--trans-fast);
  font-family: inherit;
}

.gate-input:focus {
  border-color: var(--brand-cyan);
  box-shadow: 0 0 0 1px var(--brand-cyan);
}

.gate-input::placeholder {
  color: var(--text-muted);
}

.gate-checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 12px;
  color: var(--text-weak);
  line-height: 1.45;
  cursor: pointer;
  margin: 18px 0;
}

.gate-checkbox-label input[type="checkbox"] {
  margin-top: 2px;
  accent-color: var(--brand-cyan);
}

.gate-btn-submit {
  width: 100%;
  background: var(--text-strong);
  color: #000000;
  font-size: 14px;
  font-weight: 600;
  padding: 12px;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: all var(--trans-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.gate-btn-submit:hover:not(:disabled) {
  opacity: 0.9;
  transform: translateY(-1px);
}

.gate-btn-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.gate-erro-campo {
  font-size: 12px;
  color: #f87171;
  margin-top: 4px;
  display: none;
}

.gate-erro-geral {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 13px;
  margin-bottom: 16px;
  display: none;
  text-align: left;
}

/* Etapa 2 — Código de 6 Dígitos */
.codigo-inputs-container {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 24px 0;
}

.codigo-digito {
  width: 48px;
  height: 56px;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 24px;
  font-weight: 700;
  background: #0d0d12;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  color: var(--text-strong);
  outline: none;
  transition: all var(--trans-fast);
}

.codigo-digito:focus {
  border-color: var(--brand-cyan);
  box-shadow: 0 0 0 1px var(--brand-cyan);
  background: #14141f;
}

.etapa-acoes {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 20px;
  font-size: 13px;
}

.btn-texto {
  background: none;
  border: none;
  color: var(--text-weak);
  cursor: pointer;
  padding: 4px 8px;
  font-size: 12px;
  transition: color var(--trans-fast);
}

.btn-texto:hover:not(:disabled) {
  color: var(--text-strong);
}

.btn-texto:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.aviso-expiracao-badge {
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
  margin-top: 14px;
}

/* Spinner */
.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(0, 0, 0, 0.2);
  border-top-color: #000000;
  border-radius: 50%;
  animation: girar 0.6s linear infinite;
  display: none;
}

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

/* Mobile (Card em tela cheia, teclado numérico e botão sempre visível) */
@media (max-width: 640px) {
  .site-header { padding: 12px 16px; }
  .header-container { gap: 8px; }
  .vitrine-wrapper { padding: 32px 16px 64px; }
  .vitrine-hero h1 { font-size: 28px; letter-spacing: -0.02em; }
  .leitura-container { padding: 24px 16px 64px; }
  .leitura-header h1 { font-size: 24px; letter-spacing: -0.02em; }
  
  .gate-modal-overlay {
    padding: 0;
    align-items: stretch;
  }
  
  .gate-modal-container {
    max-width: 100%;
    min-height: 100vh;
    height: 100%;
    border-radius: 0;
    border-left: none;
    border-right: none;
    border-top: none;
    border-bottom: none;
    padding: 24px 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  .codigo-inputs-container {
    gap: 8px;
    margin: 20px 0;
  }

  .codigo-digito {
    width: 44px;
    height: 52px;
    font-size: 22px;
    border-radius: var(--radius-sm);
  }

  .gate-btn-submit {
    position: relative;
    z-index: 10;
  }
}
