/* ============================================================
   Finance Link — Stylesheet
   Colours: Primary Red #E23407, Charcoal #3A4449,
            White #FFFFFF, Light Grey #DEBAB6 (accent)
   ============================================================ */

/* ---------- Reset & base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --red: #E23407;
  --red-dark: #c42d06;
  --charcoal: #3A4449;
  --charcoal-light: #4f5a60;
  --white: #FFFFFF;
  --grey-bg: #f7f8f9;
  --grey-light: #DEBAB6;
  --grey-border: #e2e6e9;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
  --radius: 10px;
  --shadow: 0 2px 12px rgba(58, 68, 73, .08);
  --shadow-lg: 0 8px 30px rgba(58, 68, 73, .12);
  --transition: .25s ease;
  --header-h: 72px;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
}

body {
  font-family: var(--font);
  color: var(--charcoal);
  background: var(--white);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--red);
  text-decoration: none;
  transition: color var(--transition);
}
a:hover { color: var(--red-dark); }

:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 2px;
}

/* ---------- Utility ---------- */
.container {
  width: 100%;
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 20px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: .95rem;
  padding: .75rem 1.75rem;
  border-radius: var(--radius);
  border: 2px solid transparent;
  cursor: pointer;
  transition: background var(--transition), color var(--transition), border-color var(--transition), box-shadow var(--transition);
  text-decoration: none;
  line-height: 1.2;
}
.btn-primary {
  background: var(--red);
  color: var(--white);
  border-color: var(--red);
}
.btn-primary:hover,
.btn-primary:focus-visible {
  background: var(--red-dark);
  border-color: var(--red-dark);
  color: var(--white);
}
.btn-outline {
  background: transparent;
  color: var(--charcoal);
  border-color: var(--charcoal);
}
.btn-outline:hover,
.btn-outline:focus-visible {
  background: var(--charcoal);
  color: var(--white);
}
.btn-sm {
  padding: .5rem 1.25rem;
  font-size: .85rem;
}
.btn-full { width: 100%; }

/* ---------- Brand bar ---------- */
.brand-bar {
  height: 4px;
  background: var(--red);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1001;
}

/* ---------- Header ---------- */
.site-header {
  position: fixed;
  top: 4px;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, .97);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--grey-border);
  height: var(--header-h);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.logo-link { display: flex; align-items: center; }
.logo { height: 40px; width: auto; }

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  width: 40px;
  height: 40px;
  position: relative;
}
.hamburger,
.hamburger::before,
.hamburger::after {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--charcoal);
  border-radius: 2px;
  position: absolute;
  left: 8px;
  transition: transform var(--transition), opacity var(--transition);
}
.hamburger { top: 19px; }
.hamburger::before { content: ""; top: -7px; }
.hamburger::after  { content: ""; top: 7px; }

.nav-toggle[aria-expanded="true"] .hamburger { background: transparent; }
.nav-toggle[aria-expanded="true"] .hamburger::before { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .hamburger::after  { transform: translateY(-7px) rotate(-45deg); }

.nav-list {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 1.75rem;
}
.nav-link {
  color: var(--charcoal);
  font-weight: 500;
  font-size: .9rem;
  transition: color var(--transition);
}
.nav-link:hover,
.nav-link.active { color: var(--red); }
.nav-link.btn-primary,
.nav-link.btn-primary:hover,
.nav-link.btn-primary:focus-visible { color: var(--white); }

.site-header.scrolled {
  box-shadow: var(--shadow);
}

/* Mobile nav */
@media (max-width: 768px) {
  .nav-toggle { display: block; }

  .primary-nav {
    position: fixed;
    top: calc(var(--header-h) + 4px);
    left: 0;
    right: 0;
    background: var(--white);
    border-bottom: 1px solid var(--grey-border);
    box-shadow: var(--shadow-lg);
    transform: translateY(-10px);
    opacity: 0;
    visibility: hidden;
    transition: transform var(--transition), opacity var(--transition), visibility var(--transition);
  }
  .primary-nav.open {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }

  .nav-list {
    flex-direction: column;
    padding: 1.5rem 20px;
    gap: .25rem;
  }
  .nav-list li { width: 100%; }
  .nav-link {
    display: block;
    padding: .75rem 0;
    font-size: 1rem;
    border-bottom: 1px solid var(--grey-border);
  }
  .nav-list li:last-child .nav-link { border-bottom: none; }
  .btn.btn-sm.nav-link {
    margin-top: .5rem;
    text-align: center;
    border-bottom: none;
  }
}

/* ---------- Section base ---------- */
.section {
  padding: 5rem 0;
}
.section--alt {
  background: var(--grey-bg);
}
.section-title {
  font-size: clamp(1.6rem, 4vw, 2.25rem);
  text-align: center;
  margin-bottom: .5rem;
  color: var(--charcoal);
}
.section-subtitle {
  text-align: center;
  color: var(--charcoal-light);
  max-width: 560px;
  margin: 0 auto 3rem;
  font-size: 1.05rem;
}

/* ---------- Hero ---------- */
.hero {
  padding: calc(var(--header-h) + 4rem + 4px) 0 4rem;
  background: linear-gradient(170deg, var(--white) 60%, var(--grey-bg) 100%);
  position: relative;
  overflow: hidden;
}
.hero::after {
  content: "";
  position: absolute;
  bottom: -60px;
  right: -40px;
  width: 220px;
  height: 220px;
  border: 4px solid var(--grey-light);
  border-radius: 50%;
  opacity: .35;
  pointer-events: none;
}

.hero-inner { max-width: 780px; }

.hero h1 {
  font-size: clamp(1.75rem, 5vw, 2.8rem);
  line-height: 1.2;
  margin-bottom: 1.25rem;
  color: var(--charcoal);
}
.hero-sub {
  font-size: clamp(1rem, 2.5vw, 1.2rem);
  color: var(--charcoal-light);
  margin-bottom: 2rem;
  max-width: 640px;
}

.hero-buttons {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 3rem;
}

/* Trust bullets */
.trust-bullets {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem 2.5rem;
}
.trust-item {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .9rem;
  color: var(--charcoal-light);
}
.trust-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: var(--red);
}

/* ---------- Cards ---------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.5rem;
}

.card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow);
  transition: box-shadow var(--transition), transform var(--transition);
  display: flex;
  flex-direction: column;
}
.card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-3px);
}
.card-icon {
  width: 44px;
  height: 44px;
  margin-bottom: 1rem;
  color: var(--red);
}
.card-icon svg {
  width: 100%;
  height: 100%;
}
.card h3 {
  font-size: 1.15rem;
  margin-bottom: .5rem;
}
.card p {
  color: var(--charcoal-light);
  font-size: .93rem;
  flex: 1;
  margin-bottom: 1rem;
}
.card-link {
  font-weight: 600;
  font-size: .9rem;
}

/* ---------- Timeline ---------- */
.timeline {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 0;
  max-width: 860px;
  margin: 0 auto;
}
.timeline-step {
  text-align: center;
  flex: 1;
  max-width: 260px;
  padding: 0 1rem;
}
.timeline-number {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--red);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.25rem;
  margin: 0 auto 1rem;
}
.timeline-step h3 {
  font-size: 1.1rem;
  margin-bottom: .5rem;
}
.timeline-step p {
  font-size: .9rem;
  color: var(--charcoal-light);
}

.timeline-connector {
  width: 60px;
  height: 2px;
  background: var(--grey-border);
  flex-shrink: 0;
  margin-top: 26px;
}

@media (max-width: 640px) {
  .timeline {
    flex-direction: column;
    align-items: center;
    gap: .5rem;
  }
  .timeline-connector {
    width: 2px;
    height: 32px;
    margin-top: 0;
  }
  .timeline-step { max-width: 100%; }
}

/* ---------- About ---------- */
.about-container { max-width: 720px; }
.about-content p {
  font-size: 1.05rem;
  color: var(--charcoal-light);
  margin-bottom: 1rem;
  text-align: center;
}

/* ---------- Contact ---------- */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  max-width: 900px;
  margin: 0 auto;
}
@media (max-width: 768px) {
  .contact-grid { grid-template-columns: 1fr; gap: 2rem; }
}

.form-group {
  margin-bottom: 1.25rem;
}
.form-group label {
  display: block;
  font-weight: 600;
  font-size: .9rem;
  margin-bottom: .35rem;
}
.required { color: var(--red); }

.form-group input,
.form-group textarea {
  width: 100%;
  padding: .7rem .9rem;
  border: 1px solid var(--grey-border);
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: .95rem;
  transition: border-color var(--transition), box-shadow var(--transition);
  background: var(--white);
}
.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(226, 52, 7, .12);
  outline: none;
}
.form-group textarea { resize: vertical; }

.form-note {
  margin-top: 1rem;
  font-size: .9rem;
  color: var(--red);
  font-weight: 500;
}

.form-message {
  margin-top: 1.25rem;
  padding: 1rem 1.25rem;
  border-radius: var(--radius);
  font-size: .95rem;
}
.form-message--success {
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.4);
  color: #15803d;
}
.form-message--success a { color: #15803d; }
.form-message--error {
  background: rgba(226, 52, 7, 0.08);
  border: 1px solid rgba(226, 52, 7, 0.3);
  color: var(--charcoal);
}
.form-message--error a { color: var(--red); }

.contact-info h3 {
  font-size: 1.2rem;
  margin-bottom: 1.25rem;
}
.contact-details {
  list-style: none;
  margin-bottom: 1.5rem;
}
.contact-details li {
  display: flex;
  align-items: center;
  gap: .65rem;
  margin-bottom: 1rem;
  font-size: .95rem;
}
.contact-details svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: var(--red);
}
.contact-note {
  font-size: .85rem;
  color: var(--charcoal-light);
  border-left: 3px solid var(--red);
  padding-left: .75rem;
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--charcoal);
  color: rgba(255, 255, 255, .7);
  padding: 2.5rem 0;
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 1rem 2rem;
  text-align: center;
  font-size: .85rem;
}
.footer-copy { flex-basis: 100%; }
.footer-links {
  display: flex;
  gap: 1.5rem;
}
.footer-link {
  background: none;
  border: none;
  color: rgba(255, 255, 255, .7);
  cursor: pointer;
  font-size: .85rem;
  text-decoration: underline;
  font-family: var(--font);
  transition: color var(--transition);
}
.footer-link:hover { color: var(--white); }
.footer-disclaimer {
  flex-basis: 100%;
  font-size: .78rem;
  opacity: .6;
  margin-top: .5rem;
}

/* ---------- Modal ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(58, 68, 73, .55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 20px;
  opacity: 0;
  transition: opacity var(--transition);
}
.modal-overlay:not([hidden]) {
  opacity: 1;
}
.modal-overlay[hidden] {
  display: none;
}

.modal {
  background: var(--white);
  border-radius: var(--radius);
  max-width: 560px;
  width: 100%;
  padding: 2.5rem;
  position: relative;
  box-shadow: var(--shadow-lg);
  max-height: 80vh;
  overflow-y: auto;
}
.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--charcoal);
  line-height: 1;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background var(--transition);
}
.modal-close:hover { background: var(--grey-bg); }
.modal h2 { margin-bottom: 1rem; font-size: 1.4rem; }
.modal p { font-size: .93rem; color: var(--charcoal-light); margin-bottom: .75rem; }

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--grey-bg); }
::-webkit-scrollbar-thumb { background: var(--grey-border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--charcoal-light); }
