/* ===============================
   Base & General Styles
================================= */
html,
body {
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  scroll-behavior: smooth;
  font-family: 'Inter', sans-serif;
  font-size: large;
}

.logo {
  width: 30px;
  height: 30px;
}

/* CSS Variables */
:root {
  --spacing-lg: 30px;
  --spacing-md: 20px;
  --transition-default: transform 0.3s ease-in-out;

  /* color palette */
  --color-primary: #007bff;
  --color-success: #198754;
  --color-danger: #dc3545;
  --color-dark: #333;
  --color-light: #f8f9fa;
  --color-muted: #6c757d;
}

/* Utility */
.break {
  width: 50%;
  margin: var(--spacing-lg) auto;
}

.authority-strip {
  margin-top: 0.25rem;
  margin-bottom: 1rem;
}

.authority-title {
  display: block;
  font-weight: 600;
  letter-spacing: 0.2px;
}

.authority-subtitle {
  display: block;
  margin-top: 0.25rem;
  color: #6c757d; /* bootstrap muted */
  font-size: 0.95rem;
}

/* ===============================
   Buttons
================================= */
/* Shared styling for both floating buttons */
.back-to-top,
#floating-lang-toggle {
  position: fixed;
  right: 20px;
  width: 45px;
  height: 45px;
  border-radius: 50%;
  display: none; /* Controlled by JS */
  align-items: center;
  justify-content: center;
  transition:
    transform 0.3s ease,
    background-color 0.3s ease;
  z-index: 1000; /* Higher z-index to stay above sections */
  border: none;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

/* Individual positioning */
.back-to-top {
  bottom: 20px;
}

#floating-lang-toggle {
  bottom: 75px; /* Sits exactly above the back-to-top button */
  font-size: 0.85rem;
  font-weight: bold;
  letter-spacing: 0.5px;
}

/* Hover effects */
.back-to-top:hover,
#floating-lang-toggle:hover {
  transform: scale(1.1);
  background-color: #333; /* Slightly lighter than pure black */
}

/* Ensure icons/text inside are centered */
.back-to-top i,
#floating-lang-toggle span {
  line-height: 1;
}

button[type='submit'] {
  min-width: 180px; /* Adjust based on your longest button text */
  transition: all 0.3s ease;
}

button:disabled {
  background-color: #6c757d !important;
  cursor: not-allowed;
  opacity: 0.7;
}

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

.fade-in.show {
  opacity: 1;
  transform: none;
}

/* ===============================
   Carousel
================================= */
.carousel {
  position: relative;
  max-width: 820px;
  margin: 0 auto;
  overflow: hidden;
  padding: 0 3.5rem;
  border-radius: 1rem;
  background: transparent;
}

.carousel-inner {
  width: 100%;
  height: auto;
  text-align: center;
}

.carousel-control-prev,
.carousel-control-next {
  width: 2rem;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.8;
  transition: opacity 0.3s ease;
  z-index: 5;
}

.carousel-control-prev-icon,
.carousel-control-next-icon {
  filter: invert(100%);
  width: 1.5rem;
  height: 1.5rem;
}

/* ===============================
   Cards
================================= */
.card,
.how-it-works-card {
  border: 1px solid rgba(212, 212, 212, 0.643);
  border-radius: 1rem;
  transition: var(--transition-default);
  box-shadow: 4px 4px 10px rgba(0, 0, 0, 0.05);
}

.card {
  max-width: 550px;
  margin: var(--spacing-md) auto;
  height: auto;
}

.card-text {
  font-size: 1.25rem;
  font-style: italic;
}

/* ===============================
   How It Works Section
================================= */
.how-it-works-container {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1.5rem;
  width: 100%;
  text-align: center;
  margin-bottom: 24px;
}

.how-it-works-card {
  width: 100%;
  max-width: 550px; /* keeps cards centered and balanced on large screens */
  padding: 1rem;
  text-align: center;
  background: #ffffff;
  transition: transform 0.2s ease-in-out;
}

.how-it-works-card:hover {
  transform: scale(1.03);
}

.text-success {
  color: var(--color-success) !important;
}

/* Value section: tighter cards than the big "How it works" cards */
.value-cards .how-it-works-card {
  max-width: 360px;
}

@media (max-width: 991.98px) {
  .how-it-works-container.value-cards .how-it-works-card {
    flex: 1 1 100%;
    max-width: 550px;
  }
}

@media (min-width: 992px) {
  .how-it-works-container.value-cards .how-it-works-card {
    flex: 1 1 calc(50% - 1rem);
    max-width: 360px;
  }
}

/* ===============================
   Language & Scripture Sections
================================= */
.lang-section {
  max-width: 800px;
  margin: 2rem auto;
  padding: 1.5rem;
  line-height: 1.6;
  color: #333;
}

/* ===============================
   Form Styles
================================= */
.form-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.form-row label {
  min-width: 5.75rem;
  width: auto;
  flex-shrink: 0;
  text-align: right;
  font-weight: 500;
  white-space: nowrap;
}

.form-row input,
.form-row textarea {
  flex: 1;
  width: 100%;
  background-color: #fff;
}

.form-row input:focus,
.form-row textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.15);
}

.form-row input:invalid:focus,
.form-row textarea:invalid:focus {
  border-color: var(--color-danger);
  box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.15);
}

.submit-btn {
  padding: 0.6rem 1.5rem;
  font-weight: 500;
  border-radius: 0.5rem;
}

/* Form response messages */
#form-response {
  opacity: 0;
  transition: opacity 0.5s ease-in-out;
  min-height: 1.5em; /* Prevents the layout from jumping when text appears/disappears */
  font-size: 0.9rem;
  margin-top: 0.75rem;
}

#form-response.show {
  opacity: 1;
}

#form-response.success {
  color: #28a745;
}

#form-response.error,
#form-response.failure {
  color: #dc3545;
}
/* ===============================
   Images
================================= */
.profile-img-small,
.profile-img-large {
  border: 1px solid #000;
  border-radius: 12px;
  object-fit: cover;
}

.profile-img-small {
  width: 200px;
  height: 200px;
}

.profile-img-large {
  width: 250px;
  height: 250px;
  box-shadow: 0 0 12px rgba(0, 0, 0, 0.1);
}

/* ===============================
   Misc Elements
================================= */
ul,
p {
  font-weight: 400;
}

/* Language Popup */
.language-popup {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.popup-content {
  background: #fff;
  padding: 2rem;
  border-radius: 12px;
  text-align: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  max-width: 320px;
  width: 90%;
}

/* ============================================================
   GLOBAL & WRAPPER STYLES
============================================================ */
.navbar-wrapper {
  display: flex;
  width: 100%;
}

/* ============================================================
   MOBILE & TABLET (Below 1220px)
   Features: Burger menu, stacked cards, right-aligned nav
============================================================ */
@media (max-width: 1199.98px) {
  /* Navbar Logic */
  .navbar-expand-custom .navbar-toggler {
    display: block;
  }

  .navbar-expand-custom .navbar-collapse {
    background-color: #f8f9fa;
    padding: 0 10px;
    border-radius: 8px;
    margin-top: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  }

  /* Right-Aligned Mobile Menu Content */
  .navbar-wrapper {
    flex-direction: column;
    align-items: flex-end;
  }

  .navbar-nav {
    width: 100%;
    text-align: right;
    flex-direction: column;
  }

  .navbar-nav .nav-link {
    padding-top: 0.8rem;
    padding-bottom: 0.8rem;
    padding-right: 0;
  }

  .nav-item {
    width: 100%;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  }

  .language-toggle {
    /* margin-top: 1.5rem; */
    padding-top: 0.8rem;
    padding-bottom: 0.8rem;
    padding-right: 0;
    display: flex;
    justify-content: flex-end;
    width: 100%;
  }
}

/* ============================================================
   DESKTOP (1221px and Above)
   Features: Horizontal menu, side borders
============================================================ */
@media (min-width: 1200px) {
  /* default layout for standard "how it works" sections (3-up) */
  .how-it-works-container:not(.value-cards):not(.pricing-grid)
    .how-it-works-card {
    flex: 1 1 calc(33.333% - 1rem);
    max-width: 700px;
  }

  /* Navbar Logic */
  .navbar-expand-custom .navbar-toggler {
    display: none;
  }

  .navbar-expand-custom .navbar-collapse {
    display: flex !important;
    flex-basis: auto;
  }

  .navbar-wrapper {
    flex-direction: row;
    align-items: center;
    justify-content: flex-end;
  }

  .navbar-nav {
    flex-direction: row;
  }

  .navbar-nav .nav-link {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  .language-toggle {
    margin-left: 1rem;
  }
}

/* ============================================================
   GENERAL SMALL DEVICE TWEAKS (Under 800px)
============================================================ */
@media (max-width: 800px) {
  .carousel {
    padding: 0 2rem;
  }
  .card-text {
    font-size: 1rem;
  }
  .profile-img-small {
    width: 150px;
    height: 150px;
  }
  .profile-img-large {
    width: 200px;
    height: 200px;
  }

  /* Contact Form Spacing */
  .form-row {
    flex-direction: column;
    align-items: stretch;
    gap: 0.25rem;
  }

  .form-row label {
    width: 100%;
    text-align: left;
  }
  .submit-btn {
    width: 100%;
  }
}

/* ===============================
   Accessibility
================================= */
:focus-visible {
  outline: 3px solid var(--color-primary);
  outline-offset: 2px;
}
@media (prefers-reduced-motion: reduce) {
  .fade-in,
  .how-it-works-card:hover {
    transition: none;
  }
}
