/* =====================================================
   AutoFlex Capital - Enhanced Layout Styles
   -----------------------------------------------------
   Includes "Our Services", "How It Works", smooth scroll,
   styled buttons, and Apply Now popup form.
   ===================================================== */

/* ----------------------------
   GLOBAL SCROLL FIX
----------------------------- */
html {
  scroll-behavior: smooth;
  scroll-padding-top: 90px; /* Prevents navbar from covering sections */
}

/* ----------------------------
   BASE STYLES
----------------------------- */
body {
  font-family: 'Poppins', sans-serif;
  color: #1f2937;
  background-color: #ffffff;
  scroll-behavior: smooth;
}

a {
  transition: color 0.3s ease;
}
a:hover {
  color: #dc2626;
}

/* ----------------------------
   HEADER & NAVBAR
----------------------------- */
header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background: transparent;
  transition: all 0.3s ease;
  z-index: 50;
}

header.scrolled {
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 6px 18px rgba(10, 34, 78, 0.1);
  backdrop-filter: blur(6px);
}

nav a {
  font-weight: 500;
  transition: all 0.3s ease;
}
nav a:hover {
  color: #dc2626;
}
nav a.active {
  color: #0b2249;
  border-bottom: 2px solid #dc2626;
}

.nav-btn {
  background-color: #dc2626;
  color: white;
  padding: 0.5rem 1.5rem;
  border-radius: 9999px;
  font-weight: 500;
  transition: background 0.3s ease, transform 0.25s ease;
}
.nav-btn:hover {
  background-color: #b91c1c;
  transform: translateY(-2px);
}

/* ----------------------------
   BUTTONS
----------------------------- */
button,
.btn {
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
button:hover,
.btn:hover {
  transform: translateY(-3px);
}

/* "View More" Button Styling */
#viewMoreBtn {
  background-color: #0b2249;
  color: white;
  transition: background 0.3s ease, transform 0.3s ease;
}
#viewMoreBtn:hover {
  background-color: #dc2626;
  transform: translateY(-3px);
}

/* =====================================================
   OUR SERVICES SECTION
   ===================================================== */
#services {
  background: linear-gradient(135deg, #eff6ff, #f8fafc);
  padding: 6rem 1.5rem;
  text-align: center;
}

#services .section-title {
  color: #0b2249;
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

#services .section-subtitle {
  color: #64748b;
  margin-bottom: 3rem;
  font-size: 1rem;
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.75rem;
}

.service-card {
  background: #ffffff;
  border-radius: 1.25rem;
  box-shadow: 0 6px 20px rgba(11, 34, 73, 0.06);
  padding: 2rem 1.5rem;
  transition: transform 0.35s ease, box-shadow 0.35s ease, background 0.3s ease;
  text-align: left;
}

.service-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 30px rgba(11, 34, 73, 0.12);
  background: linear-gradient(135deg, #ffffff, #eff6ff);
}

.service-icon {
  background-color: #dbeafe;
  color: #1d4ed8;
  font-size: 1.75rem;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  transition: transform 0.3s ease, background 0.3s ease;
}

.service-card:hover .service-icon {
  background-color: #dc2626;
  color: white;
  transform: rotate(8deg) scale(1.1);
}

.service-card h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: #0b2249;
}

.service-card p {
  color: #64748b;
  font-size: 0.95rem;
  line-height: 1.6;
}

/* =====================================================
   HOW IT WORKS SECTION
   ===================================================== */
#how-it-works {
  background: #ffffff;
  padding: 6rem 1.5rem;
  text-align: center;
  border-top: 1px solid #e2e8f0;
}

#how-it-works .section-title {
  color: #0b2249;
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

#how-it-works .section-subtitle {
  color: #64748b;
  margin-bottom: 3rem;
}

.steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  align-items: stretch;
}

.step-card {
  background: linear-gradient(145deg, #f9fafb, #ffffff);
  border-radius: 1rem;
  padding: 2rem 1.5rem;
  box-shadow: 0 8px 24px rgba(11, 34, 73, 0.06);
  transition: all 0.35s ease;
  text-align: left;
  position: relative;
  overflow: hidden;
}

.step-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 30px rgba(11, 34, 73, 0.1);
}

.step-number {
  font-size: 2.5rem;
  font-weight: 800;
  color: rgba(29, 78, 216, 0.12);
  position: absolute;
  top: 1rem;
  right: 1.5rem;
}

.step-card h3 {
  color: #0b2249;
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.step-card p {
  color: #64748b;
  font-size: 0.95rem;
  line-height: 1.6;
}

/* ----------------------------
   SCROLL-TRIGGERED ANIMATIONS
----------------------------- */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.8s cubic-bezier(0.17, 0.67, 0.83, 0.67);
}
.animate-on-scroll.visible {
  opacity: 1;
  transform: translateY(0);
}

/* =====================================================
   APPLY NOW POPUP
   ===================================================== */
.popup-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(11, 34, 73, 0.65);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
}

.popup-content {
  background: #fff;
  border-radius: 1rem;
  padding: 2rem;
  width: 90%;
  max-width: 420px;
  position: relative;
  animation: fadeIn 0.4s ease;
}

.close-btn {
  position: absolute;
  top: 10px; right: 16px;
  font-size: 1.5rem;
  cursor: pointer;
  color: #555;
}

.popup-content h2 {
  color: #0b2249;
  font-weight: 700;
  margin-bottom: 0.5rem;
  text-align: center;
}

.popup-content .subtitle {
  color: #6b7280;
  text-align: center;
  margin-bottom: 1.5rem;
}

.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  font-weight: 500;
  color: #374151;
  margin-bottom: 0.3rem;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 0.6rem;
  border-radius: 0.5rem;
  border: 1px solid #d1d5db;
  font-size: 0.95rem;
  outline: none;
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: #1d4ed8;
  box-shadow: 0 0 0 2px rgba(29, 78, 216, 0.15);
}

@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

/* ----------------------------
   TEXT UTILITIES
----------------------------- */
.section-title {
  font-size: 1.6rem;
  color: #0b2249;
  font-weight: 700;
}
.section-subtitle {
  color: #6b7280;
  max-width: 700px;
  margin: 0 auto;
}

/* ----------------------------
   RESPONSIVE TWEAKS
----------------------------- */
@media (max-width: 768px) {
  .section-title {
    font-size: 1.25rem;
  }
  #home h1 {
    font-size: 1.6rem;
  }

  .service-card, .step-card {
    text-align: center;
  }

  .service-icon {
    margin: 0 auto 1rem auto;
  }

/* Form container */
#contact {
    max-width: 700px;
    margin: 2rem auto;
    padding: 2rem;
    background-color: #ffffff;
    border-radius: 1rem;
    box-shadow: 0 10px 25px rgba(11, 34, 73, 0.1);
    transition: transform 0.3s ease, opacity 0.3s ease;
}

/* Headings */
#contact h4 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: #0b2249;
}

#contact p {
    font-size: 0.875rem;
    color: #6b7280;
    margin-bottom: 1rem;
}

/* Form inputs */
#contact input,
#contact select,
#contact textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    outline: none;
}

#contact input:focus,
#contact select:focus,
#contact textarea:focus {
    border-color: #1d4ed8;
    box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.2);
}

/* Textarea */
#contact textarea {
    resize: vertical;
}

/* Button */
#contact button {
    background-color: #dc2626;
    color: #ffffff;
    padding: 0.75rem 1.25rem;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.3s ease;
}

#contact button:hover {
    background-color: #b91c1c;
}

/* Form status message */
#formStatus {
    font-size: 0.875rem;
    font-weight: 500;
    color: #16a34a;
}

/* Grid layout for responsive forms */
#contact .grid {
    display: grid;
    gap: 0.75rem;
}

@media (min-width: 768px) {
    #contact .grid-cols-2 {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Animations */
.animate-on-scroll {
    opacity: 0;
    transform: scale(0.95);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.animate-on-scroll.animate-zoom {
    opacity: 1;
    transform: scale(1);
}

/* Additional spacing for smaller elements */
.mt-2 {
    margin-top: 0.5rem;
}

.mt-3 {
    margin-top: 0.75rem;
}

.mt-4 {
    margin-top: 1rem;
}

.mb-3 {
    margin-bottom: 0.75rem;
}

.mb-4 {
    margin-bottom: 1rem;
}

/* Rounded corners utility */
.rounded-md {
    border-radius: 0.5rem;
}

/* Shadows utility */
.shadow {
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

/* Transition utility */
.transition {
    transition: all 0.3s ease;
}
/* Focus ring utility */
.focus\:ring-2:focus {
    box-shadow: 0 0 0 2px rgba(29, 78, 216, 0.2);
}
}
