/* ============================================
   aplicativo.online — Portal Central de Acessos
   Design System & Styles
   ============================================ */

/* --- Reset & Base --- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  /* Colors */
  --bg-primary: #0f172a;
  --bg-secondary: #1e293b;
  --bg-card: #1e293b;
  --bg-card-hover: #334155;
  --bg-surface: #0f172a;

  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --accent-primary: #6366f1;
  --accent-primary-hover: #818cf8;
  --accent-secondary: #8b5cf6;
  --accent-glow: rgba(99, 102, 241, 0.15);
  --accent-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a78bfa 100%);

  --border-color: rgba(148, 163, 184, 0.1);
  --border-color-hover: rgba(148, 163, 184, 0.2);

  /* Spacing */
  --section-padding: 6rem 0;
  --container-max: 1200px;
  --container-padding: 0 1.5rem;

  /* Radius */
  --radius-sm: 0.5rem;
  --radius-md: 0.75rem;
  --radius-lg: 1rem;
  --radius-xl: 1.5rem;

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: inherit;
  text-decoration: none;
}

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

/* --- Container --- */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: var(--container-padding);
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.75rem;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 0.938rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all var(--transition-base);
  white-space: nowrap;
}

.btn--primary {
  background: var(--accent-gradient);
  color: white;
  box-shadow: 0 0 20px var(--accent-glow);
}

.btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 30px rgba(99, 102, 241, 0.3);
}

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

.btn--ghost:hover {
  color: var(--text-primary);
  border-color: var(--border-color-hover);
  background: rgba(255, 255, 255, 0.03);
}

.btn--lg {
  padding: 1rem 2.25rem;
  font-size: 1.063rem;
}

/* --- Header --- */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 1rem 0;
  transition: all var(--transition-base);
  background: transparent;
}

.header--scrolled {
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-color);
  padding: 0.75rem 0;
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header__logo {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  font-size: 1.25rem;
  font-weight: 700;
}

.header__logo-icon {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-size: 1.5rem;
}

.header__logo-dot {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.header__nav {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.header__link {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color var(--transition-fast);
}

.header__link:hover {
  color: var(--text-primary);
}

.header__link--cta {
  padding: 0.5rem 1.25rem;
  border-radius: var(--radius-sm);
  background: rgba(99, 102, 241, 0.1);
  color: var(--accent-primary-hover);
  border: 1px solid rgba(99, 102, 241, 0.2);
}

.header__link--cta:hover {
  background: rgba(99, 102, 241, 0.2);
  color: white;
}

/* Mobile Menu Button */
.header__menu-btn {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.header__menu-btn span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-secondary);
  border-radius: 2px;
  transition: all var(--transition-base);
}

.header__menu-btn.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.header__menu-btn.active span:nth-child(2) {
  opacity: 0;
}

.header__menu-btn.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* Mobile Nav */
.mobile-nav {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 99;
  background: rgba(15, 23, 42, 0.97);
  backdrop-filter: blur(20px);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-base);
}

.mobile-nav.active {
  opacity: 1;
  pointer-events: all;
}

.mobile-nav__link {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-secondary);
  transition: color var(--transition-fast);
}

.mobile-nav__link:hover {
  color: var(--text-primary);
}

/* --- Hero --- */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 8rem 0 4rem;
  overflow: hidden;
}

.hero__bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.hero__gradient {
  position: absolute;
  top: -30%;
  left: 50%;
  transform: translateX(-50%);
  width: 800px;
  height: 800px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.12) 0%, rgba(139, 92, 246, 0.06) 40%, transparent 70%);
  border-radius: 50%;
}

.hero__grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(148, 163, 184, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.03) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse at center, black 30%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse at center, black 30%, transparent 80%);
}

.hero__content {
  position: relative;
  text-align: center;
  max-width: 800px;
  margin: 0 auto;
}

.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 100px;
  background: rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(99, 102, 241, 0.15);
  font-size: 0.813rem;
  font-weight: 500;
  color: var(--accent-primary-hover);
  margin-bottom: 2rem;
  animation: fadeInDown 0.6s ease;
}

.hero__badge-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  animation: pulse 2s infinite;
}

.hero__title {
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: 1.5rem;
  animation: fadeInUp 0.6s ease 0.1s both;
}

.hero__title-highlight {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero__subtitle {
  font-size: 1.125rem;
  color: var(--text-secondary);
  line-height: 1.7;
  max-width: 600px;
  margin: 0 auto 2.5rem;
  animation: fadeInUp 0.6s ease 0.2s both;
}

.hero__actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 4rem;
  animation: fadeInUp 0.6s ease 0.3s both;
}

.hero__stats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2.5rem;
  animation: fadeInUp 0.6s ease 0.4s both;
}

.hero__stat {
  text-align: center;
}

.hero__stat-number {
  font-size: 1.75rem;
  font-weight: 800;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero__stat-symbol {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-muted);
}

.hero__stat-label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 0.25rem;
}

.hero__stat-divider {
  width: 1px;
  height: 40px;
  background: var(--border-color);
}

/* --- Section Header --- */
.section-header {
  text-align: center;
  margin-bottom: 4rem;
}

.section-header__tag {
  display: inline-block;
  padding: 0.375rem 1rem;
  border-radius: 100px;
  background: rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(99, 102, 241, 0.15);
  font-size: 0.813rem;
  font-weight: 500;
  color: var(--accent-primary-hover);
  margin-bottom: 1.25rem;
}

.section-header__title {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
}

.section-header__subtitle {
  font-size: 1.063rem;
  color: var(--text-secondary);
  max-width: 500px;
  margin: 0 auto;
}

/* --- Services --- */
.services {
  padding: var(--section-padding);
}

.services__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}

.service-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 2rem;
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  transition: all var(--transition-slow);
  cursor: pointer;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
}

.service-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--accent-gradient);
  opacity: 0;
  transition: opacity var(--transition-base);
}

.service-card:hover {
  border-color: var(--border-color-hover);
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}

.service-card:hover::before {
  opacity: 1;
}

.service-card__icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  margin-bottom: 1.25rem;
  font-size: 1.5rem;
}

.service-card__title {
  font-size: 1.125rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.service-card__description {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 1.5rem;
  flex-grow: 1;
}

.service-card__url {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.813rem;
  font-weight: 500;
  color: var(--accent-primary-hover);
  transition: gap var(--transition-fast);
}

.service-card:hover .service-card__url {
  gap: 0.625rem;
}

.service-card__url svg {
  width: 14px;
  height: 14px;
}

/* --- Features --- */
.features {
  padding: 0 0 6rem;
}

.features__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.feature-card {
  padding: 2rem;
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  text-align: center;
  transition: all var(--transition-slow);
}

.feature-card:hover {
  border-color: var(--border-color-hover);
  transform: translateY(-2px);
}

.feature-card__icon {
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  background: rgba(99, 102, 241, 0.1);
  color: var(--accent-primary-hover);
  margin: 0 auto 1.25rem;
}

.feature-card__title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.625rem;
}

.feature-card__text {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* --- About --- */
.about {
  padding: var(--section-padding);
}

.about__inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}

.about__title {
  font-size: clamp(1.75rem, 3.5vw, 2.25rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 1rem 0;
}

.about__text {
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 1rem;
}

.about__text strong {
  color: var(--text-primary);
}

/* Code Example Block */
.about__example {
  margin-top: 2rem;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border-color);
}

.about__example-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: rgba(30, 41, 59, 0.8);
  border-bottom: 1px solid var(--border-color);
}

.about__example-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.about__example-dot--red { background: #ef4444; }
.about__example-dot--yellow { background: #eab308; }
.about__example-dot--green { background: #22c55e; }

.about__example-url {
  margin-left: 0.75rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.about__example-body {
  padding: 1.5rem;
  background: rgba(15, 23, 42, 0.6);
}

.about__example-body code {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.875rem;
  line-height: 1.8;
}

.about__code-comment {
  color: var(--text-muted);
}

.about__code-keyword {
  color: var(--text-secondary);
}

.about__code-var {
  color: var(--accent-primary-hover);
  font-weight: 600;
}

/* Architecture Visual */
.about__architecture {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
}

.about__arch-node {
  padding: 0.875rem 1.75rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.875rem;
  text-align: center;
}

.about__arch-node--main {
  background: var(--accent-gradient);
  color: white;
  font-size: 1rem;
  padding: 1rem 2rem;
  box-shadow: 0 0 30px var(--accent-glow);
}

.about__arch-node--sub {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
}

.about__arch-branches {
  display: flex;
  gap: 1.5rem;
}

.about__arch-branch {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.about__arch-line {
  width: 2px;
  height: 30px;
  background: linear-gradient(to bottom, var(--accent-primary), transparent);
}

/* --- CTA --- */
.cta {
  padding: var(--section-padding);
}

.cta__inner {
  text-align: center;
  padding: 4rem 2rem;
  border-radius: var(--radius-xl);
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.08) 0%, rgba(139, 92, 246, 0.08) 100%);
  border: 1px solid rgba(99, 102, 241, 0.15);
}

.cta__title {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 800;
  margin-bottom: 1rem;
}

.cta__text {
  color: var(--text-secondary);
  margin-bottom: 2rem;
  font-size: 1.063rem;
}

.cta__text strong {
  color: var(--accent-primary-hover);
}

/* --- Footer --- */
.footer {
  padding: 2rem 0;
  border-top: 1px solid var(--border-color);
}

.footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer__brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1rem;
  font-weight: 700;
}

.footer__copy {
  font-size: 0.813rem;
  color: var(--text-muted);
}

.footer__links {
  display: flex;
  gap: 1.5rem;
}

.footer__links a {
  font-size: 0.813rem;
  color: var(--text-muted);
  transition: color var(--transition-fast);
}

.footer__links a:hover {
  color: var(--text-primary);
}

/* --- Animations --- */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* Scroll animations */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* --- Responsive --- */
@media (max-width: 1024px) {
  .about__inner {
    grid-template-columns: 1fr;
    gap: 3rem;
  }

  .features__grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 768px) {
  :root {
    --section-padding: 4rem 0;
  }

  .header__nav {
    display: none;
  }

  .header__menu-btn {
    display: flex;
  }

  .mobile-nav {
    display: flex;
  }

  .hero {
    padding: 7rem 0 3rem;
    min-height: auto;
  }

  .hero__title {
    font-size: 2.25rem;
  }

  .hero__actions {
    flex-direction: column;
  }

  .hero__stats {
    flex-direction: column;
    gap: 1.5rem;
  }

  .hero__stat-divider {
    width: 40px;
    height: 1px;
  }

  .services__grid {
    grid-template-columns: 1fr;
  }

  .features__grid {
    grid-template-columns: 1fr;
  }

  .about__arch-branches {
    flex-direction: column;
  }

  .cta__inner {
    padding: 2.5rem 1.5rem;
  }

  .footer__inner {
    flex-direction: column;
    text-align: center;
  }
}
