/**
 * =============================================================================
 * ESTILOS — Central de Ajuda Tutoriais (visual roxo premium — Loga net)
 * =============================================================================
 * Mobile-first; desktop amplia nav, hero e cards conforme o mockup.
 * =============================================================================
 */

:root {
  --bg: #05070a;
  --bg-card: #0a0f18;
  --bg-card-inner: #070b12;
  --border: rgba(255, 255, 255, 0.06);
  --border-card: rgba(88, 101, 242, 0.22);
  --text: #f8fafc;
  --text-muted: #94a3b8;
  --purple: #8b5cf6;
  --purple-bright: #a78bfa;
  --blue: #6366f1;
  --gradient: linear-gradient(90deg, #8b5cf6 0%, #6366f1 55%, #38bdf8 100%);
  --gradient-soft: linear-gradient(135deg, rgba(139, 92, 246, 0.35), rgba(99, 102, 241, 0.12));
  --glow: rgba(139, 92, 246, 0.45);
  --radius: 20px;
  --radius-sm: 12px;
  --font: "Inter", system-ui, -apple-system, sans-serif;
  --container: min(100% - 1rem, 920px);
  --nav-height: 56px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
}

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

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

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  position: relative;
  overflow-x: clip;
  padding-left: var(--safe-left);
  padding-right: var(--safe-right);
}

.page-glow {
  position: fixed;
  pointer-events: none;
  z-index: 0;
  border-radius: 50%;
  filter: blur(80px);
}

.page-glow--hero {
  width: min(320px, 70vw);
  height: 200px;
  top: -40px;
  right: -80px;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.28) 0%, transparent 70%);
}

.page-glow--bottom {
  width: 400px;
  height: 280px;
  bottom: 10%;
  left: -150px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.2) 0%, transparent 70%);
}

.container {
  width: var(--container);
  margin-inline: auto;
  position: relative;
  z-index: 1;
}

/* ── Topbar ────────────────────────────────────────────────────────────── */

.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background: rgba(5, 7, 10, 0.92);
  border-bottom: 1px solid var(--border);
  padding-top: var(--safe-top);
}

.topbar .container {
  width: min(100% - 1rem, 920px);
  padding-inline: 0.25rem;
}

.topbar-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 0.75rem;
  min-height: var(--nav-height);
  padding-block: 0.5rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  text-decoration: none;
  color: inherit;
  flex: 1 1 auto;
  min-width: 0;
  max-width: 100%;
}

.brand-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border-radius: 10px;
  background: var(--gradient-soft);
  border: 1px solid rgba(139, 92, 246, 0.35);
  color: var(--purple-bright);
  box-shadow: 0 0 24px rgba(139, 92, 246, 0.25);
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.brand-title {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.brand-sub {
  font-size: 0.58rem;
  color: var(--text-muted);
  letter-spacing: 0.01em;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.topnav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  flex: 1 1 100%;
  min-width: 0;
  max-width: 100%;
  padding-bottom: 0.15rem;
  mask-image: linear-gradient(90deg, transparent, #000 8px, #000 calc(100% - 16px), transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8px, #000 calc(100% - 16px), transparent);
}

.topnav::-webkit-scrollbar {
  display: none;
}

.topnav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.65rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  border-radius: 999px;
  border: 1px solid transparent;
  white-space: nowrap;
  transition: color 0.2s, background 0.2s, border-color 0.2s;
}

.topnav-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.topnav-link:hover {
  color: var(--text);
}

.topnav-link--active {
  color: var(--text);
  background: rgba(139, 92, 246, 0.12);
  border-color: rgba(139, 92, 246, 0.45);
  box-shadow: 0 0 20px rgba(139, 92, 246, 0.15);
}

/* ── Botão acesso ao sistema (topo) ─────────────────────────────────────── */

.system-cta {
  position: relative;
  z-index: 99;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(
    180deg,
    rgba(139, 92, 246, 0.08) 0%,
    rgba(5, 7, 10, 0.4) 100%
  );
}

.system-cta-inner {
  display: flex;
  justify-content: center;
}

.btn-system-access {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  max-width: 100%;
  padding: 0.85rem 1.25rem;
  font-family: var(--font);
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: #fff;
  text-decoration: none;
  text-align: center;
  border-radius: 999px;
  border: 1px solid rgba(167, 139, 250, 0.5);
  background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 50%, #4f46e5 100%);
  box-shadow:
    0 4px 20px rgba(99, 102, 241, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
  transition: transform 0.15s ease, box-shadow 0.2s ease, filter 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.btn-system-access-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: 0.95;
}

.btn-system-access:active {
  transform: scale(0.98);
}

@media (hover: hover) {
  .btn-system-access:hover {
    filter: brightness(1.06);
    box-shadow:
      0 6px 28px rgba(99, 102, 241, 0.45),
      inset 0 1px 0 rgba(255, 255, 255, 0.2);
  }
}

/* ── Hero ──────────────────────────────────────────────────────────────── */

.hero {
  padding: 1.25rem 0 1rem;
  text-align: center;
}

.hero-inner {
  max-width: 640px;
}

.hero-badge {
  display: inline-block;
  margin-bottom: 1rem;
  padding: 0.35rem 0.85rem;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--purple-bright);
  background: rgba(139, 92, 246, 0.1);
  border: 1px solid rgba(139, 92, 246, 0.35);
  border-radius: 999px;
}

.hero-title {
  margin: 0 0 0.5rem;
  font-size: clamp(1.65rem, 6.5vw, 3rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.hero-title-gradient {
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-subtitle {
  margin: 0 auto 1rem;
  max-width: 26rem;
  font-size: 0.875rem;
  color: var(--text-muted);
  padding-inline: 0.25rem;
}

.hero-line {
  width: 72px;
  height: 4px;
  margin-inline: auto;
  border-radius: 999px;
  background: var(--gradient);
  box-shadow: 0 0 16px var(--glow);
}

/* ── Tutoriais (cards) ─────────────────────────────────────────────────── */

.main {
  padding: 0.25rem 0 calc(1.5rem + var(--safe-bottom));
}

.tutorial-block {
  margin-bottom: 0;
}

.tutorial-card {
  padding: 1rem;
  background: linear-gradient(160deg, rgba(15, 23, 42, 0.65) 0%, rgba(10, 15, 24, 0.95) 100%);
  border: 1px solid var(--border-card);
  border-radius: var(--radius);
  box-shadow:
    0 4px 24px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.tutorial-header {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
  margin-bottom: 1.15rem;
}

.tutorial-index {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--purple-bright);
  background: rgba(139, 92, 246, 0.12);
  border: 1px solid rgba(139, 92, 246, 0.35);
  border-radius: var(--radius-sm);
}

.tutorial-header-body {
  flex: 1;
  min-width: 0;
  display: flex;
  gap: 0.75rem;
  align-items: stretch;
}

.tutorial-vrule {
  width: 3px;
  flex-shrink: 0;
  border-radius: 999px;
  background: var(--gradient);
  box-shadow: 0 0 12px var(--glow);
}

.tutorial-text {
  flex: 1;
  min-width: 0;
}

.tutorial-title {
  margin: 0 0 0.35rem;
  font-size: clamp(1.15rem, 4vw, 1.45rem);
  font-weight: 700;
  line-height: 1.25;
  color: var(--text);
}

.tutorial-desc {
  margin: 0;
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.55;
}

.tutorial-media {
  border-radius: calc(var(--radius-sm) + 2px);
  background: var(--bg-card-inner);
  border: 1px solid rgba(255, 255, 255, 0.05);
  padding: 0.5rem;
}

.video-shell {
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 2px dashed rgba(139, 92, 246, 0.45);
  background: rgba(7, 11, 18, 0.9);
}

.video-shell--filled {
  border-style: solid;
  border-color: rgba(139, 92, 246, 0.2);
  padding: 0;
  background: #000;
}

/* YouTube / Drive / Vimeo — proporção horizontal */
.video-frame--iframe {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
}

.video-frame--iframe iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

/*
 * MP4 gravado no celular (vertical): largura total, altura proporcional —
 * sem faixas pretas nas laterais.
 */
.video-frame--native {
  width: 100%;
  margin-inline: auto;
  background: #000;
  line-height: 0;
}

.video-frame--native video {
  width: 100%;
  height: auto;
  max-height: min(68dvh, 620px);
  display: block;
  margin: 0 auto;
  object-fit: contain;
  vertical-align: top;
}

.video-frame--native.video-frame--portrait {
  max-width: 100%;
}

.video-frame--native.video-frame--portrait video {
  width: 100%;
  max-height: min(65dvh, 580px);
}

.video-frame--native.video-frame--landscape {
  max-width: 100%;
}

.video-frame--native.video-frame--landscape video {
  max-height: min(50dvh, 420px);
}

.video-frame {
  background: #000;
}

.video-frame video,
.video-frame iframe {
  border: 0;
  display: block;
}

.video-placeholder {
  aspect-ratio: 9 / 16;
  max-height: min(50dvh, 420px);
  width: 100%;
  margin-inline: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  padding: 2rem 1.25rem;
  text-align: center;
}

.placeholder-play {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  color: var(--purple-bright);
  background: rgba(139, 92, 246, 0.15);
  border: 1px solid rgba(139, 92, 246, 0.4);
  box-shadow: 0 0 32px rgba(139, 92, 246, 0.25);
}

.placeholder-play svg {
  width: 24px;
  height: 24px;
  margin-left: 3px;
}

.placeholder-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}

.placeholder-hint {
  margin: 0;
  font-size: 0.8rem;
  color: var(--text-muted);
  max-width: 22rem;
}

.placeholder-hint code {
  font-size: 0.75rem;
  padding: 0.12rem 0.35rem;
  border-radius: 4px;
  background: rgba(139, 92, 246, 0.12);
  color: var(--purple-bright);
}

.section-divider {
  margin: 1.5rem 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(139, 92, 246, 0.35) 25%,
    rgba(99, 102, 241, 0.35) 75%,
    transparent
  );
}

.site-footer {
  margin-top: 0.5rem;
  padding: 1.25rem 0 calc(1.25rem + var(--safe-bottom));
  border-top: 1px solid var(--border);
  background: rgba(10, 15, 24, 0.6);
  text-align: center;
}

.footer-made {
  margin: 0;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.footer-made strong {
  color: var(--purple-bright);
  font-weight: 600;
}

.footer-copy {
  margin: 0.35rem 0 0;
  font-size: 0.72rem;
  color: var(--text-muted);
  opacity: 0.85;
}

/* ── Tablet / Desktop ─────────────────────────────────────────────────── */

@media (min-width: 640px) {
  :root {
    --container: min(100% - 2rem, 920px);
    --nav-height: 64px;
  }

  .topbar .container {
    width: var(--container);
    padding-inline: 0;
  }

  .topbar-inner {
    flex-wrap: nowrap;
  }

  .topnav {
    flex: 0 1 auto;
    mask-image: none;
    -webkit-mask-image: none;
    padding-bottom: 0;
  }

  .btn-system-access {
    width: auto;
    min-width: min(100%, 420px);
    padding: 0.75rem 2rem;
  }

  .topnav-link {
    padding: 0.5rem 0.9rem;
    font-size: 0.8125rem;
  }

  .tutorial-card {
    padding: 1.5rem 1.75rem;
  }

  .tutorial-index {
    width: 48px;
    height: 48px;
  }
}

@media (min-width: 768px) {
  :root {
    --container: min(100% - 3rem, 960px);
    --nav-height: 72px;
  }

  .hero {
    padding: 2.75rem 0 2rem;
    text-align: left;
  }

  .hero-inner {
    max-width: none;
  }

  .hero-line {
    margin-inline: 0;
  }

  .hero-subtitle {
    margin-inline: 0;
    font-size: 1.05rem;
  }

  .main {
    padding-bottom: 3.5rem;
  }

  .section-divider {
    margin: 2.5rem 0;
  }
}

@media (min-width: 1024px) {
  .tutorial-card {
    padding: 1.75rem 2rem;
  }

  .video-frame--native.video-frame--portrait video {
    max-height: min(72dvh, 640px);
  }

  .video-frame--native.video-frame--portrait {
    max-width: min(100%, 400px);
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

/* ── Portal (index, Renato, Artista) — visual app compacto ─────────────── */

.page-portal .main.portal-main .container {
  max-width: min(100% - 1rem, 400px);
}

.portal-main {
  padding-top: 0.35rem;
}

.portal-hero {
  text-align: center;
  margin-bottom: 1rem;
}

.portal-hero .hero-badge {
  margin-bottom: 0.65rem;
  padding: 0.28rem 0.65rem;
  font-size: 0.58rem;
}

.portal-hero-title {
  margin: 0.35rem 0 0;
  font-size: clamp(1.25rem, 4.5vw, 1.65rem);
  font-weight: 700;
  line-height: 1.22;
  letter-spacing: -0.02em;
}

.portal-stack {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.portal-section {
  padding: 0.65rem 0 0.85rem;
}

.portal-section-title {
  margin: 0 0 0.45rem;
  padding-left: 0.15rem;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.portal-group {
  background: linear-gradient(165deg, rgba(15, 23, 42, 0.75) 0%, rgba(10, 15, 24, 0.95) 100%);
  border: 1px solid var(--border-card);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
}

.portal-actions {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.portal-action-row + .portal-action-row {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.portal-action-row {
  width: 100%;
}

.portal-divider {
  height: 1px;
  margin: 0.35rem 0;
  opacity: 0.65;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(139, 92, 246, 0.28) 35%,
    rgba(99, 102, 241, 0.28) 65%,
    transparent
  );
}

.btn-portal {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 42px;
  padding: 0.5rem 0.85rem;
  font-family: var(--font);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-decoration: none;
  text-align: center;
  border-radius: 0;
  border: none;
  transition: background 0.15s ease, transform 0.12s ease;
  -webkit-tap-highlight-color: transparent;
}

.portal-group .btn-portal {
  border-radius: 0;
  box-shadow: none;
}

.portal-section > .portal-group:only-child .btn-portal--hub,
.portal-actions .portal-action-row:first-child:last-child .btn-portal {
  border-radius: 0;
}

.btn-portal--primary {
  color: #fff;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.95) 0%, rgba(99, 102, 241, 0.95) 100%);
}

.btn-portal--secondary {
  color: var(--text);
  background: transparent;
}

.btn-portal--hub {
  color: var(--purple-bright);
  background: transparent;
}

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

.btn-portal:active:not(.btn-portal--disabled) {
  transform: scale(0.99);
  filter: brightness(0.96);
}

@media (hover: hover) {
  .btn-portal--primary:hover:not(.btn-portal--disabled) {
    filter: brightness(1.05);
  }
  .btn-portal--secondary:hover:not(.btn-portal--disabled),
  .btn-portal--hub:hover:not(.btn-portal--disabled) {
    background: rgba(139, 92, 246, 0.1);
  }
}

.portal-sub {
  padding: 0.35rem 0 0.75rem;
  max-width: min(100%, 400px);
  margin-inline: auto;
}

.portal-back {
  display: inline-flex;
  margin-bottom: 0.75rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--purple-bright);
  text-decoration: none;
}

.portal-notice {
  margin: 0 0 0.85rem;
  padding: 0.65rem 0.75rem;
  font-size: 0.75rem;
  line-height: 1.5;
  color: var(--text-muted);
  background: rgba(139, 92, 246, 0.08);
  border: 1px solid rgba(139, 92, 246, 0.22);
  border-radius: 12px;
}

.portal-page-title {
  margin: 0 0 0.85rem;
  font-size: clamp(1.15rem, 4.2vw, 1.45rem);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.portal-cards {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.portal-card {
  padding: 0.85rem 0.9rem 0.9rem;
  background: linear-gradient(165deg, rgba(15, 23, 42, 0.75) 0%, rgba(10, 15, 24, 0.95) 100%);
  border: 1px solid var(--border-card);
  border-radius: 14px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.22);
}

.portal-card--compact .btn-portal {
  min-height: 40px;
  padding: 0.45rem 0.75rem;
  font-size: 0.8rem;
  border-radius: 10px;
  border: 1px solid rgba(139, 92, 246, 0.35);
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.85) 0%, rgba(99, 102, 241, 0.9) 100%);
  box-shadow: 0 2px 10px rgba(99, 102, 241, 0.2);
}

.portal-card-title {
  margin: 0 0 0.55rem;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text-muted);
  text-transform: uppercase;
}

.portal-card-hint {
  margin: 0 0 0.45rem;
  font-size: 0.6875rem;
  color: var(--text-muted);
}

.page-portal .topbar-inner {
  min-height: 52px;
  padding-block: 0.4rem;
}

.page-portal .brand-icon {
  width: 32px;
  height: 32px;
}

.page-portal .brand-title {
  font-size: 0.9rem;
}

.page-portal .brand-sub {
  font-size: 0.55rem;
}

@media (min-width: 768px) {
  .page-portal .main.portal-main .container {
    max-width: 380px;
  }

  .portal-hero {
    text-align: center;
  }

  .portal-section-title {
    font-size: 0.72rem;
  }
}
