/* IronMeshVPN shared components — gradual migration surface */

/* ---------- Buttons ---------- */
.im-btn,
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 44px;
  padding: 0.7rem 1.15rem;
  border-radius: var(--im-radius-md);
  border: 1px solid var(--im-border-strong);
  background: var(--im-bg-elevated);
  color: var(--im-text);
  font: inherit;
  font-weight: 600;
  font-size: var(--im-text-sm);
  text-decoration: none;
  cursor: pointer;
  transition: background var(--im-dur) var(--im-ease), border-color var(--im-dur) var(--im-ease), color var(--im-dur) var(--im-ease);
}

.im-btn:hover,
.btn:hover {
  border-color: rgba(46, 200, 230, 0.45);
  color: var(--im-text);
  text-decoration: none;
}

.im-btn--primary,
.btn-primary {
  background: linear-gradient(180deg, #39d2ef 0%, var(--im-signal) 100%);
  color: #041018;
  border-color: transparent;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.18) inset;
}

.im-btn--primary:hover,
.btn-primary:hover {
  filter: brightness(1.05);
  color: #041018;
}

.im-btn--ghost,
.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--im-text-muted);
}

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

.im-btn--outline,
.btn-outline {
  background: transparent;
  border-color: var(--im-border-strong);
  color: var(--im-text);
}

.im-btn:disabled,
.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  filter: none;
}

.im-text-link {
  color: var(--im-text-muted);
  text-decoration: none;
  font-weight: 500;
  font-size: var(--im-text-sm);
}

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

/* ---------- Header ---------- */
.im-header {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(16px);
  background: rgba(7, 10, 18, 0.88);
  border-bottom: 1px solid var(--im-border);
}

.im-nav {
  min-height: var(--im-header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--im-space-4);
}

.im-brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  color: var(--im-text);
  flex: 0 1 auto;
  min-width: 0;
}

.im-brand img {
  height: 28px;
  width: 120px;
  max-width: 100%;
  object-fit: contain;
  object-position: left center;
}

@media (min-width: 900px) {
  .im-brand img {
    height: 32px;
    width: 138px;
  }
}

.im-nav-links {
  display: none;
  align-items: center;
  gap: 1.25rem;
}

.im-nav-links a {
  color: var(--im-text-muted);
  text-decoration: none;
  font-size: var(--im-text-sm);
  font-weight: 500;
}

.im-nav-links a:hover {
  color: var(--im-text);
}

.im-nav-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex: 0 0 auto;
  margin-left: auto;
}

@media (max-width: 899px) {
  .im-nav-actions .im-btn,
  .im-nav-actions .btn,
  .im-nav-actions .im-text-link {
    display: none;
  }
}

.im-hamburger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--im-radius-sm);
  border: 1px solid var(--im-border);
  background: transparent;
  color: var(--im-text);
  cursor: pointer;
}

.im-hamburger-lines {
  display: block;
  width: 18px;
  height: 2px;
  background: currentColor;
  box-shadow: 0 -6px 0 currentColor, 0 6px 0 currentColor;
}

@media (min-width: 900px) {
  .im-nav-links {
    display: flex;
  }
  .im-hamburger {
    display: none;
  }
}

.im-mobile-menu {
  display: none;
  border-top: 1px solid var(--im-border);
  padding: var(--im-space-4) 0 var(--im-space-5);
}

.im-mobile-menu.open {
  display: block;
}

.im-mobile-menu a {
  display: block;
  padding: 0.7rem 0;
  color: var(--im-text-muted);
  text-decoration: none;
  font-weight: 500;
}

.im-mobile-menu a:hover {
  color: var(--im-text);
}

.im-mobile-menu .im-btn {
  width: 100%;
  margin-top: var(--im-space-3);
}

/* ---------- Footer ---------- */
.im-footer {
  border-top: 1px solid var(--im-border);
  padding: var(--im-space-8) 0 var(--im-space-6);
  background: rgba(5, 7, 14, 0.65);
}

.im-footer-grid {
  display: grid;
  gap: var(--im-space-6);
}

@media (min-width: 800px) {
  .im-footer-grid {
    grid-template-columns: 1.4fr 1fr 1fr 1fr;
    gap: var(--im-space-5);
  }
}

.im-footer h3,
.im-footer h4 {
  margin: 0 0 var(--im-space-3);
  font-size: var(--im-text-sm);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--im-text-dim);
  font-weight: 600;
}

.im-footer-brand p {
  margin: 0;
  color: var(--im-text-muted);
  font-size: var(--im-text-sm);
  max-width: 22rem;
}

.im-footer-links {
  list-style: none;
  margin: 0;
  padding: 0;
}

.im-footer-links li {
  margin: 0.35rem 0;
}

.im-footer-links a {
  color: var(--im-text-muted);
  text-decoration: none;
  font-size: var(--im-text-sm);
}

.im-footer-links a:hover {
  color: var(--im-text);
}

.im-footer-bottom {
  margin-top: var(--im-space-7);
  padding-top: var(--im-space-4);
  border-top: 1px solid var(--im-border);
  display: flex;
  flex-wrap: wrap;
  gap: var(--im-space-3);
  justify-content: space-between;
  color: var(--im-text-dim);
  font-size: var(--im-text-xs);
}

/* ---------- Pricing compatibility helpers ---------- */
.mini-muted {
  color: var(--im-text-muted);
  font-size: var(--im-text-sm);
}

.spinner {
  display: inline-block;
  width: 0.85rem;
  height: 0.85rem;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-top-color: var(--im-signal);
  border-radius: 50%;
  vertical-align: -0.15em;
  margin-right: 0.4rem;
  animation: im-spin 0.8s linear infinite;
}

@keyframes im-spin {
  to {
    transform: rotate(360deg);
  }
}

button.linkish {
  background: none;
  border: 0;
  padding: 0;
  color: var(--im-signal);
  font: inherit;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

button.linkish:hover {
  color: var(--im-text);
}
