/* ===== Theme tokens ===== */
:root {
  --color-primary: #1a56db;      /* bright professional blue */
  --color-primary-dark: #133a99;
  --color-accent: #d4a017;       /* gold accent */
  --color-accent-dark: #b3860f;
  --color-dark: #1c2b3a;         /* navy for footer/text */
  --color-bg: #ffffff;
  --color-bg-alt: #f4f7fc;
  --color-text: #22303f;
  --color-text-muted: #5b6b7b;
  --color-border: #e1e7f0;
  --radius: 10px;
  --shadow: 0 4px 16px rgba(26, 86, 219, 0.08);
  --max-width: 1140px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.6;
}

h1, h2, h3 {
  font-family: Georgia, "Times New Roman", serif;
  color: var(--color-dark);
  margin: 0 0 0.5em;
}

a { color: var(--color-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

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

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* ===== Header / Nav ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #fff;
  border-bottom: 1px solid var(--color-border);
}

.nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  max-width: var(--max-width);
  margin: 0 auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--color-dark);
}

.brand .logo-mark {
  width: 40px;
  height: 40px;
  display: flex;
  flex-shrink: 0;
}
.brand .logo-mark svg { width: 40px; height: 40px; }

.brand small {
  display: block;
  font-weight: 400;
  font-size: 0.65rem;
  color: var(--color-text-muted);
  letter-spacing: 0.05em;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  color: var(--color-text);
  font-weight: 500;
}

.nav-links a.active,
.nav-links a:hover { color: var(--color-primary); }

.dropdown { position: relative; }
.dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  min-width: 200px;
  padding: 8px;
  margin-top: 8px;
}
.dropdown-menu li { list-style: none; }
.dropdown-menu a {
  display: block;
  padding: 8px 10px;
  border-radius: 6px;
  color: var(--color-text);
}
.dropdown-menu a:hover { background: var(--color-bg-alt); text-decoration: none; }
.dropdown.open .dropdown-menu,
.dropdown:hover .dropdown-menu { display: block; }

.btn {
  display: inline-block;
  padding: 10px 22px;
  border-radius: 999px;
  font-weight: 600;
  cursor: pointer;
  border: none;
}

.btn-primary {
  background: var(--color-accent);
  color: #1c2b3a;
}
.btn-primary:hover { background: var(--color-accent-dark); text-decoration: none; }

.nav-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
}

/* ===== Hero ===== */
.hero {
  position: relative;
  min-height: 380px;
  display: flex;
  align-items: flex-end;
  background-size: cover;
  background-position: center;
  color: #fff;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(26,86,219,0.35), rgba(15,30,60,0.75));
}
.hero-content {
  position: relative;
  padding: 48px 24px;
  max-width: var(--max-width);
  margin: 0 auto;
  width: 100%;
}
.hero h1 {
  color: #fff;
  font-size: 2.6rem;
  margin-bottom: 6px;
}
.hero p { font-size: 1.05rem; opacity: 0.95; }

/* ===== Sections ===== */
section { padding: 56px 0; }
.section-alt { background: var(--color-bg-alt); }

.section-title {
  text-align: center;
  font-size: 1.8rem;
  margin-bottom: 36px;
}

.intro-text {
  max-width: 780px;
  margin: 0 auto;
  text-align: center;
  color: var(--color-text-muted);
}

/* ===== Cards ===== */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
}

.card {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 28px rgba(26, 86, 219, 0.14);
}

/* Rate cards */
.rate-card h3 { font-size: 1.15rem; }
.rate-block { margin-top: 14px; }
.rate-block .label {
  font-size: 0.72rem;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.rate-row {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
}
.rate-figure { text-align: left; }
.rate-figure strong { font-size: 1.3rem; display: block; }
.rate-change { color: #1a8a3d; font-size: 0.78rem; }
.rate-updated {
  margin-top: 14px;
  font-size: 0.75rem;
  color: var(--color-text-muted);
  border-top: 1px solid var(--color-border);
  padding-top: 10px;
}

/* Loan option cards */
.loan-card { text-align: center; }
.loan-icon {
  width: 84px;
  height: 84px;
  margin: 0 auto 14px;
  border-radius: 16px;
  background: var(--color-bg-alt);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-primary);
}
.loan-icon svg { width: 38px; height: 38px; }
.loan-card p { color: var(--color-text-muted); font-size: 0.95rem; }
.loan-card .cta {
  display: inline-block;
  margin-top: 10px;
  font-weight: 700;
  color: var(--color-accent-dark);
}

/* Blog cards */
.blog-card { padding: 0; overflow: hidden; }
.blog-card img { height: 160px; width: 100%; object-fit: cover; }
.blog-card .blog-body { padding: 18px; }
.blog-date { font-size: 0.75rem; color: var(--color-text-muted); }
.blog-card h3 { font-size: 1.05rem; margin: 8px 0; }
.blog-card p { color: var(--color-text-muted); font-size: 0.9rem; }

/* ===== Content pages (loan detail) ===== */
.content-block {
  background: var(--color-bg-alt);
  border-radius: var(--radius);
  padding: 24px 28px;
  margin-bottom: 20px;
}
.content-block h2 { font-size: 1.3rem; }
.content-block ul { padding-left: 20px; }
.content-block li { margin-bottom: 8px; }
.content-block h2[id] { scroll-margin-top: 90px; }
.content-block h3, .content-block h4 { font-size: 1.05rem; margin: 18px 0 6px; }
.content-block ul ul { margin-top: 8px; }

.page-hero {
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
  color: #fff;
  padding: 48px 0;
  text-align: center;
}
.page-hero h1 { color: #fff; }
.page-hero p { opacity: 0.9; }

/* ===== Contact form ===== */
.contact-wrap {
  max-width: 640px;
  margin: 0 auto;
}
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.contact-form input,
.contact-form select,
.contact-form textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  font: inherit;
  color: var(--color-text);
  background: var(--color-bg-alt);
}
.contact-form input:focus,
.contact-form select:focus,
.contact-form textarea:focus {
  outline: 2px solid var(--color-primary);
  outline-offset: 1px;
}
.contact-form input[type="file"] {
  background: none;
  border: 1px dashed var(--color-border);
  padding: 10px 14px;
}
.contact-form button {
  align-self: flex-start;
}
@media (max-width: 560px) {
  .form-row { grid-template-columns: 1fr; }
}

/* ===== Footer ===== */
.site-footer {
  background: var(--color-dark);
  color: #cfd9e6;
  padding: 48px 0 24px;
}
.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 24px;
  margin-bottom: 28px;
}
.footer-grid h4 { color: #fff; font-size: 0.95rem; margin-bottom: 12px; }
.footer-grid a { color: #cfd9e6; }
.footer-grid a:hover { color: var(--color-accent); }
.footer-grid ul { list-style: none; padding: 0; margin: 0; }
.footer-grid li { margin-bottom: 8px; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 18px;
  font-size: 0.78rem;
  color: #9fb0c2;
  text-align: center;
}

/* Back to top */
.back-to-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--color-accent);
  color: var(--color-dark);
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  cursor: pointer;
  box-shadow: var(--shadow);
  z-index: 90;
}
.back-to-top.visible { display: flex; }

/* ===== Responsive ===== */
@media (max-width: 820px) {
  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    flex-direction: column;
    align-items: flex-start;
    padding: 16px 24px;
    border-bottom: 1px solid var(--color-border);
    display: none;
    gap: 14px;
  }
  .nav-links.open { display: flex; }
  .dropdown-menu { position: static; box-shadow: none; border: none; padding-left: 12px; }
  .nav-toggle { display: block; }
  .hero h1 { font-size: 1.9rem; }
}

/* Topic link lists: black text, bold on hover (no underline) */
.topic-links a {
  color: #000;
  text-decoration: none;
  display: inline-flex;
  flex-direction: column;
}
.topic-links a::after {
  content: attr(data-text);
  font-weight: 700;
  height: 0;
  overflow: hidden;
  visibility: hidden;
}
.topic-links a:hover,
.topic-links a:focus {
  color: #000;
  font-weight: 700;
  text-decoration: none;
}
