/* ===== Variables ===== */
:root {
  --color-bg: #080d17;
  --color-bg-soft: #0f1623;
  --color-surface: #161f2e;
  --color-surface-elevated: #1c2738;
  --color-text: #f0f3f8;
  --color-text-muted: #94a3b8;
  --color-accent: #c9a227;
  --color-accent-hover: #ddb63a;
  --color-accent-soft: rgba(201, 162, 39, 0.15);
  --color-border: rgba(255, 255, 255, 0.06);
  --color-border-focus: rgba(201, 162, 39, 0.5);
  --font-sans: "DM Sans", system-ui, sans-serif;
  --font-display: "Fraunces", Georgia, serif;
  --container: min(1160px, 90vw);
  --radius: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --transition: 0.25s ease;
  --transition-smooth: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.25);
  --shadow-glow: 0 0 40px rgba(201, 162, 39, 0.08);
}

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

html {
  scroll-behavior: smooth;
  /* Prevent section headings from being cut off under the fixed header when tapping nav links */
  scroll-padding-top: 100px;
}

body {
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection {
  background: var(--color-accent-soft);
  color: var(--color-text);
}

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

ul {
  list-style: none;
}

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

/* ===== Layout ===== */
.container {
  width: var(--container);
  margin-inline: auto;
  padding-inline: clamp(1rem, 4vw, 2rem);
}

/* ===== Header ===== */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(8, 13, 23, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--color-border);
  transition: box-shadow var(--transition);
}

.header.is-scrolled {
  box-shadow: 0 1px 0 var(--color-border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 76px;
}

.logo {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.4rem;
  letter-spacing: -0.02em;
  color: var(--color-text);
}

.nav ul {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav a {
  color: var(--color-text-muted);
  font-weight: 500;
  font-size: 0.95rem;
}

.nav a:hover {
  color: var(--color-text);
}

.nav .has-dropdown {
  position: relative;
}

.nav .arrow {
  font-size: 0.65em;
  opacity: 0.7;
}

.dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 0.5rem;
  min-width: 220px;
  padding: 0.5rem 0;
  background: var(--color-surface-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity var(--transition), transform var(--transition), visibility var(--transition);
}

.has-dropdown:hover .dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown li {
  padding: 0;
}

.dropdown a {
  display: block;
  padding: 0.6rem 1.2rem;
  color: var(--color-text);
  font-size: 0.9rem;
}

.dropdown a:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--color-accent);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.8rem 1.6rem;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background var(--transition), color var(--transition), transform var(--transition), box-shadow var(--transition);
}

.btn:focus-visible {
  outline: 2px solid var(--color-border-focus);
  outline-offset: 2px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--color-accent) 0%, #b8921f 100%);
  color: #0a0e16;
  box-shadow: 0 2px 12px rgba(201, 162, 39, 0.25);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--color-accent-hover) 0%, var(--color-accent) 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(201, 162, 39, 0.3);
}

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

.btn-secondary:hover {
  background: var(--color-accent);
  color: var(--color-bg);
}

.btn-lg {
  padding: 1.05rem 2.25rem;
  font-size: 1.05rem;
  box-shadow: 0 4px 16px rgba(201, 162, 39, 0.28);
}

.btn-lg:hover {
  box-shadow: 0 8px 24px rgba(201, 162, 39, 0.35);
}

.arrow-r {
  font-size: 1.1em;
}

.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  position: relative;
  z-index: 101;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
}

.menu-toggle span {
  width: 24px;
  height: 2px;
  background: var(--color-text);
  pointer-events: none;
}

.menu-close {
  display: none;
}

/* ===== Hero ===== */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 8rem 0 5rem;
  position: relative;
  background:
    radial-gradient(ellipse 100% 70% at 50% 0%, var(--color-accent-soft) 0%, transparent 55%),
    radial-gradient(ellipse 60% 40% at 80% 60%, rgba(201, 162, 39, 0.04) 0%, transparent 50%),
    linear-gradient(180deg, var(--color-bg) 0%, var(--color-bg-soft) 100%);
}

.hero-inner {
  max-width: 720px;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 5.5vw, 3.75rem);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.03em;
  margin-bottom: 1.5rem;
  color: var(--color-text);
}

.hero-subtitle {
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  color: var(--color-text-muted);
  margin-bottom: 2.25rem;
  max-width: 520px;
  margin-inline: auto;
  line-height: 1.65;
}

.hero-subtitle strong {
  color: var(--color-accent);
  font-weight: 600;
}

.hero .btn {
  margin-top: 0.5rem;
}

.hero-scroll {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--color-text-muted);
}

.scroll-line {
  width: 2px;
  height: 44px;
  background: linear-gradient(to bottom, var(--color-accent), transparent);
  border-radius: 2px;
  opacity: 0.9;
  animation: scroll-pulse 2.2s ease-in-out infinite;
}

@keyframes scroll-pulse {
  0%, 100% { opacity: 0.4; transform: scaleY(0.8); }
  50% { opacity: 1; transform: scaleY(1); }
}

/* ===== Sections ===== */
.section {
  padding: 5.5rem 0;
  border-top: 1px solid var(--color-border);
}

/* When nav links scroll to a section, leave room for fixed header so heading isn't cut off */
main [id],
.section[id],
section[id],
[id].product-card {
  scroll-margin-top: 100px;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.85rem, 3.2vw, 2.35rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  text-align: center;
  margin-bottom: 0.5rem;
  color: var(--color-text);
}

.section-subtitle {
  text-align: center;
  color: var(--color-text-muted);
  margin-bottom: 2.75rem;
  font-size: 1.05rem;
  letter-spacing: 0.01em;
}

/* Eligibility */
.eligibility {
  background: var(--color-bg-soft);
}

.eligibility-list {
  max-width: 480px;
  margin: 0 auto 2rem;
}

.eligibility-list li {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--color-border);
}

.eligibility-list li:last-of-type {
  border-bottom: none;
}

.eligibility-list .check {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-accent-soft);
  color: var(--color-accent);
  border-radius: 50%;
  font-weight: 700;
  font-size: 0.85rem;
}

.eligibility-list strong {
  display: block;
  color: var(--color-text);
  margin-bottom: 0.2rem;
}

.eligibility-list span:not(.check) {
  color: var(--color-text-muted);
  font-size: 0.95rem;
}

.eligibility .btn {
  display: block;
  width: fit-content;
  margin-inline: auto;
}

/* Products */
.products-section {
  background: var(--color-bg-soft);
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  margin-top: 2rem;
}

.product-card {
  padding: 2rem 1.5rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: border-color var(--transition), transform var(--transition-smooth), box-shadow var(--transition);
}

.product-card:hover {
  border-color: rgba(201, 162, 39, 0.25);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.product-card h3 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 0.75rem;
  line-height: 1.3;
}

.product-card p {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  line-height: 1.6;
  margin-bottom: 1rem;
}

.product-link {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-accent);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.product-link:hover {
  color: var(--color-accent-hover);
}

/* How it works */
.how-it-works .steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  margin-bottom: 2.5rem;
}

.step {
  padding: 2.25rem 2rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  text-align: center;
  transition: border-color var(--transition), transform var(--transition-smooth), box-shadow var(--transition);
}

.step:hover {
  border-color: rgba(201, 162, 39, 0.25);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  background: linear-gradient(135deg, var(--color-accent) 0%, #b8921f 100%);
  color: #0a0e16;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.3rem;
  border-radius: 50%;
  margin-bottom: 1.35rem;
  box-shadow: 0 4px 14px rgba(201, 162, 39, 0.3);
}

.step h3 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: var(--color-text);
}

.step p {
  color: var(--color-text-muted);
  font-size: 0.95rem;
  line-height: 1.6;
}

.how-it-works .btn {
  display: block;
  width: fit-content;
  margin-inline: auto;
}

/* Why us */
.why-us {
  background: var(--color-bg-soft);
}

.why-us-intro {
  max-width: 640px;
  margin: 0 auto 2.5rem;
  text-align: center;
  color: var(--color-text-muted);
  font-size: 1.05rem;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  margin-bottom: 2rem;
}

.stat {
  text-align: center;
  padding: 2.25rem 1.25rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition);
}

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

.stat-value {
  display: block;
  font-family: var(--font-display);
  font-size: 2.25rem;
  font-weight: 700;
  color: var(--color-accent);
  margin-bottom: 0.5rem;
}

.stat-label {
  font-size: 0.95rem;
  color: var(--color-text-muted);
}

.why-us-cta {
  text-align: center;
  color: var(--color-text-muted);
  margin-bottom: 1.5rem;
  max-width: 520px;
  margin-inline: auto;
}

.why-us .btn {
  display: block;
  width: fit-content;
  margin-inline: auto;
}

/* About us */
.about-section {
  background: var(--color-bg-soft);
}

.about-inner {
  max-width: 640px;
  margin-inline: auto;
  text-align: center;
}

.about-text {
  color: var(--color-text-muted);
  font-size: 1.05rem;
  line-height: 1.7;
}

/* FAQ */
.faq-section {
  background: var(--color-bg-soft);
}

.faq-inner {
  max-width: 640px;
  margin-inline: auto;
}

.faq-list {
  margin-top: 2rem;
}

.faq-item {
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--color-border);
}

.faq-item:last-child {
  border-bottom: none;
}

.faq-item dt {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 0.5rem;
}

.faq-item dd {
  margin: 0;
  font-size: 0.95rem;
  color: var(--color-text-muted);
  line-height: 1.6;
}

/* Contact */
.contact-section {
  background: var(--color-bg);
}

.contact-inner {
  max-width: 480px;
  margin-inline: auto;
  text-align: center;
}

.contact-details {
  margin: 2rem 0 1.5rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2.5rem;
}

.contact-address,
.contact-phone {
  font-size: 1rem;
  color: var(--color-text-muted);
  line-height: 1.6;
  text-align: center;
}

.contact-address strong,
.contact-phone strong {
  display: block;
  color: var(--color-text);
  font-size: 0.9rem;
  margin-bottom: 0.35rem;
}

.contact-phone a {
  color: var(--color-accent);
  font-weight: 500;
  transition: color var(--transition);
}

.contact-phone a:hover {
  color: var(--color-accent-hover);
}

/* Focus visible for accessibility */
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--color-border-focus);
  outline-offset: 2px;
}

/* Apply CTA */
.apply-cta {
  background: var(--color-bg-soft);
}

.apply-cta-inner {
  text-align: center;
}

.apply-cta p {
  color: var(--color-text-muted);
  margin-bottom: 1.5rem;
}

/* ===== Loan application form (at the end) ===== */
.apply-section {
  background: var(--color-bg-soft);
  position: relative;
}

.apply-section::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--color-accent), transparent);
  border-radius: 2px;
  opacity: 0.6;
}

.form-wrap {
  max-width: 480px;
  margin-inline: auto;
}

.form-intro {
  text-align: center;
  color: var(--color-text-muted);
  margin-bottom: 2rem;
  font-size: 1rem;
}

.apply-form label {
  display: block;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--color-text);
  margin-bottom: 0.4rem;
}

.apply-form input,
.apply-form textarea {
  width: 100%;
  padding: 0.9rem 1.15rem;
  font-family: var(--font-sans);
  font-size: 1rem;
  color: var(--color-text);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  margin-bottom: 1.25rem;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.apply-form input::placeholder,
.apply-form textarea::placeholder {
  color: var(--color-text-muted);
  opacity: 0.75;
}

.apply-form input:focus,
.apply-form textarea:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px var(--color-accent-soft);
}

.apply-form input:focus-visible,
.apply-form textarea:focus-visible {
  outline: none;
}

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

.btn-submit {
  width: 100%;
  margin-top: 0.5rem;
  padding: 1rem;
}

.btn-submit:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.form-note {
  margin-top: 1rem;
  font-size: 0.9rem;
  color: var(--color-text-muted);
  text-align: center;
  min-height: 1.4em;
}

.form-note.success {
  color: #86c986;
}

.form-note.error {
  color: #d48989;
}

/* ===== Footer ===== */
.footer {
  padding: 3.5rem 0 2rem;
  background: var(--color-bg);
  border-top: 1px solid var(--color-border);
}

.footer-top {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 2.5rem;
  margin-bottom: 2.5rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--color-border);
}

.footer .logo {
  font-size: 1.25rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 3rem;
}

.footer-links h4 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-text-muted);
  margin-bottom: 1rem;
}

.footer-links ul li {
  margin-bottom: 0.5rem;
}

.footer-links a {
  color: var(--color-text-muted);
  font-size: 0.95rem;
}

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

.footer-address,
.footer-phone {
  font-size: 0.95rem;
  color: var(--color-text-muted);
  margin-bottom: 0.5rem;
  line-height: 1.5;
}

.footer-phone a {
  color: var(--color-text-muted);
}

.footer-phone a:hover {
  color: var(--color-accent);
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.footer-bottom p {
  font-size: 0.9rem;
  color: var(--color-text-muted);
}

.social {
  display: flex;
  gap: 1.5rem;
}

.social a {
  font-size: 0.9rem;
  color: var(--color-text-muted);
}

.social a:hover {
  color: var(--color-accent);
}

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    max-width: 100%;
    height: 100vh;
    bottom: auto;
    z-index: 999;
    background: var(--color-bg);
    padding: calc(5.5rem + env(safe-area-inset-top, 0px)) 2rem 2rem;
    overflow-y: auto;
    transform: translateX(-100vw);
    transition: transform 0.3s ease;
    display: block;
    -webkit-overflow-scrolling: touch;
    visibility: hidden;
    pointer-events: none;
  }

  /* Open menu when URL is #mobile-menu (tap hamburger = link to #mobile-menu) */
  #mobile-menu:target {
    transform: translateX(0);
    visibility: visible;
    pointer-events: auto;
  }

  body:has(#mobile-menu:target) {
    overflow: hidden;
  }

  /* Hide hamburger when menu is open so only Close is visible at top */
  #mobile-menu:target ~ .menu-toggle {
    visibility: hidden;
    pointer-events: none;
  }

  .menu-close {
    display: block;
    padding: 0.75rem 0;
    margin-bottom: 1rem;
    font-weight: 600;
    color: var(--color-accent);
    font-size: 1.1rem;
    border-bottom: 1px solid var(--color-border);
  }

  .menu-close:hover {
    color: var(--color-accent-hover);
  }

  .nav ul {
    flex-direction: column;
    gap: 0;
    padding-top: 1rem;
  }

  .nav > ul > li {
    border-bottom: 1px solid var(--color-border);
  }

  .nav > ul > li > a {
    display: block;
    padding: 1rem 0;
    color: var(--color-text);
  }

  .nav .dropdown {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    margin: 0;
    padding: 0 0 1rem 1rem;
    background: transparent;
    border: none;
    display: none;
  }

  .nav .has-dropdown.is-open .dropdown {
    display: block;
  }

  .nav .has-dropdown > a {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .nav .dropdown a {
    padding: 0.5rem 0;
    font-size: 0.9rem;
    color: var(--color-text-muted);
  }

  .header .btn-primary {
    display: none;
  }

  .menu-toggle {
    display: flex;
  }

  .products-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .how-it-works .steps {
    grid-template-columns: 1fr;
  }

  .stats {
    grid-template-columns: 1fr;
  }
}

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

  .section {
    padding: 3.5rem 0;
  }

  .footer-top {
    flex-direction: column;
  }

  .footer-links {
    gap: 2rem;
  }

  .footer-bottom {
    flex-direction: column;
    text-align: center;
  }
}
