/* ============================================
   Revive Pipes Marketing Portal
   Shared Stylesheet
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700;800;900&family=Libre+Baskerville:ital,wght@0,400;0,700;1,400&display=swap');

/* ====== RESET ====== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

/* ====== CSS VARIABLES ====== */
:root {
  --blue: #1565C0;
  --blue-deep: #0D47A1;
  --blue-light: #E8F1FB;
  --blue-pale: #F4F8FD;
  --green: #2E7D32;
  --green-light: #E8F5E9;
  --white: #ffffff;
  --gray-50: #FAFBFC;
  --gray-100: #F1F3F5;
  --gray-200: #E5E7EB;
  --gray-300: #D1D5DB;
  --gray-400: #9CA3AF;
  --gray-500: #6B7280;
  --gray-600: #4B5563;
  --gray-700: #374151;
  --gray-800: #1F2937;
  --gray-900: #111827;
  --radius: 16px;
  --radius-sm: 10px;
  --nav-height: 80px;
  --content-max: 1440px;
  --content-pad: 64px;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: 'Montserrat', sans-serif;
  background: var(--white);
  color: var(--gray-900);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.6;
}

/* ====== NAVIGATION ====== */
.nav {
  position: sticky;
  top: 0;
  z-index: 1000;
  width: 100%;
  height: var(--nav-height);
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-bottom: 1px solid rgba(229, 231, 235, 0.9);
  transition: box-shadow 0.3s ease, border-color 0.3s ease;
}

.nav.scrolled {
  border-bottom-color: transparent;
  box-shadow: 0 1px 0 rgba(229, 231, 235, 0.7), 0 8px 32px rgba(0, 0, 0, 0.06);
}

.nav-inner {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--content-pad);
  height: 100%;
  display: flex;
  align-items: stretch;
}

.nav-panel {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0;
}

/* Logo */
.nav-left {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  padding-right: 32px;
  border-right: 1px solid var(--gray-200);
  margin-right: 28px;
}

.nav-logo-link {
  display: flex;
  align-items: center;
  text-decoration: none;
  transition: opacity 0.2s ease;
}

.nav-logo-link:hover {
  opacity: 0.75;
}

.nav-logo {
  height: 38px;
  width: auto;
}

/* Center Links */
.nav-center-wrap {
  flex: 1;
  display: flex;
  justify-content: center;
}

.nav-center {
  display: flex;
  align-items: center;
  gap: 2px;
  list-style: none;
}

.nav-item {
  display: flex;
  position: relative;
}

.nav-link {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--gray-500);
  text-decoration: none;
  padding: 7px 16px;
  border-radius: 8px;
  letter-spacing: 0.01em;
  transition: color 0.18s ease, background-color 0.18s ease;
  white-space: nowrap;
  position: relative;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 16px;
  right: 16px;
  height: 2px;
  background: var(--blue);
  border-radius: 2px 2px 0 0;
  transform: scaleX(0);
  transition: transform 0.2s cubic-bezier(0.34, 1.2, 0.64, 1);
  transform-origin: center;
}

.nav-link:hover {
  color: var(--gray-900);
  background: rgba(17, 24, 39, 0.04);
}

.nav-link.active {
  color: var(--blue);
  background: rgba(21, 101, 192, 0.05);
}

.nav-link.active::after {
  transform: scaleX(1);
}

/* Right side */
.nav-right {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
  padding-left: 28px;
  border-left: 1px solid var(--gray-200);
  margin-left: 28px;
}

.nav-meta,
.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ---- User menu pill + dropdown ---- */
.nav-user-menu {
  position: relative;
}

.nav-user-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px 6px 6px;
  border: 1.5px solid var(--gray-200);
  border-radius: 999px;
  background: var(--white);
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-700);
  white-space: nowrap;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.nav-user-btn:hover {
  border-color: var(--gray-300);
  background: var(--gray-50);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.nav-user-btn.open {
  border-color: var(--gray-900);
  background: var(--gray-50);
}

.nav-user-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--green);
  color: var(--white);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  flex-shrink: 0;
}

.nav-user-name {
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-user-chevron {
  flex-shrink: 0;
  color: var(--gray-400);
  transition: transform 0.2s ease;
}

.nav-user-btn.open .nav-user-chevron {
  transform: rotate(180deg);
}

/* Dropdown panel */
.nav-user-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 220px;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: 14px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.06);
  overflow: hidden;
  z-index: 200;
}

.nav-user-dropdown-info {
  padding: 14px 16px 12px;
}

.nav-user-dropdown-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--gray-900);
  line-height: 1.3;
}

.nav-user-dropdown-email {
  font-size: 12px;
  font-weight: 400;
  color: var(--gray-500);
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-user-dropdown-divider {
  height: 1px;
  background: var(--gray-100);
  margin: 0;
}

.nav-user-signout-btn {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 11px 16px;
  background: none;
  border: none;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-600);
  cursor: pointer;
  text-align: left;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.nav-user-signout-btn:hover {
  background: #FFF5F5;
  color: #C0392B;
}

/* CTA Button */
.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 10px 20px;
  border-radius: 10px;
  background: var(--gray-900);
  color: var(--white);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-decoration: none;
  transition: background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15), 0 2px 10px rgba(0, 0, 0, 0.1);
}

.nav-cta:hover {
  background: var(--gray-800);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.nav-cta-icon {
  width: 16px;
  height: 16px;
  opacity: 0.75;
  flex-shrink: 0;
}

/* Hamburger */
.nav-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 38px;
  height: 38px;
  background: none;
  border: 1px solid var(--gray-200);
  cursor: pointer;
  padding: 9px;
  border-radius: 9px;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.nav-hamburger:hover {
  background: var(--gray-50);
  border-color: var(--gray-300);
}

.nav-hamburger span {
  display: block;
  width: 100%;
  height: 1.5px;
  background: var(--gray-700);
  border-radius: 2px;
  transition: transform 0.28s ease, opacity 0.28s ease;
  transform-origin: center;
}

.nav-hamburger.open span:nth-child(1) {
  transform: rotate(45deg) translate(4.5px, 4.5px);
}

.nav-hamburger.open span:nth-child(2) {
  opacity: 0;
}

.nav-hamburger.open span:nth-child(3) {
  transform: rotate(-45deg) translate(4.5px, -4.5px);
}

/* ====== MOBILE MENU ====== */
.mobile-menu {
  position: fixed;
  top: var(--nav-height);
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 999;
  background: rgba(255, 255, 255, 0.99);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  transform: translateY(-8px);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-menu.open {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.mobile-menu-inner {
  padding: 36px 28px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-width: 520px;
  margin: 0 auto;
}

.mobile-menu-header {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  padding: 16px 20px;
  background: var(--gray-50);
  border-radius: 12px;
  margin-bottom: 8px;
}

.mobile-menu-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--green);
  color: var(--white);
  font-size: 15px;
  font-weight: 800;
  flex-shrink: 0;
}

.mobile-menu-user-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.mobile-menu-user {
  font-size: 14px;
  font-weight: 700;
  color: var(--gray-900);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mobile-menu-email {
  font-size: 12px;
  font-weight: 400;
  color: var(--gray-500);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mobile-signout {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: 100%;
  margin-top: 4px;
  padding: 14px;
  border-radius: 12px;
  border: 1.5px solid var(--gray-200);
  background: none;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-600);
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.mobile-signout:hover {
  background: #FFF5F5;
  border-color: #FECACA;
  color: #C0392B;
}

.mobile-link {
  display: block;
  padding: 16px 20px;
  font-size: 16px;
  font-weight: 600;
  color: var(--gray-600);
  text-decoration: none;
  border-radius: 12px;
  transition: color 0.15s ease, background-color 0.15s ease;
  letter-spacing: 0.01em;
}

.mobile-link:hover {
  color: var(--gray-900);
  background: var(--gray-50);
}

.mobile-link.active {
  color: var(--blue);
  background: rgba(21, 101, 192, 0.06);
}

.mobile-menu-divider {
  height: 1px;
  background: var(--gray-100);
  margin: 16px 0;
}

.mobile-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px;
  border-radius: 12px;
  background: var(--gray-900);
  color: var(--white);
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  letter-spacing: 0.01em;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.mobile-cta:hover {
  background: var(--gray-800);
  transform: translateY(-1px);
}

/* ====== FOOTER ====== */
.footer {
  padding: 40px var(--content-pad);
  border-top: 1px solid var(--gray-200);
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: var(--content-max);
  margin: 0 auto;
}

.footer-text {
  font-size: 14px;
  color: var(--gray-400);
  font-weight: 500;
}

/* ====== COMMON PAGE HEADER ====== */
.page-header {
  padding: 72px var(--content-pad) 56px;
  max-width: var(--content-max);
  margin: 0 auto;
}

.page-header-label {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--blue);
  margin-bottom: 16px;
}

.page-header-title {
  font-family: 'Libre Baskerville', Georgia, serif;
  font-size: clamp(32px, 4vw, 52px);
  font-weight: 700;
  color: var(--gray-900);
  line-height: 1.15;
  margin-bottom: 16px;
}

.page-header-desc {
  font-size: 17px;
  color: var(--gray-500);
  line-height: 1.7;
  max-width: 640px;
}

/* ====== SECTION ====== */
.section {
  padding: 0 var(--content-pad) 96px;
  max-width: var(--content-max);
  margin: 0 auto;
}

.section-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--blue);
  margin-bottom: 36px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.section-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--gray-200);
}

/* Focus treatment for keyboard users */
.nav-logo-link:focus-visible,
.nav-link:focus-visible,
.nav-cta:focus-visible,
.nav-hamburger:focus-visible,
.nav-user-btn:focus-visible,
.nav-user-signout-btn:focus-visible,
.mobile-link:focus-visible,
.mobile-cta:focus-visible,
.mobile-signout:focus-visible {
  outline: 3px solid rgba(21, 101, 192, 0.35);
  outline-offset: 3px;
}

.nav-logo-link:focus-visible,
.nav-link:focus-visible,
.mobile-link:focus-visible {
  border-radius: 10px;
}

/* Fallback when backdrop-filter is unsupported */
@supports not ((backdrop-filter: blur(2px)) or (-webkit-backdrop-filter: blur(2px))) {
  .nav {
    background: #fff;
  }

  .mobile-menu {
    background: #fff;
  }
}

/* ====== RESPONSIVE ====== */

/* Large screens */
@media (min-width: 1800px) {
  :root {
    --content-max: 1600px;
  }
}

/* Laptop */
@media (max-width: 1280px) {
  :root {
    --content-pad: 48px;
  }
}

/* Tablet */
@media (max-width: 1024px) {
  :root {
    --content-pad: 36px;
    --nav-height: 72px;
  }

  .nav-left { padding-right: 20px; margin-right: 0; border-right: none; }
  .nav-right { padding-left: 16px; margin-left: 0; border-left: none; gap: 10px; }
  .nav-center { display: none; }
  .nav-user-menu { display: none; }
  .nav-hamburger { display: flex; }
}

/* Small tablet / large phone */
@media (max-width: 768px) {
  :root {
    --content-pad: 24px;
  }

  .nav-cta .nav-cta-text { display: none; }
  .nav-cta { padding: 9px 11px; border-radius: 9px; }
  .nav-cta-icon { width: 18px; height: 18px; opacity: 1; }
  .mobile-menu-inner { padding: 28px 22px; }
  .mobile-link { padding: 15px 18px; font-size: 15px; }
  .mobile-cta { padding: 16px; font-size: 15px; }

  .page-header { padding-top: 48px; padding-bottom: 40px; }
  .page-header-desc { font-size: 15px; }
  .section { padding-bottom: 64px; }
  .footer { flex-direction: column; gap: 8px; text-align: center; padding: 28px var(--content-pad); }
  .footer-text { font-size: 13px; }
}

/* Phone */
@media (max-width: 480px) {
  :root {
    --content-pad: 20px;
    --nav-height: 64px;
  }

  .nav-logo { height: 34px; }
  .nav-left { padding-right: 12px; }
  .nav-right { padding-left: 12px; gap: 8px; }
  .nav-hamburger { width: 36px; height: 36px; padding: 8px; }
  .mobile-menu-inner { padding: 24px 18px; }
  .page-header-title { font-size: 28px; }
}

/* Respect user motion preferences */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
