/* ========================================
   MentisViva - Global Styles
   ======================================== */

/* CSS Reset & Variables */
:root {
  --teal: #2B8A9E;
  --teal-dark: #1E6B7B;
  --teal-light: #3BA8BF;
  --teal-bg: #E8F4F7;
  --green: #7AC94F;
  --green-dark: #5FA83A;
  --green-light: #95D972;
  --green-bg: #EFF8E8;
  --white: #FFFFFF;
  --off-white: #F8F9FA;
  --gray-50: #F5F6F7;
  --gray-100: #E9ECEF;
  --gray-200: #DEE2E6;
  --gray-300: #CED4DA;
  --gray-400: #ADB5BD;
  --gray-500: #6C757D;
  --gray-600: #495057;
  --gray-700: #343A40;
  --gray-800: #212529;
  --text-primary: #1A1A2E;
  --text-secondary: #4A4A5A;
  --text-muted: #6C757D;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.12);
  --shadow-xl: 0 20px 60px rgba(0,0,0,0.15);
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 30px;
  --transition: all 0.3s ease;
  --font-serif: 'Cardo', Georgia, serif;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --z-base: 1;
  --z-dropdown: 100;
  --z-navbar: 1000;
  --z-modal: 2000;
  --z-toast: 9999;
}

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

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

body {
  font-family: var(--font-sans);
  color: var(--text-primary);
  background-color: var(--white);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

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

a {
  text-decoration: none;
  color: inherit;
  transition: var(--transition);
}

a:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
}

ul, ol {
  list-style: none;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-serif);
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-primary);
}

h1 { font-size: clamp(2.2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.8rem, 4vw, 2.8rem); }
h3 { font-size: clamp(1.3rem, 3vw, 1.8rem); }
h4 { font-size: clamp(1.1rem, 2vw, 1.4rem); }

p {
  font-size: 1.05rem;
  color: var(--text-secondary);
  line-height: 1.8;
}

/* Container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.container-sm {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ========================================
   Navigation
   ======================================== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  transition: top 0.4s ease, box-shadow 0.3s ease;
}

.navbar.scrolled {
  box-shadow: var(--shadow-sm);
}

/* Hidden navbar for landing page - appears on scroll */
.navbar.navbar-hidden {
  top: -80px;
}

.navbar.navbar-hidden.scrolled {
  top: 0;
}

.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.navbar-logo {
  height: 42px;
  width: auto;
}

.navbar-brand-text {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
}

.navbar-links {
  display: flex;
  align-items: center;
  gap: 8px;
}

.navbar-links a {
  font-size: 0.95rem;
  font-weight: 500;
  padding: 8px 18px;
  border-radius: var(--radius-xl);
  color: var(--text-secondary);
  transition: var(--transition);
  position: relative;
}

.navbar-links a:hover,
.navbar-links a.active {
  color: var(--teal);
  background: var(--teal-bg);
}

.navbar-links a.btn-nav {
  background: var(--teal);
  color: var(--white);
  font-weight: 600;
}

.navbar-links a.btn-nav:hover {
  background: var(--teal-dark);
}

.navbar-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 8px;
  background: none;
  border: none;
}

.navbar-toggle span {
  width: 24px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: var(--transition);
}

/* Mobile menu */
@media (max-width: 768px) {
  .navbar-toggle {
    display: flex;
  }

  .navbar-links {
    position: fixed;
    top: 72px;
    left: 0;
    right: 0;
    background: var(--white);
    flex-direction: column;
    padding: 24px;
    gap: 4px;
    box-shadow: var(--shadow-lg);
    transform: translateY(-20px);
    opacity: 0;
    visibility: hidden;
    transition: transform 0.3s ease, opacity 0.3s ease, visibility 0.3s;
    border-bottom-left-radius: var(--radius-lg);
    border-bottom-right-radius: var(--radius-lg);
    z-index: 99;
  }

  .navbar-links.open {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }

  .navbar-links a {
    width: 100%;
    text-align: center;
    padding: 14px 18px;
    font-size: 1.05rem;
  }
}

/* ========================================
   Buttons
   ======================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 32px;
  border-radius: var(--radius-xl);
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: var(--transition);
  text-align: center;
}

.btn-primary {
  background: var(--teal);
  color: var(--white);
}

.btn-primary:hover {
  background: var(--teal-dark);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(43, 138, 158, 0.3);
}

.btn-secondary {
  background: transparent;
  color: var(--teal);
  border: 2px solid var(--teal);
}

.btn-secondary:hover {
  background: var(--teal);
  color: var(--white);
  transform: translateY(-2px);
}

.btn-green {
  background: var(--green);
  color: var(--white);
}

.btn-green:hover {
  background: var(--green-dark);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(122, 201, 79, 0.3);
}

.btn-white {
  background: var(--white);
  color: var(--teal);
}

.btn-white:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn-primary:focus-visible,
.btn-secondary:focus-visible,
.btn-green:focus-visible,
.btn-white:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
}

.btn-lg {
  padding: 18px 42px;
  font-size: 1.1rem;
}

.btn-sm {
  padding: 10px 24px;
  font-size: 0.9rem;
  min-height: 44px;
}

/* ========================================
   Sections
   ======================================== */
.section {
  padding: 100px 0;
}

.section-sm {
  padding: 60px 0;
}

.section-header {
  text-align: center;
  max-width: 700px;
  margin: 0 auto 60px;
}

.section-header h2 {
  margin-bottom: 16px;
}

.section-header p {
  font-size: 1.1rem;
  color: var(--text-muted);
}

.section-label {
  display: inline-block;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--teal);
  margin-bottom: 12px;
  font-family: var(--font-sans);
}

.section-bg {
  background: var(--gray-50);
}

/* ========================================
   Cards
   ======================================== */
.card {
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 36px;
  transition: var(--transition);
  border: 1px solid var(--gray-100);
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: transparent;
}

.card-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  margin-bottom: 20px;
}

.card-icon.teal {
  background: var(--teal-bg);
  color: var(--teal);
}

.card-icon.green {
  background: var(--green-bg);
  color: var(--green);
}

.card-icon.celeste {
  background: var(--teal-bg);
  color: var(--teal-light);
}

.card h3 {
  margin-bottom: 12px;
  font-size: 1.3rem;
}

.card p {
  font-size: 0.98rem;
  color: var(--text-muted);
}

/* ========================================
   Hero Banner
   ======================================== */
.hero-banner {
  position: relative;
  min-height: 420px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 120px 24px 80px;
  overflow: hidden;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.hero-banner::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(43, 138, 158, 0.88) 0%, rgba(30, 107, 123, 0.92) 50%, rgba(26, 92, 107, 0.95) 100%);
  z-index: 1;
}

.hero-banner .hero-content {
  position: relative;
  z-index: 2;
  max-width: 700px;
}

.hero-banner h1 {
  color: var(--white);
  margin-bottom: 20px;
  font-size: clamp(2rem, 5vw, 3.2rem);
}

.hero-banner p {
  color: rgba(255, 255, 255, 0.9);
  font-size: 1.2rem;
  line-height: 1.7;
}

.hero-banner .hero-decoration {
  position: absolute;
  border-radius: 50%;
  opacity: 0.08;
  background: var(--white);
  z-index: 1;
  pointer-events: none;
}

/* Subpage banner - larger + CMS overlay control */
.subpage-banner {
  min-height: 500px;
}

.subpage-banner::before {
  background: linear-gradient(135deg,
    rgba(43, 138, 158, var(--overlay-opacity, 0.88)) 0%,
    rgba(30, 107, 123, var(--overlay-opacity, 0.92)) 50%,
    rgba(26, 92, 107, var(--overlay-opacity, 0.95)) 100%);
}

/* ========================================
   Testimonials
   ======================================== */
.testimonials-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 30px;
}

.testimonial-card {
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 36px;
  border: 1px solid var(--gray-100);
  position: relative;
  transition: var(--transition);
}

.testimonial-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.testimonial-card .quote-icon {
  font-size: 2.5rem;
  color: var(--teal-bg);
  font-family: var(--font-serif);
  line-height: 1;
  margin-bottom: 12px;
}

.testimonial-card .testimonial-text {
  font-style: italic;
  color: var(--text-secondary);
  margin-bottom: 20px;
  font-size: 1rem;
  line-height: 1.7;
}

.testimonial-card .testimonial-author {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.95rem;
}

.testimonial-card .testimonial-stars {
  color: #F4B942;
  margin-bottom: 16px;
  font-size: 0.9rem;
}

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

.form-group label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.form-control {
  width: 100%;
  padding: 14px 18px;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 1rem;
  color: var(--text-primary);
  background: var(--white);
  transition: var(--transition);
}

.form-control:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(43, 138, 158, 0.25);
}

textarea.form-control {
  resize: vertical;
  min-height: 120px;
}

select.form-control {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236C757D' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 40px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

@media (max-width: 600px) {
  .form-row {
    grid-template-columns: 1fr;
  }
}

/* ========================================
   Footer
   ======================================== */
.footer {
  background: var(--gray-800);
  color: rgba(255, 255, 255, 0.8);
  padding: 80px 0 30px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 50px;
}

.footer-brand img {
  height: 48px;
  margin-bottom: 20px;
}

.footer-brand p {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.95rem;
  line-height: 1.7;
}

.footer h4 {
  color: var(--white);
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 20px;
}

.footer-links a {
  display: block;
  color: rgba(255, 255, 255, 0.6);
  padding: 6px 0;
  font-size: 0.95rem;
}

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

.footer-social {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}

.footer-social a {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.7);
  font-size: 1rem;
  transition: var(--transition);
}

.footer-social a:hover {
  background: var(--teal);
  color: var(--white);
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 30px;
  text-align: center;
  color: rgba(255, 255, 255, 0.4);
  font-size: 0.9rem;
}

.footer-credit {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.3);
  margin-top: 8px;
}

@media (max-width: 768px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 30px;
  }
}

@media (max-width: 480px) {
  .footer-grid {
    grid-template-columns: 1fr;
  }
}

/* ========================================
   Animations
   ======================================== */
.fade-in {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

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

.fade-in-left {
  opacity: 0;
  transform: translateX(-30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

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

.fade-in-right {
  opacity: 0;
  transform: translateX(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

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

/* Stagger children animations */
.stagger-children > * {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.stagger-children.visible > *:nth-child(1) { transition-delay: 0s; }
.stagger-children.visible > *:nth-child(2) { transition-delay: 0.1s; }
.stagger-children.visible > *:nth-child(3) { transition-delay: 0.2s; }
.stagger-children.visible > *:nth-child(4) { transition-delay: 0.3s; }
.stagger-children.visible > *:nth-child(5) { transition-delay: 0.4s; }
.stagger-children.visible > *:nth-child(6) { transition-delay: 0.5s; }

.stagger-children.visible > * {
  opacity: 1;
  transform: translateY(0);
}

/* ========================================
   Utilities
   ======================================== */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-teal { color: var(--teal); }
.text-green { color: var(--green); }
.text-white { color: var(--white); }
.text-muted { color: var(--text-muted); }

.bg-teal { background: var(--teal); }
.bg-green { background: var(--green); }
.bg-gray { background: var(--gray-50); }
.bg-white { background: var(--white); }

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 40px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 40px; }

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 30px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 30px;
}

@media (max-width: 900px) {
  .grid-3, .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .grid-2, .grid-3, .grid-4 {
    grid-template-columns: 1fr;
  }

  .section {
    padding: 60px 0;
  }

  .section-header {
    margin-bottom: 40px;
  }
}

/* ========================================
   Mobile Carousel (swipe)
   ======================================== */
@media (max-width: 768px) {
  .mobile-carousel {
    display: flex !important;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    gap: 16px;
    padding-bottom: 12px;
    scrollbar-width: none;
    grid-template-columns: unset !important;
  }

  .mobile-carousel::-webkit-scrollbar {
    display: none;
  }

  .mobile-carousel > * {
    scroll-snap-align: start;
    flex: 0 0 85%;
    max-width: 85%;
    min-width: 0;
  }

  .mobile-carousel-dots {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 12px;
  }

  .mobile-carousel-dots .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--gray-200);
    transition: background 0.3s;
  }

  .mobile-carousel-dots .dot.active {
    background: var(--teal);
    width: 20px;
    border-radius: 4px;
  }
}

@media (min-width: 769px) {
  .mobile-carousel-dots {
    display: none !important;
  }
}

/* Carousel progress bar (replaces dots) */
.carousel-progress {
  width: 120px;
  height: 2px;
  background: var(--gray-200);
  border-radius: 2px;
  margin: 16px auto 0;
  overflow: hidden;
}

.carousel-progress-bar {
  height: 100%;
  width: 30%;
  background: var(--teal-light);
  border-radius: 2px;
  transition: width 0.1s, transform 0.1s;
}

/* Toast notification */
.toast {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background: var(--gray-800);
  color: var(--white);
  padding: 16px 24px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xl);
  font-size: 0.95rem;
  z-index: 9999;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s ease;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.toast.success {
  background: var(--green);
}

.toast.error {
  background: #E74C3C;
}
