/* ============================================
   MAGTIBAY HUB - Main Stylesheet
   style.css
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Inter:wght@400;500;600&display=swap');

/* ---- CSS Variables ---- */
:root {
  color-scheme: light;
  --green:       #16a34a;
  --green-light: #22c55e;
  --blue:        #2563eb;
  --blue-light:  #3b82f6;
  --grad:        linear-gradient(135deg, #16a34a, #2563eb);
  --grad-h:      linear-gradient(135deg, #15803d, #1d4ed8);

  --bg:          #f7f9fc;
  --bg2:         #ffffff;
  --bg3:         #eef2f8;
  --nav-bg:      #ffffff;
  --card-bg:     #ffffff;
  --card-bg2:    #f1f5f9;

  --text:        #0f172a;
  --text2:       #475569;
  --text3:       #94a3b8;
  --border:      #e2e8f0;
  --shadow:      0 4px 24px rgba(0,0,0,0.07);
  --shadow-sm:   0 1px 4px rgba(0,0,0,0.06);

  --radius:      12px;
  --radius-sm:   8px;
  --radius-lg:   20px;
  --transition:  all 0.3s ease;
}

/* ---- Dark Mode Colors ---- */
.dark-mode {
  color-scheme: dark;
  --bg:          #0f172a;
  --bg2:         #1e293b;
  --bg3:         #334155;
  --nav-bg:      #0f172a;
  --card-bg:     #1e293b;
  --card-bg2:    #334155;

  --text:        #f8fafc;
  --text2:       #cbd5e1;
  --text3:       #94a3b8;
  --border:      #334155;
  --shadow:      0 10px 30px rgba(0,0,0,0.3);
}

/* ---- Reset & Base ---- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
  overflow-y: scroll; /* Force vertical scrollbar visibility */
  scrollbar-gutter: stable; /* Pinaka-importante: rereserba ng space para hindi umusog ang content */
  background-color: var(--bg); /* Mahalaga para sa seamless loading */
}

/* Consistent Scrollbar Width para maiwasan ang layout shift */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

body {
  font-family: 'Plus Jakarta Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  min-width: 0;
  padding-top: 64px; /* Same height as navbar-inner to prevent content jump */
}

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

a { text-decoration: none; color: inherit; }

/* ---- Utility ---- */
.grad-text {
  background: var(--grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.btn-primary {
  background: var(--grad);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 10px 22px;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.btn-primary:hover {
  background: var(--grad-h);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(22,163,74,0.35);
}

.btn-outline {
  background: transparent;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 22px;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text2);
  cursor: pointer;
  transition: var(--transition);
}
.btn-outline:hover {
  border-color: var(--green);
  color: var(--green);
}

.section-label {
  display: inline-block;
  background: linear-gradient(135deg,#dcfce7,#dbeafe);
  color: var(--green);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 14px;
  border-radius: 50px;
  margin-bottom: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.section-title {
  font-size: clamp(1.4rem, 3vw, 1.9rem);
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: 0.5rem;
}

.section-sub {
  color: var(--text2);
  font-size: 0.95rem;
  margin-bottom: 2rem;
}

/* ---- PAGE LOADER ---- */
.page-loader {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}
.page-loader.hidden {
  opacity: 0;
  visibility: hidden;
}
.loader-content {
  text-align: center;
}
.loader-logo {
  width: 80px;
  height: 80px;
  margin: 0 auto 18px;
  animation: pulse 1.5s infinite ease-in-out;
}
.loader-line {
  width: 150px;
  height: 4px;
  margin: 0 auto;
  background: var(--bg3);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}
.loader-line span {
  display: block;
  width: 45%;
  height: 100%;
  border-radius: inherit;
  background: var(--grad);
  animation: loadingLine 1.1s ease-in-out infinite;
}

/* Logo Visibility Logic (Prevents Blinking) */
.logo-dark { display: none !important; }
.dark-mode .logo-dark { display: block !important; }
.dark-mode .logo-light { display: none !important; }

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(0.9); opacity: 0.8; }
}
@keyframes loadingLine {
  0% { transform: translateX(-110%); }
  50% { transform: translateX(70%); }
  100% { transform: translateX(230%); }
}

/* ---- NAVBAR ---- */
/* Bootstrap 5 is loaded — use !important to override its .navbar/.navbar-brand/.navbar-nav classes */
.navbar {
  position: absolute !important;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 1000;
  background: var(--nav-bg) !important;
  border-bottom: 1px solid var(--border);
  border-radius: 0 !important;
  padding: 0 !important;
  display: block !important;
  transition: var(--transition);
}

.navbar-inner {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 1.25rem;
  height: 64px;
  display: flex !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  gap: 1rem;
}

.navbar-inner .navbar-brand {
  flex: 1 1 0;
  min-width: 0;
  padding: 0 !important;
  margin-right: 0 !important;
}

.navbar-inner nav {
  flex: 0 0 auto;
  display: flex !important;
  align-items: center;
}

.navbar-inner .navbar-right {
  flex: 1 1 0;
  min-width: 0;
  display: flex !important;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

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

.navbar-logo {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  object-fit: cover;
}

.navbar-sitename {
  font-size: 1.05rem;
  font-weight: 800;
}

.navbar-nav {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  gap: 0.25rem;
  list-style: none;
  margin-bottom: 0 !important;
}

.navbar-nav .nav-item,
.navbar-nav li {
  display: block;
}

.navbar-nav a,
.navbar-nav .nav-link {
  display: inline-block !important;
  padding: 6px 14px !important;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text2) !important;
  transition: var(--transition);
  white-space: nowrap;
}
.navbar-nav a:hover,
.navbar-nav .nav-link:hover,
.navbar-nav a.active,
.navbar-nav .nav-link.active { color: var(--green) !important; background: var(--bg3); }

.navbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

/* ---- THEME TOGGLE (single icon button) ---- */
.theme-switch {
  display: flex;
  align-items: center;
}

.theme-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--bg3);
  border: 1.5px solid var(--border);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s ease, border-color 0.3s ease,
              transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
              box-shadow 0.3s ease;
  outline: none;
  overflow: hidden;
  position: relative;
}
.theme-btn:hover {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(22,163,74,0.15);
  transform: rotate(20deg) scale(1.08);
}
.theme-btn:active { transform: scale(0.92); }

/* The SVG icon inside */
.theme-btn svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
  color: var(--text);
  fill: var(--text);
}

/* Dark mode: show moon, rotate effect */
.dark-mode .theme-btn {
  background: var(--bg3);
  border-color: var(--border);
}
.dark-mode .theme-btn svg {
  transform: rotate(360deg);
}

/* ---- SCROLL TO TOP FAB ---- */
.scroll-top-btn {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 990;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--grad);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(22,163,74,0.35);
  opacity: 0;
  visibility: hidden;
  transform: translateY(16px) scale(0.85);
  transition: opacity 0.35s ease, visibility 0.35s ease,
              transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1),
              box-shadow 0.3s ease;
}
.scroll-top-btn.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}
.scroll-top-btn:hover {
  box-shadow: 0 8px 24px rgba(22,163,74,0.5);
  transform: translateY(-3px) scale(1.08);
}
.scroll-top-btn:active {
  transform: scale(0.92);
}
.scroll-top-btn svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: #fff;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---- HAMBURGER BUTTON ---- */
.navbar-toggler {
  display: none;
  background: none !important;
  border: 1.5px solid var(--border) !important;
  border-radius: var(--radius-sm) !important;
  padding: 8px 10px !important;
  cursor: pointer;
  color: var(--text) !important;
  box-shadow: none !important;
  outline: none;
  width: 42px;
  height: 38px;
  align-items: center;
  justify-content: center;
}
.navbar-toggler:focus {
  box-shadow: none !important;
  outline: none !important;
}

/* 3-bar hamburger icon */
.hamburger-icon {
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: 20px;
}
.hamburger-icon span {
  display: block;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  transform-origin: center;
}
/* Animate to X when open */
.navbar-toggler.is-open .hamburger-icon span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.navbar-toggler.is-open .hamburger-icon span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}
.navbar-toggler.is-open .hamburger-icon span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ---- MOBILE FULLSCREEN OVERLAY ---- */
.mobile-overlay {
  position: fixed;
  inset: 0;
  z-index: 999;
  background: var(--nav-bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  /* Hidden state */
  opacity: 0;
  visibility: hidden;
  transform: translateY(-16px);
  transition: opacity 0.35s cubic-bezier(0.4, 0, 0.2, 1),
              visibility 0.35s,
              transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}
.mobile-overlay.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* Close X button */
.mobile-overlay-close {
  position: absolute;
  top: 18px;
  right: 20px;
  background: none;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  width: 42px;
  height: 38px;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}
.mobile-overlay-close:hover {
  border-color: var(--green);
  color: var(--green);
}

/* Nav links */
.mobile-overlay-nav {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  width: 100%;
}

.mobile-nav-link {
  display: block;
  width: 100%;
  text-align: center;
  padding: 18px 2rem;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid var(--border);
  transition: color 0.2s, background 0.2s;
  /* Stagger animation */
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.3s ease, transform 0.3s ease, color 0.2s, background 0.2s;
}
.mobile-overlay.open .mobile-nav-link:nth-child(1) { opacity: 1; transform: translateY(0); transition-delay: 0.05s; }
.mobile-overlay.open .mobile-nav-link:nth-child(2) { opacity: 1; transform: translateY(0); transition-delay: 0.10s; }
.mobile-overlay.open .mobile-nav-link:nth-child(3) { opacity: 1; transform: translateY(0); transition-delay: 0.15s; }
.mobile-overlay.open .mobile-nav-link:nth-child(4) { opacity: 1; transform: translateY(0); transition-delay: 0.20s; }
.mobile-overlay.open .mobile-nav-link:nth-child(5) { opacity: 1; transform: translateY(0); transition-delay: 0.25s; }

.mobile-nav-link:first-child { border-top: 1px solid var(--border); }
.mobile-nav-link:hover,
.mobile-nav-link.active { color: var(--green); background: var(--bg3); }

/* CTA button */
.mobile-overlay-cta {
  margin-top: 2rem;
  width: calc(100% - 4rem);
  max-width: 340px;
  justify-content: center;
  padding: 14px 24px !important;
  font-size: 1rem !important;
  border-radius: var(--radius) !important;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.3s ease 0.30s, transform 0.3s ease 0.30s, background 0.2s;
}
.mobile-overlay.open .mobile-overlay-cta {
  opacity: 1;
  transform: translateY(0);
}

/* ---- HERO ---- */
.hero {
  background: linear-gradient(135deg, #e8f5e9 0%, #e3f2fd 50%, #f0fdf4 100%);
  padding: 4rem 1.25rem 3rem;
  overflow: hidden;
}

.hero-inner {
  max-width: 1140px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,0.8);
  border: 1px solid var(--border);
  border-radius: 50px;
  padding: 5px 14px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text2);
  margin-bottom: 1rem;
}

.hero h1 {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 800;
  line-height: 1.18;
  margin-bottom: 1rem;
}

.hero-desc {
  color: var(--text2);
  font-size: 1rem;
  line-height: 1.7;
  margin-bottom: 1.5rem;
  max-width: 440px;
}

.hero-btns {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.hero-stats {
  display: flex;
  gap: 1.5rem;
  margin-top: 2rem;
  flex-wrap: wrap;
}

.hero-stat-item .num {
  font-size: 1.4rem;
  font-weight: 800;
}
.hero-stat-item .lbl {
  font-size: 0.75rem;
  color: var(--text2);
  font-weight: 500;
}

/* Loan Calculator Card */
.calc-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow);
  transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}
.calc-card:hover {
  border-color: rgba(22, 163, 74, 0.45);
  transform: translateY(-4px);
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.12);
}

.calc-card-title {
  font-size: 1rem;
  font-weight: 800;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.calc-field { margin-bottom: 1rem; }
.calc-field label {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text2);
  margin-bottom: 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.amount-display {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 0.4rem;
}
.amount-display sup { font-size: 1rem; color: var(--text2); }

input[type="range"] {
  width: 100%;
  accent-color: var(--green);
  cursor: pointer;
}

.calc-selects {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 1rem;
}

.calc-selects select,
.form-select,
.form-control {
  width: 100%;
  background: var(--bg3);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  font-family: inherit;
  font-size: 0.88rem;
  color: var(--text);
  transition: all 0.2s ease;
  appearance: none;
  -webkit-appearance: none;
  line-height: 1.5;
  max-width: 100%;
}

/* Fix placeholder visibility in Dark Mode */
.form-control::placeholder {
  color: var(--text3);
  opacity: 1; /* Para sa Firefox compatibility */
}

/* Custom Arrow at Hover para sa Dropdowns */
.form-select, .calc-selects select {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23475569' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 14px;
  padding-right: 40px;
}

.dark-mode .form-select, .dark-mode .calc-selects select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
}

.form-control:hover, .form-select:hover {
  border-color: var(--text3);
}

.form-control:focus, .form-select:focus {
  outline: none;
  border-color: var(--green);
  background-color: var(--bg2);
  box-shadow: 0 0 0 4px rgba(22, 163, 74, 0.1);
  transform: translateY(-1px);
}

.file-input {
  padding: 8px !important;
  font-size: 0.8rem !important;
  cursor: pointer;
}

.insurance-note {
  background: linear-gradient(135deg, #f0fdf4, #eff6ff);
  border: 1px solid #bbf7d0;
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin-bottom: 1rem;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--text2);
}
.insurance-note .ins-icon { font-size: 1.1rem; flex-shrink: 0; }
.insurance-note strong { color: var(--green); }

.result-box {
  background: var(--grad);
  border-radius: var(--radius-sm);
  padding: 1rem 1.25rem;
  color: #fff;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
  margin-bottom: 1rem;
  text-align: center;
}
.result-box .r-label { font-size: 0.7rem; opacity: 0.85; margin-bottom: 2px; }
.result-box .r-value { font-size: 1.1rem; font-weight: 800; }
.result-box .r-divider {
  border-left: 1px solid rgba(255,255,255,0.3);
  border-right: 1px solid rgba(255,255,255,0.3);
}

.btn-apply-full {
  width: 100%;
  background: var(--grad);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 13px;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.btn-apply-full:hover { background: var(--grad-h); transform: translateY(-1px); }

/* ---- TRUST STRIP ---- */
.trust-strip {
  background: var(--card-bg);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.trust-strip-inner {
  max-width: 1140px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  text-align: center;
}
.trust-item .t-num {
  font-size: 1.6rem;
  font-weight: 800;
}
.trust-item .t-lbl {
  font-size: 0.75rem;
  color: var(--text2);
  font-weight: 500;
}

/* ---- PRODUCTS SECTION ---- */
.products-section {
  padding: 4rem 1.25rem;
}
.products-inner {
  max-width: 1140px;
  margin: 0 auto;
}

.product-tabs {
  display: flex;
  gap: 6px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 4px;
  width: fit-content;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}
.ptab {
  padding: 8px 20px;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 700;
  cursor: pointer;
  border: none;
  background: transparent;
  color: var(--text2);
  transition: var(--transition);
  font-family: inherit;
  white-space: nowrap;
}
.ptab.active {
  background: var(--grad);
  color: #fff;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
}

.product-card {
  background: var(--card-bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.product-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--grad);
  opacity: 0;
  transition: opacity 0.3s;
}
.product-card:hover {
  border-color: var(--green);
  transform: translateY(-4px);
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.12);
}
.product-card:hover::before { opacity: 1; }

.pcard-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  margin-bottom: 0.9rem;
  transition: transform 0.3s ease;
}
.product-card:hover .pcard-icon { transform: translateY(-2px) scale(1.06); }
.pcard-icon.green { background: linear-gradient(135deg,#dcfce7,#bbf7d0); }
.pcard-icon.blue  { background: linear-gradient(135deg,#dbeafe,#bfdbfe); }
.pcard-icon.purp  { background: linear-gradient(135deg,#ede9fe,#ddd6fe); }
.pcard-icon.amber { background: linear-gradient(135deg,#fef3c7,#fde68a); }
.pcard-icon.pink  { background: linear-gradient(135deg,#fce7f3,#fbcfe8); }

.product-card h3 { font-size: 0.95rem; font-weight: 700; margin-bottom: 0.3rem; }
.product-card p { font-size: 0.78rem; color: var(--text2); margin-bottom: 0.7rem; line-height: 1.5; }
.product-rate { font-size: 0.82rem; font-weight: 700; color: var(--green); margin-top: auto; }
.product-apply-btn {
  margin-top: 0.9rem;
  width: 100%;
  background: var(--grad);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 8px;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
}
.product-apply-btn:hover { background: var(--grad-h); }

/* ---- INSURANCE COMBO NOTE ---- */
.ins-combo-banner {
  background: linear-gradient(135deg, #f0fdf4 0%, #eff6ff 100%);
  border: 1.5px solid #bbf7d0;
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 2rem;
}
.ins-combo-banner .ic-icon { font-size: 2rem; flex-shrink: 0; }
.ins-combo-banner h4 { font-size: 1rem; font-weight: 700; margin-bottom: 0.25rem; color: var(--green); }
.ins-combo-banner p { font-size: 0.85rem; color: var(--text2); line-height: 1.6; }

/* ---- HOW IT WORKS ---- */
.how-section {
  background: var(--bg3);
  padding: 4rem 1.25rem;
}
.how-inner { max-width: 1140px; margin: 0 auto; text-align: center; }
.steps-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
  position: relative;
}
.step-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem 1.25rem;
  text-align: center;
  transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}
.step-card:hover {
  border-color: rgba(22, 163, 74, 0.45);
  transform: translateY(-4px);
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.12);
}
.step-num {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--grad);
  color: #fff;
  font-size: 1.1rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.step-card:hover .step-num {
  transform: scale(1.08);
  box-shadow: 0 8px 18px rgba(22, 163, 74, 0.28);
}
.step-card h4 { font-size: 0.95rem; font-weight: 700; margin-bottom: 0.4rem; }
.step-card p { font-size: 0.8rem; color: var(--text2); line-height: 1.5; }

/* ---- FEATURES ---- */
.features-section { padding: 4rem 1.25rem; }
.features-inner { max-width: 1140px; margin: 0 auto; }
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.feature-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.4rem;
  transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}
.feature-card:hover {
  border-color: rgba(37, 99, 235, 0.45);
  transform: translateY(-4px);
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.12);
}
.feature-icon {
  font-size: 1.6rem;
  margin-bottom: 0.75rem;
  transition: transform 0.3s ease;
}
.feature-card:hover .feature-icon { transform: translateY(-2px) scale(1.08); }
.feature-card h4 { font-size: 0.95rem; font-weight: 700; margin-bottom: 0.35rem; }
.feature-card p { font-size: 0.8rem; color: var(--text2); line-height: 1.55; }

/* ---- TESTIMONIALS ---- */
.testimonials-section {
  background: var(--bg3);
  padding: 4rem 1.25rem;
}
.testimonials-inner { max-width: 1140px; margin: 0 auto; }
.testi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  margin-top: 2rem;
}
.testi-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.4rem;
  transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}
.testi-card:hover {
  border-color: rgba(22, 163, 74, 0.45);
  transform: translateY(-4px);
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.12);
}
.testi-stars { color: #f59e0b; font-size: 0.9rem; margin-bottom: 0.6rem; }
.testi-text { font-size: 0.875rem; color: var(--text2); line-height: 1.6; margin-bottom: 1rem; font-style: italic; }
.testi-author { display: flex; align-items: center; gap: 10px; }
.testi-avatar {
  width: 52px;
  height: 52px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--grad);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
  border: 2px solid var(--border);
}
.testi-avatar img {
  width: 100%;
  height: 100%;
  border-radius: inherit;
  display: block;
  object-fit: cover;
  object-position: center;
}
.testi-name { font-size: 0.875rem; font-weight: 700; }
.testi-role { font-size: 0.75rem; color: var(--text3); }

/* ---- CTA BANNER ---- */
.cta-section {
  background: var(--grad);
  padding: 4rem 1.25rem;
  text-align: center;
  color: #fff;
}
.cta-section h2 { font-size: clamp(1.5rem, 3vw, 2.2rem); font-weight: 800; margin-bottom: 0.75rem; }
.cta-section p { font-size: 1rem; opacity: 0.9; margin-bottom: 1.75rem; }
.btn-cta-white {
  background: #fff;
  color: var(--green);
  border: none;
  border-radius: var(--radius-sm);
  padding: 13px 30px;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
  transition: var(--transition);
}
.btn-cta-white:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,0.15); }

/* ---- FOOTER ---- */
.footer {
  background: var(--nav-bg);
  border-top: 1px solid var(--border);
  padding: 3rem 1.25rem 1.5rem;
}
.footer-inner {
  max-width: 1140px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 2.5rem;
  margin-bottom: 2rem;
}
.footer-brand .fb-logo {
  display: flex; align-items: center; gap: 10px; margin-bottom: 0.75rem;
}
.footer-brand img { width: 36px; height: 36px; border-radius: 9px; }
.footer-brand p { font-size: 0.83rem; color: var(--text2); line-height: 1.6; }
.footer-col h5 { font-size: 0.875rem; font-weight: 700; margin-bottom: 0.9rem; }
.footer-col ul { list-style: none; }
.footer-col ul li { margin-bottom: 0.5rem; }
.footer-col ul li a {
  font-size: 0.83rem;
  color: var(--text2);
  transition: color 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.footer-col ul li a:hover { color: var(--green); }
.footer-bottom {
  max-width: 1140px;
  margin: 0 auto;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: 0.8rem;
  color: var(--text3);
}

/* ---- MODAL ---- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem 0.75rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
}
.modal-overlay.show {
  opacity: 1;
  visibility: visible;
}
.modal-box {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: scale(0.95) translateY(10px);
  transition: transform 0.3s;
  box-shadow: 0 25px 60px rgba(0,0,0,0.25);
}
.modal-overlay.show .modal-box {
  transform: scale(1) translateY(0);
}
.modal-header {
  background: var(--grad);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  padding: 1.5rem;
  color: #fff;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-shrink: 0;
}
.modal-header h4 { font-size: 1.1rem; font-weight: 800; margin-bottom: 0.2rem; }
.modal-header p { font-size: 0.82rem; opacity: 0.9; }
.modal-close {
  background: rgba(255,255,255,0.2);
  border: none;
  border-radius: 50%;
  width: 32px; height: 32px;
  color: #fff;
  font-size: 1rem;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.2s;
}
.modal-close:hover { background: rgba(255,255,255,0.35); }
.modal-body { 
  padding: 1.5rem;
  overflow-y: auto;
  flex: 1;
}

/* Progress steps */
.modal-steps {
  display: flex;
  align-items: center;
  margin-bottom: 1.5rem;
  overflow-x: auto;
  gap: 0;
}
.mstep {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.mstep-num {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--bg3);
  border: 2px solid var(--border);
  color: var(--text3);
  font-size: 0.78rem;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition);
}
.mstep.active .mstep-num { background: var(--grad); border-color: transparent; color: #fff; }
.mstep.done .mstep-num { background: var(--green); border-color: transparent; color: #fff; }
.mstep-label { font-size: 0.72rem; font-weight: 600; color: var(--text3); }
.mstep.active .mstep-label { color: var(--green); }
.mstep-line { flex: 1; height: 2px; background: var(--border); min-width: 20px; margin: 0 6px; }
.mstep-line.done { background: var(--green); }

.form-group { margin-bottom: 1rem; }
.form-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text2);
  margin-bottom: 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.form-control, .form-select {
  display: block;
  width: 100%;
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.insurance-combo-box {
  background: linear-gradient(135deg, #f0fdf4, #eff6ff);
  border: 1.5px solid #bbf7d0;
  border-radius: var(--radius-sm);
  padding: 1rem;
  margin-bottom: 1rem;
  transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}
.insurance-combo-box:hover {
  border-color: rgba(22, 163, 74, 0.55);
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.1);
}

.dark-mode .calc-card:hover,
.dark-mode .product-card:hover,
.dark-mode .step-card:hover,
.dark-mode .feature-card:hover,
.dark-mode .testi-card:hover,
.dark-mode .insurance-combo-box:hover {
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.36);
}

@media (prefers-reduced-motion: reduce) {
  .calc-card,
  .product-card,
  .pcard-icon,
  .step-card,
  .step-num,
  .feature-card,
  .feature-icon,
  .testi-card,
  .insurance-combo-box {
    transition: none;
  }

  .calc-card:hover,
  .product-card:hover,
  .product-card:hover .pcard-icon,
  .step-card:hover,
  .step-card:hover .step-num,
  .feature-card:hover,
  .feature-card:hover .feature-icon,
  .testi-card:hover,
  .insurance-combo-box:hover {
    transform: none;
  }
}
.insurance-combo-box h5 { font-size: 0.88rem; font-weight: 700; color: var(--green); margin-bottom: 0.5rem; }
.insurance-combo-box ul { list-style: none; }
.insurance-combo-box ul li {
  font-size: 0.8rem;
  color: var(--text2);
  padding: 3px 0;
  display: flex;
  align-items: center;
  gap: 6px;
}
.insurance-combo-box ul li::before { content: '✓'; color: var(--green); font-weight: 700; }

.modal-breakdown {
  background: var(--bg3);
  border-radius: var(--radius-sm);
  padding: 1rem;
  margin-bottom: 1rem;
}
.mb-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.83rem;
  padding: 4px 0;
  color: var(--text2);
}
.mb-row.total {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text);
  border-top: 1px solid var(--border);
  margin-top: 6px;
  padding-top: 8px;
}

.modal-footer {
  display: flex;
  gap: 10px;
  padding: 0 1.5rem 1.5rem;
  padding: 1.5rem;
  flex-shrink: 0;
  align-items: center;
  border-top: 1px solid var(--border);
}
.modal-footer button { flex: 1; }

@media (min-width: 900px) {
  .modal-overlay {
    padding: 2rem;
  }

  .modal-box {
    max-width: 880px;
    max-height: calc(100vh - 4rem);
  }

  .modal-header {
    padding: 1.35rem 1.75rem;
    align-items: center;
  }

  .modal-header h4 {
    font-size: 1.25rem;
  }

  .modal-header p {
    font-size: 0.88rem;
  }

  .modal-body {
    padding: 1.75rem;
  }

  .modal-steps {
    max-width: 620px;
    margin-left: auto;
    margin-right: auto;
  }

  .form-row {
    gap: 16px;
  }

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

  .modal-breakdown,
  .insurance-combo-box {
    padding: 1.15rem 1.25rem;
  }

  #formStep3[style*="block"] {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
  }

  #formStep3 > .insurance-combo-box,
  #formStep3 > div:last-child {
    grid-column: 1 / -1;
  }

  #formStep3 .modal-breakdown {
    margin: 0;
  }

  .modal-footer {
    justify-content: flex-end;
    padding: 1.25rem 1.75rem;
  }

  .modal-footer button {
    flex: 0 0 180px;
  }
}

/* Success State */
.success-state { text-align: center; padding: 2rem 0; }
.success-icon { font-size: 4rem; margin-bottom: 1rem; }
.success-state h4 { font-size: 1.2rem; font-weight: 800; margin-bottom: 0.5rem; color: var(--green); }
.success-state p { font-size: 0.875rem; color: var(--text2); line-height: 1.6; }
.success-overview-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 180px;
  margin: 1.75rem auto 0;
}

/* ---- RESPONSIVE ---- */
@media (max-width: 992px) {
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .steps-grid,
  .features-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Tablet + Mobile: show hamburger, hide desktop nav */
@media (max-width: 1024px) {
  .navbar-inner nav { display: none !important; }
  .navbar-nav { display: none !important; }
  .navbar-toggler { display: flex !important; }
  .navbar-right .btn-primary { display: none !important; }
  /* Keep theme-btn visible on mobile/tablet */
  .theme-switch { display: flex !important; }
}

@media (max-width: 768px) {

  .hero-inner { grid-template-columns: 1fr; gap: 2rem; }
  .hero { padding: 2.5rem 1.25rem 2rem; }
  .hero-stats { gap: 1rem; }

  .trust-strip-inner { grid-template-columns: repeat(2, 1fr); }
  .calc-selects { grid-template-columns: 1fr; }
  .result-box { grid-template-columns: 1fr; gap: 6px; }
  .result-box .r-divider { border: none; border-top: 1px solid rgba(255,255,255,0.3); padding-top: 6px; }

  .footer-inner { grid-template-columns: 1fr; gap: 1.5rem; }
  .footer-bottom { justify-content: center; text-align: center; }

  .form-row { grid-template-columns: 1fr; }
  .modal-footer { flex-direction: column; }

  /* Iwasan ang auto-zoom sa mobile (iOS) at ayusin ang spacing */
  .form-control, 
  .form-select, 
  .calc-selects select {
    font-size: 16px !important; /* Minimum para maiwasan ang auto-zoom sa iOS/Mobile browsers */
    padding: 10px 12px !important;
    height: auto !important;
  }

  .modal-body { padding: 1.25rem 1rem; }
  .modal-header { padding: 1.25rem 1rem; }
  .modal-footer { padding: 0 1rem 1.25rem; }
  .modal-footer { padding: 1.25rem 1rem; }
}

@media (min-width: 641px) {
  .loan-amount-collateral-row {
    grid-template-columns: 1fr 1fr !important;
  }
}

@media (max-width: 480px) {
  .steps-grid,
  .features-grid { grid-template-columns: 1fr; }
  .trust-strip-inner { grid-template-columns: repeat(2, 1fr); }
  .hero h1 { font-size: 1.7rem; }
  .hero-btns { flex-direction: column; }
  .hero-btns .btn-primary,
  .hero-btns .btn-outline { width: 100%; justify-content: center; }
  .product-tabs { width: 100%; }
  .ptab { flex: 1; text-align: center; padding: 8px 10px; font-size: 0.8rem; }
}
