/* =============================================
   M2 IMOBILIÁRIA — DESIGN SYSTEM
   ============================================= */

/* --- Google Fonts --- */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,500;0,600;0,700;1,400&family=Inter:wght@300;400;500;600;700&display=swap');

/* --- CSS Variables / Design Tokens --- */
:root {
  /* Colors */
  --black:         #0a0a0a;
  --black-soft:    #111111;
  --black-card:    #1a1a1a;
  --black-border:  #2a2a2a;
  --white:         #ffffff;
  --white-soft:    #f5f5f5;
  --white-muted:   #ececec;
  --gray-dark:     #222222;
  --gray-mid:      #555555;
  --gray-light:    #888888;
  --gray-pale:     #cccccc;

  /* Gold Palette */
  --gold:          #c9a84c;
  --gold-bright:   #d4af37;
  --gold-light:    #f0c040;
  --gold-pale:     #e8d5a3;
  --gold-dark:     #9a7c2e;

  /* Gradient Golds */
  --gold-gradient: linear-gradient(135deg, #c9a84c 0%, #f0c040 50%, #c9a84c 100%);
  --gold-gradient-subtle: linear-gradient(135deg, #c9a84c 0%, #d4af37 100%);

  /* Typography */
  --font-display: 'Playfair Display', Georgia, serif;
  --font-body:    'Inter', system-ui, sans-serif;

  /* Font Sizes */
  --text-xs:   0.75rem;
  --text-sm:   0.875rem;
  --text-base: 1rem;
  --text-lg:   1.125rem;
  --text-xl:   1.25rem;
  --text-2xl:  1.5rem;
  --text-3xl:  1.875rem;
  --text-4xl:  2.25rem;
  --text-5xl:  3rem;
  --text-6xl:  3.75rem;

  /* Spacing */
  --space-1:  0.25rem;
  --space-2:  0.5rem;
  --space-3:  0.75rem;
  --space-4:  1rem;
  --space-5:  1.25rem;
  --space-6:  1.5rem;
  --space-8:  2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;

  /* Border Radius */
  --radius-sm:  4px;
  --radius-md:  8px;
  --radius-lg:  12px;
  --radius-xl:  16px;
  --radius-2xl: 24px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm:   0 2px 8px rgba(0,0,0,0.12);
  --shadow-md:   0 4px 20px rgba(0,0,0,0.2);
  --shadow-lg:   0 8px 40px rgba(0,0,0,0.3);
  --shadow-gold: 0 4px 20px rgba(201,168,76,0.3);
  --shadow-gold-lg: 0 8px 40px rgba(201,168,76,0.4);

  /* Transitions */
  --transition-fast:   150ms ease;
  --transition-base:   300ms ease;
  --transition-slow:   500ms ease;
  --transition-spring: 400ms cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Navbar */
  --navbar-height: 80px;
  --navbar-scroll-height: 64px;
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-body);
  background-color: var(--white-soft);
  color: var(--gray-dark);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

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

ul, ol {
  list-style: none;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
}

input, select, textarea {
  font-family: inherit;
  font-size: inherit;
}

/* --- Typography --- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  line-height: 1.2;
  font-weight: 600;
}

.text-gold { color: var(--gold); }
.text-white { color: var(--white); }
.text-gray { color: var(--gray-mid); }

/* --- Layout --- */
.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 var(--space-6);
}

.section {
  padding: var(--space-20) 0;
}

.section-dark {
  background-color: var(--white);
  color: var(--gray-dark);
}

.section-darker {
  background-color: var(--white-soft);
  color: var(--gray-dark);
}

.section-light {
  background-color: var(--white-soft);
  color: var(--gray-dark);
}

.section-white {
  background-color: var(--white);
  color: var(--gray-dark);
}

/* --- Section Headers --- */
.section-header {
  text-align: center;
  margin-bottom: var(--space-12);
}

.section-tag {
  display: inline-block;
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: var(--space-3);
  padding: var(--space-1) var(--space-4);
  border: 1px solid rgba(201,168,76,0.3);
  border-radius: var(--radius-full);
  background: rgba(201,168,76,0.08);
}

.section-title {
  font-size: clamp(var(--text-3xl), 4vw, var(--text-5xl));
  font-weight: 700;
  margin-bottom: var(--space-4);
}

.section-title-dark { color: var(--black); }
.section-title-light { color: var(--gray-dark); }

.section-subtitle {
  font-size: var(--text-lg);
  color: var(--gray-light);
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.7;
}

.section-subtitle-light {
  color: var(--gray-mid);
}

.gold-underline {
  display: inline-block;
  position: relative;
}

.gold-underline::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 0;
  width: 60%;
  height: 3px;
  background: var(--gold-gradient);
  border-radius: 2px;
}

/* --- Navbar --- */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: var(--navbar-height);
  transition: all var(--transition-base);
  background: transparent;
}

.navbar.scrolled {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--white-muted);
  height: var(--navbar-scroll-height);
  box-shadow: var(--shadow-md);
}

.nav-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 var(--space-6);
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-8);
}

.nav-logo {
  flex-shrink: 0;
  height: 52px;
  display: flex;
  align-items: center;
}

.logo-img {
  height: 52px;
  width: auto;
  object-fit: contain;
  transition: opacity var(--transition-base);
}

.navbar:not(.scrolled) .logo-dark { display: none; }
.navbar:not(.scrolled) .logo-light { display: block; opacity: 1; }
.navbar.scrolled .logo-dark { display: none; }
.navbar.scrolled .logo-light { display: block; opacity: 1; }
.navbar.nav-light .logo-dark { display: none; }
.navbar.nav-light .logo-light { display: block; opacity: 1; }

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex: 1;
  justify-content: center;
}

.nav-link {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--gray-dark);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  position: relative;
  letter-spacing: 0.02em;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 2px;
  background: var(--gold-gradient);
  border-radius: 1px;
  transition: width var(--transition-base);
}

.nav-link:hover,
.nav-link.active {
  color: var(--gold);
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 70%;
}

.nav-btn-corretor {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--gold);
  padding: var(--space-2) var(--space-5);
  border: 1.5px solid var(--gold);
  border-radius: var(--radius-full);
  transition: all var(--transition-base);
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.nav-btn-corretor:hover {
  background: var(--gold);
  color: var(--black);
  box-shadow: var(--shadow-gold);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: var(--space-2);
  z-index: 10;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--gray-dark);
  border-radius: 2px;
  transition: all var(--transition-base);
}

.nav-toggle.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.active span:nth-child(2) { opacity: 0; }
.nav-toggle.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* --- WhatsApp Float --- */
.whatsapp-float {
  position: fixed;
  bottom: 32px;
  right: 32px;
  z-index: 999;
  width: 60px;
  height: 60px;
  background: #25D366;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  box-shadow: 0 4px 20px rgba(37,211,102,0.5);
  transition: all var(--transition-spring);
  animation: waPulse 3s ease-in-out infinite;
}

.whatsapp-float:hover {
  transform: scale(1.12);
  box-shadow: 0 6px 30px rgba(37,211,102,0.7);
  animation: none;
}

.whatsapp-tooltip {
  position: absolute;
  right: 70px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--black-soft);
  color: var(--white);
  font-size: var(--text-sm);
  font-weight: 500;
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-md);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-base);
  border: 1px solid var(--black-border);
}

.whatsapp-tooltip::after {
  content: '';
  position: absolute;
  left: 100%;
  top: 50%;
  transform: translateY(-50%);
  border: 6px solid transparent;
  border-left-color: var(--black-soft);
}

.whatsapp-float:hover .whatsapp-tooltip {
  opacity: 1;
}

@keyframes waPulse {
  0%, 100% { box-shadow: 0 4px 20px rgba(37,211,102,0.5); }
  50% { box-shadow: 0 4px 30px rgba(37,211,102,0.8), 0 0 0 8px rgba(37,211,102,0.1); }
}

/* --- Footer --- */
.footer {
  background: var(--white);
  border-top: 1px solid var(--white-muted);
  padding: var(--space-16) 0 var(--space-8);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.5fr;
  gap: var(--space-10);
  margin-bottom: var(--space-12);
}

.footer-logo {
  height: 60px;
  width: auto;
  margin-bottom: var(--space-5);
}

.footer-desc {
  font-size: var(--text-sm);
  color: var(--gray-mid);
  line-height: 1.8;
  margin-bottom: var(--space-5);
}

.footer-creci {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--gold);
  letter-spacing: 0.1em;
  padding: var(--space-2) var(--space-4);
  border: 1px solid rgba(201,168,76,0.3);
  border-radius: var(--radius-full);
  background: rgba(201,168,76,0.05);
}

.footer-heading {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: var(--space-5);
}

.footer-links li {
  margin-bottom: var(--space-3);
}

.footer-links a {
  font-size: var(--text-sm);
  color: var(--gray-mid);
  transition: color var(--transition-fast);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

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

.footer-links a::before {
  content: '›';
  color: var(--gold);
  font-size: 1.1em;
}

.footer-contact-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.footer-contact-icon {
  width: 36px;
  height: 36px;
  background: rgba(201,168,76,0.1);
  border: 1px solid rgba(201,168,76,0.2);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--gold);
}

.footer-contact-text {
  font-size: var(--text-sm);
  color: var(--gray-mid);
  line-height: 1.5;
}

.footer-contact-text strong {
  display: block;
  color: var(--black);
  font-weight: 500;
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 2px;
}

.footer-social {
  display: flex;
  gap: var(--space-3);
  margin-top: var(--space-5);
}

.footer-social-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: var(--white-soft);
  border: 1px solid var(--white-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray-mid);
  transition: all var(--transition-base);
  font-size: var(--text-sm);
}

.footer-social-btn:hover {
  background: var(--gold);
  color: var(--black);
  border-color: var(--gold);
  transform: translateY(-3px);
  box-shadow: var(--shadow-gold);
}

.footer-divider {
  border: none;
  border-top: 1px solid var(--white-muted);
  margin-bottom: var(--space-8);
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-4);
}

.footer-bottom-text {
  font-size: var(--text-xs);
  color: var(--gray-mid);
}

.footer-bottom-text span {
  color: var(--gold);
}

/* --- Loading Screen --- */
.loading-screen {
  position: fixed;
  inset: 0;
  background: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  z-index: 9999;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

.loading-screen.hidden {
  opacity: 0;
  visibility: hidden;
}

.loading-logo {
  height: 80px;
  margin-bottom: var(--space-8);
  animation: logoFloat 2s ease-in-out infinite;
}

.loading-bar-track {
  width: 200px;
  height: 2px;
  background: var(--white-muted);
  border-radius: 2px;
  overflow: hidden;
}

.loading-bar-fill {
  height: 100%;
  background: var(--gold-gradient);
  border-radius: 2px;
  animation: loadingBar 1.5s ease-in-out forwards;
}

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

@keyframes loadingBar {
  0% { width: 0; }
  100% { width: 100%; }
}

/* --- Page Wrapper --- */
#app {
  min-height: 100vh;
}

/* --- Responsive --- */
@media (max-width: 1024px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-8);
  }
}

@media (max-width: 768px) {
  :root {
    --navbar-height: 70px;
  }

  .nav-toggle {
    display: flex;
  }

  .nav-links {
    position: fixed;
    inset: 0;
    top: 0;
    background: var(--white);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: var(--space-6);
    transform: translateX(100%);
    transition: transform var(--transition-slow);
    z-index: 5;
    border-left: 1px solid var(--white-muted);
  }

  .nav-links.open {
    transform: translateX(0);
  }

  .nav-link {
    font-size: var(--text-xl);
    color: var(--gray-dark);
  }

  .nav-btn-corretor {
    font-size: var(--text-lg);
    padding: var(--space-3) var(--space-8);
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: var(--space-8);
  }

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

  .whatsapp-float {
    bottom: 20px;
    right: 20px;
    width: 54px;
    height: 54px;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 var(--space-4);
  }

  .section {
    padding: var(--space-16) 0;
  }
}
