/*
Theme Name: ClearMap Lending
Theme URI: https://clearmaplending.com.au
Author: ClearMap Lending
Author URI: https://clearmaplending.com.au
Description: Strategy-First Mortgage Brokers Australia - Elementor compatible theme
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.5
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: clearmap-lending
Tags: one-column, custom-colors, custom-logo, custom-menu, elementor, mortgage, finance
*/

/* ============================================
   CSS VARIABLES / DESIGN TOKENS
   ============================================ */
:root {
  --cm-bg: #FAFAF8;
  --cm-foreground: #111111;
  --cm-card: #FFFFFF;
  --cm-secondary: #F0EFE9;
  --cm-muted: #6B6B6B;
  --cm-accent: #F5C518;
  --cm-accent-dark: #D4A90F;
  --cm-border: #E5E3DC;
  --cm-dark-surface: #1A1A1A;
  --cm-radius: 0.75rem;
  --cm-font-heading: 'Playfair Display', serif;
  --cm-font-body: 'DM Sans', sans-serif;
}

/* ============================================
   RESET & BASE
   ============================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }
body {
  font-family: var(--cm-font-body);
  background: var(--cm-bg);
  color: var(--cm-foreground);
  line-height: 1.6;
}
h1, h2, h3, h4, h5, h6 { font-family: var(--cm-font-heading); }
a { text-decoration: none; color: inherit; }
img { max-width: 100%; height: auto; display: block; }
.container { max-width: 1280px; margin: 0 auto; padding: 0 1.5rem; }

/* ============================================
   BUTTONS
   ============================================ */
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-family: var(--cm-font-body); font-weight: 600; font-size: 0.875rem;
  padding: 0.625rem 1.5rem; border-radius: 999px; cursor: pointer;
  transition: all 0.2s ease; border: none; text-decoration: none;
}
.btn-primary { background: var(--cm-foreground); color: var(--cm-bg); }
.btn-primary:hover { background: #333; }
.btn-outline { background: transparent; color: var(--cm-foreground); border: 1.5px solid var(--cm-border); }
.btn-outline:hover { border-color: var(--cm-foreground); }
.btn-gold { background: var(--cm-accent); color: var(--cm-foreground); font-size: 1rem; padding: 0.875rem 2rem; }
.btn-gold:hover { background: var(--cm-accent-dark); }
.btn-lg { font-size: 1rem; padding: 0.875rem 2rem; }

/* ============================================
   NAVBAR
   ============================================ */
.cm-navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  transition: all 0.3s ease;
}
.cm-navbar.scrolled {
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  background: rgba(250, 250, 248, 0.8);
  border-bottom: 1px solid rgba(229, 227, 220, 0.5);
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.cm-navbar .container {
  display: flex; align-items: center; justify-content: space-between;
  height: 5rem;
}
.cm-navbar .logo { display: flex; align-items: center; gap: 0.75rem; }
.cm-navbar .logo-badge {
  width: 2.25rem; height: 2.25rem; background: var(--cm-foreground);
  border-radius: 0.375rem; display: flex; align-items: center; justify-content: center;
  color: var(--cm-accent); font-family: var(--cm-font-heading); font-weight: 700; font-size: 0.875rem;
}
.cm-navbar .logo-text {
  font-family: var(--cm-font-heading); font-size: 1.125rem; font-weight: 600;
}
.cm-navbar .nav-links { display: flex; gap: 2rem; }
.cm-navbar .nav-links a {
  font-size: 0.875rem; font-weight: 500; color: var(--cm-muted);
  transition: color 0.2s;
}
.cm-navbar .nav-links a:hover { color: var(--cm-foreground); }
.cm-navbar .nav-ctas { display: flex; gap: 0.75rem; }
.cm-navbar .mobile-toggle {
  display: none; background: none; border: none; cursor: pointer;
  padding: 0.5rem; color: var(--cm-foreground);
}
.cm-mobile-menu {
  display: none; backdrop-filter: blur(20px); background: rgba(250,250,248,0.95);
  border-top: 1px solid var(--cm-border); padding: 1rem 1.5rem;
}
.cm-mobile-menu.active { display: block; }
.cm-mobile-menu a { display: block; padding: 0.5rem 0; font-size: 0.875rem; color: var(--cm-muted); }
.cm-mobile-menu .mobile-ctas { padding-top: 0.75rem; border-top: 1px solid var(--cm-border); margin-top: 0.75rem; display: flex; flex-direction: column; gap: 0.5rem; }

@media (max-width: 1023px) {
  .cm-navbar .nav-links, .cm-navbar .nav-ctas { display: none; }
  .cm-navbar .mobile-toggle { display: block; }
}

/* ============================================
   HERO
   ============================================ */
.cm-hero { padding: 7rem 0 4rem; overflow: hidden; }
.cm-hero .grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4rem; align-items: center; }
.cm-hero .label-badge {
  display: inline-block; padding: 0.375rem 1rem; border-radius: 999px;
  background: rgba(245, 197, 24, 0.1); font-size: 0.75rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.15em; color: var(--cm-accent-dark);
  margin-bottom: 1.5rem;
}
.cm-hero h1 { font-size: clamp(2.25rem, 5vw, 3.75rem); font-weight: 600; line-height: 1.1; margin-bottom: 1.5rem; }
.cm-hero .squiggle-underline {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100' height='12' viewBox='0 0 100 12'%3E%3Cpath d='M0 8 Q12.5 0 25 8 Q37.5 16 50 8 Q62.5 0 75 8 Q87.5 16 100 8' fill='none' stroke='%23F5C518' stroke-width='3' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: repeat-x; background-position: bottom; background-size: 100px 12px;
  padding-bottom: 8px;
}
.cm-hero .subtext { color: var(--cm-muted); font-size: 1.125rem; max-width: 32rem; margin-bottom: 2rem; line-height: 1.7; }
.cm-hero .cta-row { display: flex; gap: 0.75rem; margin-bottom: 2rem; flex-wrap: wrap; }
.cm-hero .trust-row { display: flex; align-items: center; gap: 0.75rem; }
.cm-hero .avatars { display: flex; }
.cm-hero .avatar {
  width: 2rem; height: 2rem; border-radius: 50%; background: var(--cm-secondary);
  border: 2px solid var(--cm-bg); display: flex; align-items: center; justify-content: center;
  font-size: 0.625rem; font-weight: 600; color: var(--cm-muted); margin-left: -0.5rem;
}
.cm-hero .avatar:first-child { margin-left: 0; }
.cm-hero .stars { display: flex; gap: 2px; color: var(--cm-accent); }
.cm-hero .trust-text { font-size: 0.875rem; color: var(--cm-muted); font-weight: 500; }

.cm-hero .image-block { position: relative; }
.cm-hero .image-block img { border-radius: 1rem; width: 100%; aspect-ratio: 4/3; object-fit: cover; }
.cm-hero .float-card {
  position: absolute; background: var(--cm-card); border-radius: 0.75rem;
  box-shadow: 0 10px 40px rgba(0,0,0,0.1); padding: 1rem;
  animation: floatCard 3s ease-in-out infinite;
}
.cm-hero .float-card .big { font-size: 1.5rem; font-weight: 700; font-family: var(--cm-font-heading); }
.cm-hero .float-card .small { font-size: 0.75rem; color: var(--cm-muted); }
.cm-hero .float-card.top-left { top: -1rem; left: -1rem; }
.cm-hero .float-card.bottom-right { bottom: -1rem; right: -1rem; }
.cm-hero .float-card.bottom-right .big { color: var(--cm-accent); }
.cm-hero .bottom-bar {
  position: absolute; bottom: 1.5rem; left: 1rem; right: 1rem;
  background: rgba(255,255,255,0.9); backdrop-filter: blur(10px);
  border-radius: 0.75rem; box-shadow: 0 4px 20px rgba(0,0,0,0.08);
  padding: 0.75rem; display: flex; align-items: center; gap: 0.75rem;
}
.cm-hero .bottom-bar .icon-box {
  width: 2rem; height: 2rem; border-radius: 0.5rem;
  background: rgba(245,197,24,0.1); display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.cm-hero .bottom-bar .bar-title { font-size: 0.75rem; font-weight: 600; }
.cm-hero .bottom-bar .bar-sub { font-size: 0.625rem; color: var(--cm-muted); }
.cm-hero .bottom-bar .arrow-btn {
  width: 2rem; height: 2rem; border-radius: 50%; background: var(--cm-accent);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  border: none; cursor: pointer;
}

@keyframes floatCard {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

@media (max-width: 1023px) {
  .cm-hero .grid { grid-template-columns: 1fr; gap: 2.5rem; }
  .cm-hero { padding: 6rem 0 3rem; }
}

/* ============================================
   TRUST BAR
   ============================================ */
.cm-trustbar {
  padding: 2rem 0; background: rgba(240, 239, 233, 0.6);
  border-top: 1px solid rgba(229, 227, 220, 0.5);
  border-bottom: 1px solid rgba(229, 227, 220, 0.5);
}
.cm-trustbar .grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem; }
.cm-trustbar .stat { display: flex; align-items: center; gap: 0.75rem; justify-content: center; }
.cm-trustbar .stat-icon {
  width: 2.5rem; height: 2.5rem; border-radius: 0.5rem; background: rgba(245,197,24,0.1);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0; color: var(--cm-accent);
}
.cm-trustbar .stat-value { font-size: 1.125rem; font-weight: 700; font-family: var(--cm-font-heading); }
.cm-trustbar .stat-label { font-size: 0.75rem; color: var(--cm-muted); }

@media (max-width: 767px) {
  .cm-trustbar .grid { grid-template-columns: 1fr 1fr; }
}

/* ============================================
   SERVICES
   ============================================ */
.cm-services { padding: 5rem 0 7rem; }
.cm-services .header { display: flex; flex-direction: column; gap: 1rem; margin-bottom: 3rem; }
.cm-services .section-label { font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.2em; color: var(--cm-accent); }
.cm-services .section-heading { font-size: clamp(1.875rem, 3vw, 3rem); font-weight: 600; line-height: 1.2; }
.cm-services .section-sub { color: var(--cm-muted); font-size: 1rem; max-width: 28rem; }
.cm-services .cards { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.cm-services .card {
  background: var(--cm-card); border-radius: 1rem; border: 1px solid rgba(229,227,220,0.5);
  padding: 2rem; transition: all 0.3s; cursor: pointer;
}
.cm-services .card:hover { box-shadow: 0 20px 40px rgba(0,0,0,0.08); transform: translateY(-4px); }
.cm-services .card-top { display: flex; justify-content: space-between; margin-bottom: 1.5rem; }
.cm-services .card-icon {
  width: 3rem; height: 3rem; border-radius: 0.75rem; background: rgba(245,197,24,0.1);
  display: flex; align-items: center; justify-content: center; color: var(--cm-accent);
}
.cm-services .card-arrow { color: var(--cm-muted); transition: all 0.3s; }
.cm-services .card:hover .card-arrow { color: var(--cm-accent); transform: translate(2px, -2px); }
.cm-services .card h3 { font-size: 1.25rem; font-weight: 600; margin-bottom: 0.75rem; }
.cm-services .card p { font-size: 0.875rem; color: var(--cm-muted); line-height: 1.7; }

@media (max-width: 639px) {
  .cm-services .cards { grid-template-columns: 1fr; }
}
@media (min-width: 768px) {
  .cm-services .header { flex-direction: row; align-items: flex-end; justify-content: space-between; }
  .cm-services .section-sub { text-align: right; }
}

/* ============================================
   WHY US
   ============================================ */
.cm-whyus {
  padding: 5rem 0 7rem; background: var(--cm-foreground); color: var(--cm-bg);
}
.cm-whyus .header { text-align: center; margin-bottom: 3.5rem; }
.cm-whyus .section-label { font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.2em; color: var(--cm-accent); margin-bottom: 0.75rem; display: block; }
.cm-whyus .section-heading { font-size: clamp(1.875rem, 3vw, 3rem); font-weight: 600; }
.cm-whyus .reasons { display: grid; grid-template-columns: repeat(4, 1fr); gap: 2rem; }
.cm-whyus .reason { text-align: center; }
.cm-whyus .reason-icon {
  width: 3.5rem; height: 3.5rem; border-radius: 1rem; background: rgba(245,197,24,0.15);
  display: flex; align-items: center; justify-content: center; margin: 0 auto 1.25rem; color: var(--cm-accent);
}
.cm-whyus .reason h3 { font-size: 1.125rem; font-weight: 600; margin-bottom: 0.75rem; }
.cm-whyus .reason p { font-size: 0.875rem; color: rgba(250,250,248,0.6); line-height: 1.7; }

@media (max-width: 1023px) { .cm-whyus .reasons { grid-template-columns: 1fr 1fr; } }
@media (max-width: 639px) { .cm-whyus .reasons { grid-template-columns: 1fr; } }

/* ============================================
   PROCESS
   ============================================ */
.cm-process { padding: 5rem 0 7rem; }
.cm-process .header { text-align: center; margin-bottom: 3.5rem; }
.cm-process .section-label { font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.2em; color: var(--cm-accent); margin-bottom: 0.75rem; display: block; }
.cm-process .section-heading { font-size: clamp(1.875rem, 3vw, 3rem); font-weight: 600; }
.cm-process .steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; position: relative; }
.cm-process .steps::before {
  content: ''; position: absolute; top: 4rem; left: 20%; right: 20%;
  height: 1px; background: var(--cm-border); display: block;
}
.cm-process .step { text-align: center; position: relative; }
.cm-process .step-number {
  font-size: clamp(3.5rem, 5vw, 4.5rem); font-weight: 700; font-family: var(--cm-font-heading);
  color: rgba(229,227,220,0.6); line-height: 1; display: inline-block; position: relative; margin-bottom: 1.5rem;
}
.cm-process .step-icon {
  position: absolute; bottom: -0.25rem; left: 50%; transform: translateX(-50%);
  width: 3rem; height: 3rem; border-radius: 0.75rem; background: rgba(245,197,24,0.1);
  display: flex; align-items: center; justify-content: center; color: var(--cm-accent);
}
.cm-process .step h3 { font-size: 1.25rem; font-weight: 600; margin-bottom: 0.75rem; }
.cm-process .step p { font-size: 0.875rem; color: var(--cm-muted); line-height: 1.7; max-width: 18rem; margin: 0 auto; }

@media (max-width: 767px) {
  .cm-process .steps { grid-template-columns: 1fr; }
  .cm-process .steps::before { display: none; }
}

/* ============================================
   TESTIMONIALS
   ============================================ */
.cm-testimonials { padding: 5rem 0 7rem; background: rgba(240, 239, 233, 0.4); }
.cm-testimonials .header { margin-bottom: 3rem; padding: 0 1.5rem; }
.cm-testimonials .section-label { font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.2em; color: var(--cm-accent); margin-bottom: 0.75rem; display: block; }
.cm-testimonials .section-heading { font-size: clamp(1.875rem, 3vw, 3rem); font-weight: 600; }
.cm-testimonials .scroll-row {
  display: flex; gap: 1.5rem; overflow-x: auto; padding: 0 1.5rem 1rem;
  scroll-snap-type: x mandatory; scrollbar-width: none;
}
.cm-testimonials .scroll-row::-webkit-scrollbar { display: none; }
.cm-testimonials .tcard {
  flex-shrink: 0; width: 24rem; background: var(--cm-card); border-radius: 1rem;
  border: 1px solid rgba(229,227,220,0.5); padding: 2rem; scroll-snap-align: start;
}
.cm-testimonials .stars { display: flex; gap: 2px; color: var(--cm-accent); margin-bottom: 1rem; }
.cm-testimonials .tcard blockquote { font-weight: 500; line-height: 1.6; margin-bottom: 1.5rem; }
.cm-testimonials .tcard .author { display: flex; align-items: center; gap: 0.75rem; }
.cm-testimonials .tcard .author-avatar {
  width: 2.5rem; height: 2.5rem; border-radius: 50%; background: rgba(245,197,24,0.1);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem; font-weight: 700; color: var(--cm-accent);
}
.cm-testimonials .tcard .author-name { font-size: 0.875rem; font-weight: 600; }
.cm-testimonials .tcard .author-type { font-size: 0.75rem; color: var(--cm-muted); }

/* ============================================
   CALCULATOR
   ============================================ */
.cm-calculator { padding: 5rem 0 7rem; }
.cm-calculator .inner { max-width: 48rem; margin: 0 auto; }
.cm-calculator .header { text-align: center; margin-bottom: 3rem; }
.cm-calculator .section-label { font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.2em; color: var(--cm-accent); margin-bottom: 0.75rem; display: block; }
.cm-calculator .section-heading { font-size: clamp(1.875rem, 3vw, 3rem); font-weight: 600; }
.cm-calculator .calc-card {
  background: var(--cm-card); border-radius: 1rem; border: 1px solid rgba(229,227,220,0.5);
  padding: 2rem 3rem;
}
.cm-calculator .slider-group { margin-bottom: 2rem; }
.cm-calculator .slider-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.75rem; }
.cm-calculator .slider-header label { font-size: 0.875rem; font-weight: 600; }
.cm-calculator .slider-header span { font-size: 0.875rem; font-weight: 700; color: var(--cm-accent); }
.cm-calculator input[type="range"] {
  width: 100%; height: 0.5rem; border-radius: 999px; background: var(--cm-secondary);
  appearance: none; -webkit-appearance: none; cursor: pointer; outline: none;
}
.cm-calculator input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 1.25rem; height: 1.25rem; border-radius: 50%;
  background: var(--cm-accent); box-shadow: 0 2px 6px rgba(0,0,0,0.15); cursor: pointer;
}
.cm-calculator input[type="range"]::-moz-range-thumb {
  width: 1.25rem; height: 1.25rem; border-radius: 50%; border: none;
  background: var(--cm-accent); box-shadow: 0 2px 6px rgba(0,0,0,0.15); cursor: pointer;
}
.cm-calculator .slider-range { display: flex; justify-content: space-between; font-size: 0.75rem; color: var(--cm-muted); margin-top: 0.25rem; }
.cm-calculator .result {
  text-align: center; padding: 1.5rem; border-radius: 0.75rem;
  background: rgba(245,197,24,0.05); border: 1px solid rgba(245,197,24,0.2); margin-bottom: 2rem;
}
.cm-calculator .result .result-label { font-size: 0.875rem; color: var(--cm-muted); margin-bottom: 0.5rem; }
.cm-calculator .result .result-value {
  font-size: clamp(2rem, 4vw, 3rem); font-weight: 700; font-family: var(--cm-font-heading);
}
.cm-calculator .calc-cta { text-align: center; }

@media (max-width: 639px) {
  .cm-calculator .calc-card { padding: 1.5rem; }
}

/* ============================================
   FINAL CTA
   ============================================ */
.cm-final-cta {
  padding: 5rem 0 7rem; background: var(--cm-foreground); color: var(--cm-bg); text-align: center;
}
.cm-final-cta .inner { max-width: 42rem; margin: 0 auto; }
.cm-final-cta h2 { font-size: clamp(1.875rem, 3.5vw, 3rem); font-weight: 600; margin-bottom: 1.5rem; line-height: 1.2; }
.cm-final-cta p { color: rgba(250,250,248,0.6); font-size: 1.125rem; margin-bottom: 2.5rem; }
.cm-final-cta .secondary-link { display: block; margin-top: 1.5rem; font-size: 0.875rem; color: rgba(250,250,248,0.4); }
.cm-final-cta .secondary-link a { text-decoration: underline; transition: color 0.2s; }
.cm-final-cta .secondary-link a:hover { color: var(--cm-accent); }

/* ============================================
   FOOTER
   ============================================ */
.cm-footer {
  padding: 4rem 0; background: var(--cm-foreground); color: var(--cm-bg);
  border-top: 1px solid rgba(250,250,248,0.1);
}
.cm-footer .grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 2.5rem; margin-bottom: 3rem; }
.cm-footer .logo { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 1rem; }
.cm-footer .logo-badge {
  width: 2.25rem; height: 2.25rem; background: var(--cm-accent); border-radius: 0.375rem;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--cm-font-heading); font-weight: 700; font-size: 0.875rem; color: var(--cm-foreground);
}
.cm-footer .logo-text { font-family: var(--cm-font-heading); font-size: 1.125rem; font-weight: 600; }
.cm-footer .tagline { color: rgba(250,250,248,0.5); font-size: 0.875rem; line-height: 1.6; }
.cm-footer h4 { font-size: 0.875rem; font-weight: 600; margin-bottom: 1rem; }
.cm-footer ul { list-style: none; }
.cm-footer ul li { margin-bottom: 0.625rem; }
.cm-footer ul li, .cm-footer ul li a { font-size: 0.875rem; color: rgba(250,250,248,0.5); transition: color 0.2s; }
.cm-footer ul li a:hover { color: var(--cm-accent); }
.cm-footer .bottom { border-top: 1px solid rgba(250,250,248,0.1); padding-top: 2rem; }
.cm-footer .copyright { font-size: 0.75rem; color: rgba(250,250,248,0.3); margin-bottom: 0.5rem; }
.cm-footer .disclaimer { font-size: 0.75rem; color: rgba(250,250,248,0.2); max-width: 48rem; line-height: 1.6; }

@media (max-width: 767px) {
  .cm-footer .grid { grid-template-columns: 1fr; }
}

/* ============================================
   SCROLL ANIMATIONS
   ============================================ */
.animate-in-view {
  opacity: 0; transform: translateY(24px);
  transition: opacity 0.7s ease-out, transform 0.7s ease-out;
}
.animate-in-view.is-visible { opacity: 1; transform: translateY(0); }

/* ============================================
   ELEMENTOR OVERRIDES
   ============================================ */
.elementor-page .cm-navbar { position: relative; }
.elementor-editor-active .animate-in-view { opacity: 1; transform: none; }
