/* ==========================================================================
   Connect Instalações Elétricas — style.css
   Sections: Reset, Base, Typography, Layout, Nav, Hero, Services,
   Portfolio, About, Contact, Footer, WhatsApp Float, Animations, Responsive
   ========================================================================== */

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
img { display: block; max-width: 100%; height: auto; }
a { text-decoration: none; color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
ul { list-style: none; }

/* ---------- Base ---------- */
:root {
  --bg-primary: #0D0D0D;
  --bg-secondary: #141414;
  --bg-card: #1A1A1A;
  --text-primary: #F5F5F5;
  --text-secondary: #999999;
  --accent: #F5820A;
  --accent-hover: #E07200;
  --border: #2A2A2A;
}

html, body { background: var(--bg-primary); }

body {
  font-family: 'Inter', sans-serif;
  font-display: swap;
  color: var(--text-primary);
  background: var(--bg-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

h1, h2, h3 {
  font-family: 'Titillium Web', sans-serif;
  font-display: swap;
  line-height: 1.1;
}

.section-label {
  font-family: 'Inter', sans-serif;
  text-transform: uppercase;
  color: var(--accent);
  letter-spacing: 0.2em;
  font-size: 0.7rem;
  margin-bottom: 0.75rem;
}

.section-title {
  font-family: 'Titillium Web', sans-serif;
  font-weight: 600;
  font-style: normal;
  font-size: clamp(1.75rem, 3.6vw, 2.5rem);
  letter-spacing: -0.01em;
  color: var(--text-primary);
  margin-bottom: 3rem;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 1rem 2rem;
  font-family: 'Inter', sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.85rem;
  font-weight: 700;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

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

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

.btn--block { width: 100%; }

@media (hover: hover) and (pointer: fine) {
  .btn--primary:hover { background: var(--accent-hover); transform: scale(1.02); }
  .btn--secondary:hover { background: rgba(245, 130, 10, 0.08); transform: scale(1.02); }
}

/* ---------- Navigation ---------- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

.nav.is-scrolled {
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border);
}

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.brand-logo__bolt {
  width: 20px;
  height: 32px;
  flex-shrink: 0;
}

.brand-logo__text {
  display: flex;
  flex-direction: column;
  line-height: 1;
}

.brand-logo__name {
  font-family: 'Titillium Web', sans-serif;
  font-weight: 700;
  font-size: 1.4rem;
  letter-spacing: 0.01em;
  color: var(--text-primary);
}

.brand-logo__sub {
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  font-size: 0.55rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-secondary);
  margin-top: 3px;
}

.footer .brand-logo__bolt { width: 16px; height: 26px; }
.footer .brand-logo__name { font-size: 1.15rem; }
.footer .brand-logo__sub { font-size: 0.5rem; }

.nav__links {
  display: none;
  gap: 2rem;
}

.nav__link {
  font-family: 'Inter', sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.8rem;
  color: var(--text-secondary);
  transition: color 0.2s ease;
}

.nav__link.is-active { color: var(--accent); }

@media (hover: hover) and (pointer: fine) {
  .nav__link:hover { color: var(--accent); }
}

.nav__toggle {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  background: transparent;
  border: none;
  cursor: pointer;
}

.nav__toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text-primary);
  margin: 0 auto;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.nav__toggle.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav__toggle.is-open span:nth-child(2) { opacity: 0; }
.nav__toggle.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.nav__links.is-open {
  display: flex;
  flex-direction: column;
  position: absolute;
  top: 72px;
  left: 0;
  width: 100%;
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border);
  padding: 1.5rem 24px;
  gap: 1.5rem;
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-primary);
  padding-top: 72px;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("images/portfolio-estacionamento.webp");
  background-size: cover;
  background-position: center 42%;
  filter: grayscale(0.4) brightness(0.5) contrast(1.1);
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 45% at 50% 34%, rgba(245, 130, 10, 0.12), transparent 70%),
    linear-gradient(180deg, rgba(13, 13, 13, 0.55) 0%, rgba(13, 13, 13, 0.86) 55%, var(--bg-primary) 100%);
}

.hero__content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.hero__label {
  font-family: 'Inter', sans-serif;
  text-transform: uppercase;
  color: var(--accent);
  letter-spacing: 0.2em;
  font-size: 0.7rem;
  margin-bottom: 1.5rem;
}

.hero__title {
  font-family: 'Titillium Web', sans-serif;
  font-weight: 600;
  font-size: clamp(2.3rem, 5.4vw, 4.25rem);
  color: var(--text-primary);
  letter-spacing: -0.01em;
  max-width: 800px;
}

.hero__subtitle {
  font-family: 'Inter', sans-serif;
  font-weight: 300;
  font-size: clamp(0.9rem, 2vw, 1.1rem);
  color: var(--text-secondary);
  margin-top: 1.5rem;
}

.hero__buttons {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 2.5rem;
  width: 100%;
  max-width: 340px;
}

.hero__rule {
  width: 60px;
  height: 1px;
  background: var(--accent);
  margin-top: 3rem;
  border: none;
}

/* ---------- Services ---------- */
.services {
  background: var(--bg-secondary);
  padding: clamp(80px, 10vw, 120px) 0;
}

.services__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

.card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 1.5rem;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

@media (hover: hover) and (pointer: fine) {
  .card:hover {
    border-color: rgba(245, 130, 10, 0.4);
    box-shadow: 0 4px 20px rgba(245, 130, 10, 0.08);
  }
}

.card__number {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  font-family: 'Inter', sans-serif;
  color: var(--border);
  font-size: 0.75rem;
}

.card__icon {
  width: 36px;
  height: 36px;
}

.card__title {
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  color: var(--text-primary);
  font-size: 1rem;
  margin-top: 1.2rem;
}

.card__desc {
  font-family: 'Inter', sans-serif;
  font-weight: 300;
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.7;
  margin-top: 0.6rem;
}

/* ---------- Portfolio ---------- */
.portfolio {
  background: var(--bg-primary);
  padding: clamp(80px, 10vw, 120px) 0;
}

.portfolio__filters {
  display: flex;
  gap: 2rem;
  overflow-x: auto;
  margin-bottom: 2.5rem;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.portfolio__filters::-webkit-scrollbar { display: none; }

.filter-tab {
  flex: 0 0 auto;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-secondary);
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  padding: 0.5rem 0;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.filter-tab.is-active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

@media (hover: hover) and (pointer: fine) {
  .filter-tab:hover { color: var(--text-primary); }
}

.portfolio__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

.portfolio-card {
  position: relative;
  display: block;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: var(--bg-card);
  border: 1px solid var(--border);
}

.portfolio-card.is-hidden { display: none; }

.portfolio-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  filter: saturate(1.08) contrast(1.1) brightness(1.03);
  transition: transform 0.4s ease;
}

.portfolio-card__scrim {
  position: absolute;
  inset: auto 0 0 0;
  height: 60%;
  background: linear-gradient(180deg, transparent, rgba(13, 13, 13, 0.94) 90%);
  z-index: 1;
  pointer-events: none;
}

.portfolio-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(245, 130, 10, 0.15);
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 1;
}

.portfolio-card__label {
  position: absolute;
  left: 1rem;
  right: 1rem;
  bottom: 1rem;
  z-index: 2;
  color: var(--text-primary);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.portfolio-card__label::before {
  content: "";
  display: block;
  width: 20px;
  height: 2px;
  background: var(--accent);
  margin-bottom: 0.5rem;
}

@media (hover: hover) and (pointer: fine) {
  .portfolio-card:hover::before { opacity: 1; }
  .portfolio-card:hover img { transform: scale(1.05); }
}

/* ---------- About ---------- */
.about {
  background: var(--bg-secondary);
  padding: clamp(80px, 10vw, 120px) 0;
}

.about__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
}

.about__image img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
}

.about__body {
  font-family: 'Inter', sans-serif;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 2.5rem;
}

.about__stats {
  display: flex;
  gap: 2rem;
  margin-bottom: 2.5rem;
  flex-wrap: wrap;
}

.stat__number {
  display: block;
  font-family: 'Titillium Web', sans-serif;
  font-weight: 700;
  color: var(--accent);
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1;
}

.stat__label {
  display: block;
  font-family: 'Inter', sans-serif;
  color: var(--text-secondary);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-top: 0.5rem;
}

/* ---------- Contact ---------- */
.contact {
  background: var(--bg-primary);
  padding: clamp(80px, 10vw, 120px) 0;
}

.contact__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
}

.contact__subtext {
  font-family: 'Inter', sans-serif;
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.7;
  margin-bottom: 2rem;
}

.contact__list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 2rem;
}

.contact__item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.contact__item svg { flex: 0 0 auto; }

/* ---------- FAQ Chat Widget ---------- */
.faq-chat-wrap {
  max-width: 640px;
  margin: 4rem auto 0;
  padding-top: 3rem;
  border-top: 1px solid var(--border);
}

.faq-chat-wrap__label {
  font-family: 'Inter', sans-serif;
  text-transform: uppercase;
  color: var(--accent);
  letter-spacing: 0.2em;
  font-size: 0.7rem;
  margin-bottom: 1rem;
  text-align: center;
}

.faq-chat {
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 1.25rem;
  margin-bottom: 2rem;
}

.faq-chat__window {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  max-height: 280px;
  overflow-y: auto;
  margin-bottom: 1rem;
  padding-right: 0.25rem;
}

.faq-chat__bubble {
  max-width: 88%;
  padding: 0.65rem 0.9rem;
  font-size: 0.85rem;
  line-height: 1.55;
  opacity: 0;
  transform: translateY(6px);
}

@media (prefers-reduced-motion: no-preference) {
  .faq-chat__bubble {
    transition: opacity 0.3s ease, transform 0.3s ease;
  }
}

.faq-chat__bubble.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.faq-chat__bubble--bot {
  align-self: flex-start;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  color: var(--text-primary);
}

.faq-chat__bubble--user {
  align-self: flex-end;
  background: var(--accent);
  color: var(--bg-primary);
  font-weight: 500;
}

.faq-chat__bubble--typing {
  align-self: flex-start;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  padding: 0.75rem 1rem;
  display: flex;
  gap: 4px;
}

.faq-chat__bubble--typing span {
  width: 5px;
  height: 5px;
  background: var(--text-secondary);
  border-radius: 50%;
  display: inline-block;
}

@media (prefers-reduced-motion: no-preference) {
  .faq-chat__bubble--typing span {
    animation: typingBounce 1s ease-in-out infinite;
  }
  .faq-chat__bubble--typing span:nth-child(2) { animation-delay: 0.15s; }
  .faq-chat__bubble--typing span:nth-child(3) { animation-delay: 0.3s; }

  @keyframes typingBounce {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
    30% { transform: translateY(-3px); opacity: 1; }
  }
}

.faq-chat__cta {
  display: inline-block;
  margin-top: 0.6rem;
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 600;
}

@media (hover: hover) and (pointer: fine) {
  .faq-chat__cta:hover { color: var(--accent-hover); }
}

.faq-chat__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.faq-chip {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-family: 'Inter', sans-serif;
  font-size: 0.78rem;
  padding: 0.6rem 0.9rem;
  min-height: 44px;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease, opacity 0.2s ease;
}

.faq-chip.is-used {
  opacity: 0.35;
  pointer-events: none;
}

@media (hover: hover) and (pointer: fine) {
  .faq-chip:hover { border-color: var(--accent); color: var(--accent); }
}

.form-wrap__label {
  font-family: 'Inter', sans-serif;
  text-transform: uppercase;
  color: var(--accent);
  letter-spacing: 0.2em;
  font-size: 0.7rem;
  margin-bottom: 1.25rem;
}

.form-field { margin-bottom: 1.5rem; }

.form-field--row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.form-field__col .form-field__label {
  display: block;
  font-family: 'Inter', sans-serif;
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.form-field__col input,
.form-field__col select {
  width: 100%;
  background: var(--bg-card);
  border: none;
  border-bottom: 1px solid var(--border);
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  font-weight: 300;
  font-size: 16px;
  padding: 0.9rem 0.75rem;
  transition: border-color 0.3s ease;
}

.form-field__col input:focus,
.form-field__col select:focus {
  outline: none;
  border-bottom-color: var(--accent);
}

.form-field__col select {
  color: var(--text-primary);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23999999' d='M0 0l6 8 6-8z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
}

.form-field__col input[type="date"] {
  color-scheme: dark;
}

.form-field input,
.form-field select,
.form-field textarea {
  width: 100%;
  background: var(--bg-card);
  border: none;
  border-bottom: 1px solid var(--border);
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  font-weight: 300;
  font-size: 16px;
  padding: 0.9rem 0.75rem;
  transition: border-color 0.3s ease;
}

.form-field textarea { resize: vertical; }

.form-field ::placeholder { color: #444444; }

.form-field select {
  color: var(--text-secondary);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23999999' d='M0 0l6 8 6-8z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
}

.form-field select:valid { color: var(--text-primary); }

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  outline: none;
  border-bottom-color: var(--accent);
}

.form-success {
  color: var(--accent);
  font-family: 'Inter', sans-serif;
  text-align: center;
  padding: 2rem 0;
}

/* ---------- Footer ---------- */
.footer {
  background: var(--bg-primary);
  border-top: 1px solid var(--border);
  padding: 40px 0;
}

.footer__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  text-align: center;
}

.footer__cities,
.footer__copy {
  font-family: 'Inter', sans-serif;
  color: #444444;
  font-size: 0.8rem;
}

/* ---------- WhatsApp Float ---------- */
.whatsapp-float {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #25D366;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  transition: transform 0.2s ease;
  z-index: 9999;
}

@media (hover: hover) and (pointer: fine) {
  .whatsapp-float:hover { transform: scale(1.1); }
}

/* ---------- Scroll Animations ---------- */
@media (prefers-reduced-motion: no-preference) {
  [data-animate] {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
  }

  [data-animate].is-visible {
    opacity: 1;
    transform: translateY(0);
  }

  [data-animate].section-title { transition-delay: 0.1s; }

  .fade-item {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeUp 0.6s ease forwards;
  }

  .hero__label { animation-delay: 0.1s; }
  .hero__title { animation-delay: 0.25s; }
  .hero__subtitle { animation-delay: 0.4s; }
  .hero__buttons { animation-delay: 0.55s; }
  .hero__rule { animation-delay: 0.7s; }

  @keyframes fadeUp {
    to { opacity: 1; transform: translateY(0); }
  }
}

/* ---------- Tablet (768px+) ---------- */
@media (min-width: 768px) {
  .services__grid { grid-template-columns: 1fr 1fr; }
  .portfolio__grid { grid-template-columns: 1fr 1fr; }
  .about__grid { grid-template-columns: 1fr 1fr; align-items: center; }
  .contact__grid { grid-template-columns: 1fr 1fr; }
  .hero__buttons { flex-direction: row; max-width: none; }
  .footer__inner { flex-direction: row; justify-content: space-between; text-align: left; }
}

/* ---------- Desktop (1024px+) ---------- */
@media (min-width: 1024px) {
  .nav__links { display: flex; }
  .nav__toggle { display: none; }
  .services__grid { grid-template-columns: 1fr 1fr; }
  .portfolio__grid { grid-template-columns: 1fr 1fr 1fr; }
  .about__grid { grid-template-columns: 1fr 1fr; gap: 4rem; }
  .about__image { order: 2; }
  .about__text { order: 1; }
  .contact__grid { grid-template-columns: 1fr 1fr; gap: 5rem; }
}
