/* Shared UI components */

/* --- Navigation --- */
.top-nav,
.page-nav,
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  flex-wrap: nowrap;
  min-height: 58px;
  margin-bottom: 20px;
  padding-block: 10px;
  border: 1px solid rgba(56, 189, 248, 0.12);
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.85) 0%, rgba(7, 13, 25, 0.75) 100%);
  box-shadow: var(--shadow-md), var(--shadow-inset), 0 0 0 1px rgba(56, 189, 248, 0.04);
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  transition: box-shadow var(--duration) var(--ease-out);
}

.top-nav:hover,
.nav:hover {
  box-shadow: var(--shadow-md), var(--shadow-glow), var(--shadow-inset);
}

.page-nav {
  border-radius: 0;
  border-left: 0;
  border-right: 0;
  border-top: 0;
  background: rgba(5, 8, 22, 0.8);
  backdrop-filter: blur(20px) saturate(1.4);
  margin-bottom: 0;
}

/* Homepage-style header nav (shared on trust/content pages) */
.home-header {
  position: sticky;
  top: 0;
  z-index: 50;
  width: 100%;
  border-bottom: 1px solid rgba(56, 189, 248, 0.1);
  background: rgba(2, 6, 23, 0.94);
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
}

.home-header .home-nav.top-nav {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding-inline: var(--gutter);
  border: none;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
  margin-bottom: 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  font-weight: 800;
  color: #e2e8f0;
  text-decoration: none;
  transition: opacity var(--duration) var(--ease-out);
}

.brand:hover {
  opacity: 0.9;
}

.brand-logo {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: 12px;
  box-shadow:
    0 0 0 1px rgba(56, 189, 248, 0.35),
    0 8px 24px rgba(56, 189, 248, 0.18);
  transition: box-shadow var(--duration) var(--ease-out);
}

.brand:hover .brand-logo {
  box-shadow:
    0 0 0 1px rgba(56, 189, 248, 0.5),
    0 8px 28px rgba(56, 189, 248, 0.28);
}

.brand-text {
  display: grid;
  gap: 2px;
}

.brand-title {
  color: var(--text);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.brand-subtitle {
  color: #8ea4bc;
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.02em;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
}

.nav-links a {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 36px;
  padding: 8px 14px;
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--soft);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: all var(--duration) var(--ease-out);
}

.nav-links a:hover {
  color: var(--cyan);
  background: rgba(56, 189, 248, 0.08);
  border-color: rgba(56, 189, 248, 0.2);
}

.nav-links a.active {
  color: #03121c;
  background: var(--gradient-brand);
  border-color: transparent;
  box-shadow: 0 4px 16px rgba(56, 189, 248, 0.25);
  transform: translateY(-1px);
}

.nav-links a.nav-cta {
  color: #020617;
  background: var(--gradient-brand);
  border-color: transparent;
  font-weight: 700;
  box-shadow: 0 4px 16px rgba(56, 189, 248, 0.22);
}

.nav-links a.nav-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(56, 189, 248, 0.35);
}

.nav-cta,
.primary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 10px 18px;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--gradient-brand);
  color: #020617;
  text-decoration: none;
  font-family: inherit;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(56, 189, 248, 0.28);
  transition: all var(--duration) var(--ease-out);
}

.nav-cta:hover,
.primary-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(56, 189, 248, 0.38);
}

/* --- Buttons (site-wide: cyan primary accent) --- */
.btn,
.btn.primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 42px;
  padding: 0 20px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-weight: 700;
  font-size: 14px;
  border: 1px solid transparent;
  color: #03121c;
  background: var(--gradient-brand);
  box-shadow: 0 8px 24px rgba(56, 189, 248, 0.25);
  transition: all var(--duration) var(--ease-out);
  cursor: pointer;
}

.btn:hover,
.btn.primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(56, 189, 248, 0.38);
}

.btn.secondary,
.btn.btn-secondary,
.btn-secondary {
  color: #7dd3fc;
  background: rgba(8, 47, 73, 0.4);
  border-color: rgba(56, 189, 248, 0.3);
  box-shadow: none;
  backdrop-filter: blur(8px);
}

.btn.secondary:hover,
.btn.btn-secondary:hover,
.btn-secondary:hover {
  background: rgba(8, 47, 73, 0.6);
  border-color: rgba(56, 189, 248, 0.5);
  box-shadow: 0 4px 16px rgba(56, 189, 248, 0.12);
}

.btn.btn-ghost,
.btn-ghost {
  color: #9eb0d4;
  background: transparent;
  border-color: rgba(148, 184, 255, 0.18);
  box-shadow: none;
}

.btn.btn-ghost:hover,
.btn-ghost:hover {
  color: #e8f4ff;
  border-color: rgba(125, 211, 252, 0.35);
  background: rgba(56, 189, 248, 0.06);
  box-shadow: none;
}

.btn:focus-visible,
.nav-links a:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}

/* --- Cards --- */
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 18px;
  border: 1px solid rgba(56, 189, 248, 0.1);
  border-radius: var(--radius-md);
  background: var(--gradient-card);
  box-shadow: var(--shadow-sm), var(--shadow-inset);
  transition: all var(--duration) var(--ease-out);
  overflow: hidden;
}

.card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(56, 189, 248, 0.4), transparent);
  opacity: 0;
  transition: opacity var(--duration) var(--ease-out);
}

.card:hover {
  transform: translateY(-4px);
  border-color: rgba(56, 189, 248, 0.35);
  box-shadow: var(--shadow-md), var(--shadow-glow);
}

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

.card-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  margin-bottom: 14px;
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 11px;
  color: var(--cyan);
  background: linear-gradient(135deg, rgba(8, 47, 73, 0.6), rgba(56, 189, 248, 0.08));
  font-weight: 900;
  box-shadow: 0 4px 12px rgba(56, 189, 248, 0.1);
}

.card h2,
.card h3 {
  color: var(--text);
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}

.card p {
  color: var(--soft);
  font-size: 13px;
  line-height: 1.55;
}

/* --- Badges / Tags --- */
.badge,
.eyebrow {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 12px;
  margin-bottom: 16px;
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.12), rgba(56, 189, 248, 0.04));
  color: #7dd3fc;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  box-shadow: 0 2px 8px rgba(56, 189, 248, 0.08);
}

.tag {
  align-self: flex-start;
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 14px;
  border: 1px solid;
}

.tag-email { background: rgba(56, 189, 248, 0.12); color: #7dd3fc; border-color: rgba(56, 189, 248, 0.28); }
.tag-security { background: rgba(244, 63, 94, 0.12); color: #fda4af; border-color: rgba(244, 63, 94, 0.28); }
.tag-vios { background: rgba(139, 92, 246, 0.14); color: #c4b5fd; border-color: rgba(139, 92, 246, 0.3); }
.tag-lvm { background: rgba(245, 158, 11, 0.12); color: #fcd34d; border-color: rgba(245, 158, 11, 0.28); }
.tag-nim { background: rgba(14, 165, 233, 0.12); color: #7dd3fc; border-color: rgba(14, 165, 233, 0.28); }
.tag-virt { background: rgba(99, 102, 241, 0.14); color: #a5b4fc; border-color: rgba(99, 102, 241, 0.28); }
.tag-hw { background: rgba(16, 185, 129, 0.12); color: #6ee7b7; border-color: rgba(16, 185, 129, 0.28); }
.tag-linux { background: rgba(34, 197, 94, 0.12); color: #86efac; border-color: rgba(34, 197, 94, 0.28); }

/* --- Stats --- */
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 12px;
}

.stat {
  position: relative;
  padding: 14px 16px;
  border: 1px solid rgba(56, 189, 248, 0.12);
  border-radius: var(--radius-md);
  background: linear-gradient(165deg, rgba(15, 23, 42, 0.9), rgba(15, 23, 42, 0.6));
  box-shadow: var(--shadow-sm), var(--shadow-inset);
  transition: all var(--duration) var(--ease-out);
  overflow: hidden;
}

.stat::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--gradient-brand);
  opacity: 0;
  transition: opacity var(--duration) var(--ease-out);
}

.stat:hover {
  transform: translateY(-3px);
  border-color: rgba(56, 189, 248, 0.3);
  box-shadow: var(--shadow-md), var(--shadow-glow);
}

.stat:hover::after {
  opacity: 1;
}

.stat strong,
.stat h4 {
  display: block;
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 2px;
  background: linear-gradient(135deg, var(--cyan), #67e8f9);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat span,
.stat p {
  color: var(--muted);
  font-size: 12px;
  margin: 0;
  font-weight: 500;
}

/* --- Section titles --- */
.section-title {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin: 20px 0 14px;
}

.section-title h2 {
  font-size: 22px;
  font-weight: 800;
  margin: 0 0 4px;
  letter-spacing: -0.02em;
  color: var(--text);
}

.section-title h2::after {
  content: "";
  display: block;
  width: 36px;
  height: 3px;
  margin-top: 8px;
  background: var(--gradient-brand);
  border-radius: 2px;
}

.section-title p {
  color: var(--muted);
  font-size: 13px;
  margin: 0;
  line-height: 1.5;
}

.section-link {
  color: var(--cyan);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(56, 189, 248, 0.2);
  background: rgba(56, 189, 248, 0.06);
  transition: all var(--duration) var(--ease-out);
  white-space: nowrap;
}

.section-link:hover {
  background: rgba(56, 189, 248, 0.14);
  border-color: rgba(56, 189, 248, 0.4);
  transform: translateY(-1px);
  text-decoration: none;
}

/* --- Forms --- */
.form-group {
  margin-bottom: 16px;
}

label {
  display: block;
  margin-bottom: 8px;
  color: #e2e8f0;
  font-size: 13px;
  font-weight: 700;
}

input,
textarea,
select {
  width: 100%;
  padding: 13px 15px;
  border: 1px solid rgba(51, 65, 85, 0.8);
  border-radius: var(--radius-sm);
  background: rgba(15, 23, 42, 0.9);
  color: var(--text);
  outline: none;
  resize: vertical;
  font: inherit;
  font-size: 14px;
  transition: all var(--duration) var(--ease-out);
  box-shadow: var(--shadow-inset);
}

textarea {
  min-height: 120px;
}

input:focus,
textarea:focus,
select:focus {
  border-color: rgba(56, 189, 248, 0.5);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.12), var(--shadow-inset);
}

::placeholder {
  color: #64748b;
}

/* --- Mobile nav --- */
@media (max-width: 1023px) {
  .top-nav,
  .nav {
    gap: 8px;
    padding-block: 8px;
    min-height: 54px;
    overflow: hidden;
  }

  .brand {
    flex: 0 0 auto;
    max-width: 130px;
  }

  .brand-logo {
    width: 34px;
    height: 34px;
  }

  .brand-title {
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .brand-subtitle {
    display: none;
  }

  .nav-links {
    flex: 1 1 auto;
    min-width: 0;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
  }

  .nav-links::-webkit-scrollbar {
    display: none;
  }

  .nav-links a {
    padding: 6px 12px;
    font-size: 12px;
    min-height: 32px;
  }
}

@media (max-width: 768px) {
  .stats {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }

  .stat {
    text-align: center;
    padding: 12px 8px;
  }

  .stat strong,
  .stat h4 {
    font-size: 18px;
  }

  .btn {
    min-height: 40px;
  }

  .section-title {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
}

/* --- Focus states (accessibility) --- */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
.chip:focus-visible,
.option:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}

/* --- Mobile nav toggle --- */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  padding: 8px;
  border: 1px solid rgba(56, 189, 248, 0.2);
  border-radius: var(--radius-sm);
  background: rgba(15, 23, 42, 0.6);
  cursor: pointer;
  flex-shrink: 0;
}

.nav-toggle span {
  display: block;
  height: 2px;
  background: var(--cyan);
  border-radius: 2px;
  transition: all 0.25s ease;
}

.nav-toggle.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle.active span:nth-child(2) {
  opacity: 0;
}

.nav-toggle.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* --- Consent banner --- */
.consent-banner {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 1200;
  width: min(460px, calc(100% - 32px));
  padding: 14px 16px;
  border: 1px solid rgba(56, 189, 248, 0.24);
  border-radius: var(--radius-md);
  background: rgba(2, 6, 23, 0.96);
  box-shadow: 0 14px 30px rgba(2, 6, 23, 0.5);
}

.consent-banner p {
  margin: 0;
  color: #e2e8f0;
  font-size: 14px;
  line-height: 1.5;
}

.consent-banner a {
  color: #38bdf8;
  text-decoration: underline;
}

.consent-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 10px;
}

.consent-actions .btn {
  min-height: 36px;
  padding: 7px 12px;
}

@media (max-width: 768px) {
  .home-header {
    padding-top: env(safe-area-inset-top);
  }

  .home-header .home-nav.top-nav {
    flex-wrap: nowrap;
    align-items: center;
    gap: 10px;
    padding-block: 10px;
  }

  .home-header .home-nav .brand {
    flex: 1;
    min-width: 0;
  }

  .home-header .home-nav .brand-subtitle {
    display: none;
  }

  .top-nav,
  .page-nav,
  .nav {
    flex-wrap: wrap;
    position: relative;
  }

  .nav-toggle {
    display: flex;
    margin-left: auto;
  }

  .nav-links {
    display: none;
    flex-direction: column;
    width: 100%;
    order: 3;
    padding: 12px 0 4px;
    gap: 4px;
    border-top: 1px solid rgba(56, 189, 248, 0.1);
    margin-top: 8px;
  }

  .nav-links.open {
    display: flex;
  }

  .nav-links a {
    width: 100%;
    text-align: left;
    padding: 10px 14px;
  }

  .page-nav .nav-cta {
    display: none;
  }

  .consent-banner {
    left: 12px;
    right: 12px;
    bottom: 12px;
    width: auto;
  }
}
