/* ============================================================================
   ENHANCED SAAS PUBLIC LAYOUT
   Modern, Professional SaaS Portal Design
   ============================================================================ */

/* Fonts are loaded from layout <head> to avoid @import waterfalls. */

html {
  font-size: 100%;
}

/* Keep original SaaS public styles but enhance them */
body.saas-public {
  background: #f8fafc;
  color: #1e293b;
  font-family: 'Inter', 'Poppins', 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body.saas-public a {
  color: inherit;
  transition: color 200ms ease;
}

.saas-public-skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 2000;
}

.saas-public-skip:focus {
  left: 14px;
  top: 14px;
  background: #ffffff;
  color: #1d4ed8;
  border-radius: 0.5rem;
  padding: 0.625rem 1rem;
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.15);
  font-weight: 600;
}

/* Enhanced Topbar */
.saas-public-topbar {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: #f8fafc;
  font-size: 0.875rem;
  letter-spacing: 0.025em;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.saas-public-topbar-inner {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0 1rem;
}

.saas-public-topbar-left {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.saas-public-topbar-left span {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.saas-public-topbar-left span i {
  font-size: 0.875rem;
}

.saas-public-topbar-right {
  opacity: 0.95;
  font-weight: 500;
}

/* Enhanced Navbar */
.saas-public-navbar {
  top: 42px;
  margin-bottom: 0;
  border: none;
  background: #ffffff;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  transition: box-shadow 300ms ease;
}

.saas-public-navbar.scrolled {
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.saas-public-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 700;
  font-size: 1.25rem;
  color: #0f172a !important;
  transition: opacity 200ms ease;
}

.saas-public-brand:hover {
  opacity: 0.8;
}

.saas-public-brand img {
  width: 40px;
  height: 40px;
  border-radius: 0.5rem;
  object-fit: cover;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.saas-public-nav-links > li > a {
  color: #475569 !important;
  font-weight: 600;
  padding: 1rem 1.25rem;
  position: relative;
  transition: color 200ms ease;
}

.saas-public-nav-links > li > a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%) scaleX(0);
  width: 80%;
  height: 2px;
  background: #1e3a8a;
  transition: transform 300ms ease;
}

.saas-public-nav-links > li.active > a::after,
.saas-public-nav-links > li > a:hover::after,
.saas-public-nav-links > li > a:focus::after {
  transform: translateX(-50%) scaleX(1);
}

.saas-public-nav-links > li.active > a,
.saas-public-nav-links > li > a:hover,
.saas-public-nav-links > li > a:focus {
  color: #1e3a8a !important;
  background: transparent !important;
}

/* Enhanced CTA Buttons */
.saas-public-nav-cta .navbar-btn {
  margin-left: 0.5rem;
  border-radius: 0.5rem;
  font-weight: 600;
  padding: 0.625rem 1.25rem;
  transition: all 200ms cubic-bezier(0.4, 0, 0.2, 1);
  border: none;
}

.saas-public-btn-primary,
body.saas-public .btn.btn-primary.saas-public-btn-primary {
  background: linear-gradient(135deg, #1d4ed8, #1e40af);
  border: 1px solid #1e40af;
  color: #ffffff !important;
  box-shadow: 0 4px 6px -1px rgba(30, 64, 175, 0.35);
}

.saas-public-btn-primary:hover,
.saas-public-btn-primary:focus {
  background: linear-gradient(135deg, #1e40af, #1e3a8a);
  transform: translateY(-2px);
  box-shadow: 0 10px 15px -3px rgba(30, 58, 138, 0.45);
}

.saas-public-btn-outline,
body.saas-public .btn.btn-default.saas-public-btn-outline {
  border: 2px solid #1e3a8a;
  background: transparent;
  color: #1e3a8a !important;
  font-weight: 600;
}

.saas-public-btn-outline:hover,
.saas-public-btn-outline:focus {
  background: #dbeafe;
  border-color: #1e3a8a;
  color: #1e3a8a !important;
  transform: translateY(-1px);
}

/* Content Area */
.saas-public-content {
  padding-top: 100px;
  min-height: 100vh;
}

/* Hero Section Enhancement */
.saas-public-hero {
  position: relative;
  min-height: calc(100vh - 100px);
  overflow: hidden;
  display: flex;
  align-items: center;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #334155 100%);
}

.saas-landing-slider {
  position: absolute;
  inset: 0;
}

.saas-landing-slide {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.saas-landing-slide.active {
  opacity: 1;
  z-index: 1;
}

.saas-landing-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.85), rgba(30, 41, 59, 0.7));
  z-index: 2;
}

.saas-landing-content {
  position: relative;
  z-index: 3;
  width: 100%;
  padding: 3rem 0;
  text-align: center;
  color: #ffffff;
}

.saas-landing-copy {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 1rem;
}

.saas-public-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.75rem;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 9999px;
  padding: 0.5rem 1rem;
  backdrop-filter: blur(10px);
  margin-bottom: 1.5rem;
}

.saas-landing-copy h1 {
  font-size: clamp(2.5rem, 6vw, 4rem);
  line-height: 1.1;
  margin: 0 0 1.5rem 0;
  font-weight: 800;
  letter-spacing: -0.025em;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.saas-landing-copy p {
  font-size: clamp(1.125rem, 2.5vw, 1.5rem);
  line-height: 1.6;
  margin: 0 0 2rem 0;
  color: rgba(255, 255, 255, 0.95);
  font-weight: 400;
}

.saas-landing-actions {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.saas-landing-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 4;
  width: 46px;
  height: 46px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
  font-size: 24px;
  line-height: 1;
}

.saas-landing-nav-btn:hover {
  background: rgba(255, 255, 255, 0.32);
}

.saas-landing-nav-btn.prev {
  left: 20px;
}

.saas-landing-nav-btn.next {
  right: 20px;
}

.saas-landing-dots {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: 22px;
  z-index: 4;
  display: flex;
  gap: 10px;
}

.saas-landing-dot {
  width: 11px;
  height: 11px;
  border-radius: 999px;
  border: none;
  background: rgba(255, 255, 255, 0.44);
}

.saas-landing-dot.active {
  background: #ffffff;
}

.saas-landing-actions .btn {
  padding: 0.875rem 2rem;
  font-size: 1rem;
  font-weight: 700;
  border-radius: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Section Enhancements */
.saas-public-section {
  padding: 5rem 0;
  position: relative;
}

.saas-public-section.saas-public-section-alt {
  background: #ffffff;
}

.saas-public-section-heading {
  max-width: 800px;
  margin: 0 auto 3rem;
  text-align: center;
}

.saas-public-section-heading h2 {
  color: #0f172a;
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 800;
  margin: 0 0 1rem 0;
  letter-spacing: -0.025em;
}

.saas-public-section-heading p {
  color: #475569;
  font-size: 1.125rem;
  line-height: 1.75;
  margin: 0;
}

/* Stats Grid */
.saas-public-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin: 3rem 0;
}

.saas-public-stat {
  border-radius: 1rem;
  padding: 2rem 1.5rem;
  text-align: center;
  background: #ffffff;
  border: 2px solid #e2e8f0;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  transition: all 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

.saas-public-stat:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  border-color: #3b82f6;
}

.saas-public-stat strong {
  display: block;
  color: #3b82f6;
  font-size: 2.5rem;
  line-height: 1;
  font-weight: 800;
  margin-bottom: 0.75rem;
}

.saas-public-stat span {
  display: block;
  color: #475569;
  font-weight: 600;
  font-size: 1rem;
}

/* Card Enhancements */
.saas-public-card {
  background: #ffffff;
  border: 2px solid #e2e8f0;
  border-radius: 1rem;
  padding: 2rem;
  min-height: 100%;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  transition: all 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

.saas-public-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.15), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  border-color: #3b82f6;
}

.saas-public-card h3,
.saas-public-card h4 {
  color: #0f172a;
  font-weight: 700;
  margin-top: 0;
}

.saas-public-card p {
  color: #475569;
  line-height: 1.75;
  margin-bottom: 0;
}

.saas-public-card-icon {
  width: 4rem;
  height: 4rem;
  border-radius: 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: #ffffff;
  margin-bottom: 1.5rem;
  font-size: 1.75rem;
  box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.4);
}

/* CTA Section */
.saas-public-cta {
  background: linear-gradient(135deg, #3b82f6, #2563eb, #1e40af);
  color: #ffffff;
  border-radius: 1.5rem;
  padding: 4rem 3rem;
  text-align: center;
  box-shadow: 0 20px 25px -5px rgba(37, 99, 235, 0.3);
}

.saas-public-cta h2 {
  margin: 0 0 1rem 0;
  font-size: clamp(1.875rem, 4vw, 2.5rem);
  font-weight: 800;
}

.saas-public-cta p {
  margin: 0 0 2rem 0;
  font-size: 1.125rem;
  opacity: 0.95;
}

.saas-public-cta .saas-public-btn-outline {
  border-color: rgba(255, 255, 255, 0.9);
  color: #ffffff !important;
  background: transparent;
  padding: 0.875rem 2rem;
}

.saas-public-cta .saas-public-btn-outline:hover {
  background: #ffffff;
  color: #2563eb !important;
  border-color: #ffffff;
}

/* Enhanced Footer */
.saas-public-footer {
  padding: 4rem 0 2rem;
  background: #0f172a;
  color: rgba(241, 245, 249, 0.9);
  border-top: 1px solid rgba(148, 163, 184, 0.2);
}

.saas-public-footer h4 {
  color: #f8fafc;
  margin-bottom: 1.5rem;
  font-weight: 700;
  font-size: 1.125rem;
}

.saas-public-footer p,
.saas-public-footer a {
  color: rgba(241, 245, 249, 0.8);
  transition: color 200ms ease;
}

.saas-public-footer a:hover,
.saas-public-footer a:focus {
  color: #ffffff;
  text-decoration: none;
}

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

.saas-public-footer-links li {
  margin-bottom: 0.75rem;
}

.saas-public-footer-bottom {
  border-top: 1px solid rgba(148, 163, 184, 0.2);
  margin-top: 3rem;
  padding-top: 2rem;
  text-align: center;
}

.saas-public-footer-bottom p {
  margin: 0;
  font-size: 0.875rem;
}

/* Responsive Design */
@media (max-width: 991px) {
  .saas-public-topbar-right {
    display: none;
  }

  .saas-public-navbar {
    top: 42px;
  }

  .saas-public-content {
    padding-top: 95px;
  }

  .saas-landing-content,
  .saas-public-hero,
  .saas-landing-slider {
    min-height: 600px;
  }

  .saas-public-nav-cta .navbar-btn {
    margin: 0.75rem 1rem;
    display: block;
    width: calc(100% - 2rem);
  }

  .saas-public-section {
    padding: 3rem 0;
  }
}

@media (max-width: 767px) {
  .saas-public-topbar-inner {
    min-height: 38px;
    justify-content: center;
    padding: 0 0.5rem;
  }

  .saas-public-navbar {
    top: 38px;
  }

  .saas-public-content {
    padding-top: 88px;
  }

  .saas-landing-nav-btn {
    display: none;
  }

  .saas-landing-copy h1 {
    font-size: 2.25rem;
  }

  .saas-landing-copy p {
    font-size: 1.125rem;
  }

  .saas-public-section {
    padding: 2.5rem 0;
  }

  .saas-public-stat-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .saas-public-cta {
    padding: 2.5rem 1.5rem;
    border-radius: 1rem;
  }

  .saas-public-card {
    padding: 1.5rem;
  }

  .saas-public-footer {
    padding: 3rem 0 1.5rem;
  }
}

/* Additional Enhancement: Smooth Scrolling */
html {
  scroll-behavior: smooth;
}

/* Loading Animation */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

body.saas-public.saas-animate-sections .saas-public-section > * {
  animation: fadeIn 0.6s ease-out;
}

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

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }

  .saas-public-card:hover,
  .saas-public-stat:hover,
  .saas-public-btn-primary:hover,
  .saas-public-btn-outline:hover {
    transform: none !important;
  }
}
