/* =============================================
   JÚLIA TORTÓS - WEB CORPORATIVA
   Paleta corregida
   ============================================= */

/* CSS Variables */
:root {
  /* Fons */
  --color-bg-primary: #EAE9E8;      /* fons principal */
  --color-bg-secondary: #ffffff;    /* fons net per seccions suaus */
  --color-bg-accent: #607482;       /* header i zones fosques */

  /* Accents */
  --color-beige: #B4AAA0;           /* detalls càlids / borders */
  --color-blue-gray-light: #9AA8B6; /* accent suau */
  --color-blue-gray: #607482;       /* accent principal (mateix que header) */

  /* Text */
  --color-text-primary: #545454;    /* text principal */
  --color-text-inverse: #EAE9E8;    /* text sobre fons foscos */

  --color-whatsapp: #25D366;

  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-family);
  font-size: 18px;
  line-height: 1.6;
  color: var(--color-text-primary);
  background-color: var(--color-bg-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

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

ul, ol {
  list-style: none;
}

button {
  font-family: inherit;
}

::selection {
  background-color: var(--color-blue-gray-light);
  color: var(--color-bg-accent);
}

/* =============================================
   HEADER
   ============================================= */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: var(--color-bg-accent);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  transition: all 0.3s ease;
}

.header.scrolled {
  background: var(--color-bg-accent);
  box-shadow: 0 1px 10px rgba(0,0,0,0.08);
}

.header-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 96px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  transition: opacity 0.2s ease;
  color: var(--color-text-inverse);
}

.logo:hover {
  opacity: 0.9;
}

.logo img {
  height: 44px;
  width: auto;
  display: block;
}

.nav {
  display: flex;
  align-items: center;
  gap: 48px;
}

.nav-link {
  font-size: 14px;
  font-weight: 400;
  color: var(--color-text-inverse);
  position: relative;
  padding: 12px 0;
  transition: color 0.2s ease;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 8px;
  left: 0;
  width: 0;
  height: 1px;
  background: rgba(234, 233, 232, 0.8);
  transition: width 0.5s ease;
}

.nav-link:hover,
.nav-link.active {
  color: #ffffff;
}

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

.btn-cta {
  padding: 16px 24px;
  border: 1px solid rgba(234, 233, 232, 0.8);
  color: rgba(234, 233, 232, 0.95);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.02em;
  background: transparent;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-cta:hover {
  background: rgba(234, 233, 232, 0.95);
  color: var(--color-bg-accent);
}

.header-phone {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: rgba(234, 233, 232, 0.9);
  transition: color 0.2s ease;
}

.header-phone:hover {
  color: #ffffff;
}

.menu-btn {
  display: none;
  background: none;
  border: none;
  padding: 8px;
  cursor: pointer;
  color: rgba(234, 233, 232, 0.95);
}

/* Mobile Menu */
.mobile-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--color-bg-primary);
  border-top: 1px solid rgba(180, 170, 160, 0.35);
  padding: 24px;
  transform: translateY(-10px);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.mobile-menu.open {
  transform: translateY(0);
  opacity: 1;
  visibility: visible;
}

.mobile-menu a {
  display: block;
  padding: 12px 0;
  font-size: 16px;
  color: var(--color-text-primary);
}

.btn-cta-mobile {
  display: block;
  text-align: center;
  margin-top: 16px;
  padding: 16px 24px;
  border: 1px solid var(--color-blue-gray);
  color: var(--color-blue-gray);
}

.mobile-phone {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid rgba(180, 170, 160, 0.35);
  color: var(--color-blue-gray);
}

/* =============================================
   HERO
   ============================================= */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 120px 0 80px;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: rgba(234, 233, 232, 0.30);
}

@media (max-width: 768px){
  .hero-overlay{
    background: rgba(234, 233, 232, 0.30);
  }
}

.hero-content {
  position: relative;
  z-index: 10;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 40px;
  width: 100%;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: center;
}

.hero-subtitle {
  font-size: 14px;
  color: var(--color-blue-gray);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 24px;
}

.hero-title {
  font-size: 48px;
  font-weight: 400;
  color: var(--color-text-primary);
  line-height: 1.2;
  margin-bottom: 32px;
}

.hero-text {
  font-size: 22px;
  color: rgba(84, 84, 84, 0.9);
  line-height: 1.6;
  margin-bottom: 48px;
  max-width: 540px;
}

.hero-buttons {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.hero-image {
  position: relative;
}

.hero-image img {
  width: 100%;
  max-width: 400px;
  margin: 0 auto;
}

.hero-image::before,
.hero-image::after {
  content: '';
  position: absolute;
  background: rgba(96, 116, 130, 0.45);
}

.hero-image::before {
  top: -16px;
  left: -16px;
  width: 96px;
  height: 1px;
}

.hero-image::after {
  top: -16px;
  left: -16px;
  width: 1px;
  height: 96px;
}

/* =============================================
   BUTTONS
   ============================================= */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px 32px;
  background: var(--color-blue-gray);
  color: var(--color-text-inverse);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.02em;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-primary:hover {
  background: #4f6570;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px 32px;
  background: transparent;
  color: var(--color-blue-gray);
  font-size: 14px;
  font-weight: 500;
  border: 1px solid var(--color-blue-gray);
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-secondary:hover {
  background: var(--color-blue-gray);
  color: var(--color-text-inverse);
}

.btn-whatsapp {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px 32px;
  background: var(--color-whatsapp);
  color: white;
  font-size: 14px;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-whatsapp:hover {
  background: #1fb855;
}

/* =============================================
   SECTIONS
   ============================================= */
.section {
  padding: 96px 0;
}

.section-light {
  background: var(--color-bg-primary);
}

.section-subtle {
  background: var(--color-bg-secondary);
}

.section-dark {
  background: var(--color-bg-accent);
  color: var(--color-text-inverse);
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 40px;
}

.section-header {
  max-width: 640px;
  margin-bottom: 64px;
}

.section-label {
  font-size: 12px;
  color: var(--color-blue-gray);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 16px;
}

.section-title {
  font-size: 36px;
  font-weight: 400;
  color: var(--color-text-primary);
  line-height: 1.2;
  margin-bottom: 24px;
}

.section-title.light {
  color: var(--color-text-inverse);
}

.section-text {
  font-size: 18px;
  color: rgba(84, 84, 84, 0.85);
  line-height: 1.7;
}

.section-text.light {
  color: rgba(234, 233, 232, 0.85);
}

/* =============================================
   SERVICES
   ============================================= */
.services-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 32px;
  margin-bottom: 48px;
}

.service-card {
  background: var(--color-bg-secondary);
  padding: 40px;
  border: 1px solid rgba(180, 170, 160, 0.35);
  transition: all 0.3s ease;
}

.service-card:hover {
  border-color: rgba(154, 168, 182, 0.7);
}

.service-subtitle {
  font-size: 12px;
  color: var(--color-blue-gray-light);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.service-title {
  font-size: 22px;
  font-weight: 400;
  color: var(--color-text-primary);
  margin-bottom: 16px;
  transition: color 0.2s ease;
}

.service-card:hover .service-title {
  color: var(--color-blue-gray);
}

.service-desc {
  font-size: 14px;
  color: rgba(84, 84, 84, 0.82);
  line-height: 1.7;
  margin-bottom: 32px;
}

.service-benefits {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.service-benefit {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 14px;
  color: var(--color-text-primary);
}

.service-benefit svg {
  flex-shrink: 0;
  color: var(--color-blue-gray);
  margin-top: 2px;
}

.services-image {
  max-width: 800px;
  margin: 0 auto;
}

.services-image img {
  width: 100%;
}

/* =============================================
   WHY SECTION
   ============================================= */
.why-content {
  text-align: center;
  max-width: 800px;
  margin: 0 auto;
}

.why-content .section-text {
  margin-bottom: 32px;
}

.link-light {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--color-text-inverse);
  font-size: 14px;
  transition: color 0.2s ease;
}

.link-light:hover {
  color: rgba(234, 233, 232, 0.75);
}

.link-light svg {
  transition: transform 0.2s ease;
}

.link-light:hover svg {
  transform: translateX(4px);
}

/* =============================================
   SECTORS
   ============================================= */
.sectors-header {
  text-align: center;
  max-width: 640px;
  margin: 0 auto 64px;
}

.sectors-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

.sector-card {
  text-align: center;
  padding: 32px;
  background: var(--color-bg-secondary);
  border: 1px solid rgba(180, 170, 160, 0.25);
  transition: all 0.3s ease;
}

.sector-card:hover {
  border-color: rgba(154, 168, 182, 0.55);
}

.sector-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 24px;
  color: var(--color-blue-gray);
}

.sector-icon svg {
  width: 100%;
  height: 100%;
}

.sector-card p {
  font-size: 14px;
  color: var(--color-text-primary);
}

/* =============================================
   ABOUT
   ============================================= */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: center;
}

.about-image img {
  width: 100%;
}

.about-content .section-text {
  margin-bottom: 0;
}

.credentials {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
}

.credential {
  padding: 8px 16px;
  font-size: 12px;
  color: var(--color-blue-gray);
  border: 1px solid rgba(154, 168, 182, 0.55);
  transition: all 0.2s ease;
}

.credential:hover {
  border-color: var(--color-blue-gray);
}

/* =============================================
   CONTACT
   ============================================= */
.contact-content {
  text-align: center;
  max-width: 800px;
  margin: 0 auto;
}

.contact-content .section-text {
  margin-bottom: 48px;
}

.contact-buttons {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 64px;
}

.contact-info {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  padding-top: 48px;
  border-top: 1px solid rgba(180, 170, 160, 0.35);
}

.contact-item {
  text-align: center;
}

.contact-label {
  font-size: 12px;
  color: var(--color-blue-gray-light);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.contact-item a {
  color: var(--color-text-primary);
  transition: color 0.2s ease;
}

.contact-item a:hover {
  color: var(--color-blue-gray);
}

.contact-social {
  font-size: 14px;
  color: var(--color-text-primary);
}

/* =============================================
   FORM
   ============================================= */
.form-container {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 48px;
  align-items: start;
}

.quote-form {
  background: var(--color-bg-secondary);
  padding: 48px;
  border: 1px solid rgba(180, 170, 160, 0.35);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  margin-bottom: 32px;
}

.form-group {
  margin-bottom: 24px;
}

.form-group label {
  display: block;
  font-size: 14px;
  color: var(--color-text-primary);
  margin-bottom: 8px;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 16px;
  background: var(--color-bg-primary);
  border: 1px solid rgba(180, 170, 160, 0.35);
  font-size: 14px;
  font-family: inherit;
  color: var(--color-text-primary);
  outline: none;
  transition: border-color 0.2s ease;
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: rgba(154, 168, 182, 0.9);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: rgba(84, 84, 84, 0.55);
}

.form-group textarea {
  resize: none;
}

.services-select {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.service-btn {
  padding: 12px 16px;
  font-size: 13px;
  background: var(--color-bg-primary);
  border: 1px solid rgba(180, 170, 160, 0.35);
  color: var(--color-text-primary);
  cursor: pointer;
  text-align: left;
  transition: all 0.2s ease;
}

.service-btn:hover {
  border-color: rgba(154, 168, 182, 0.9);
}

.service-btn.selected {
  background: var(--color-blue-gray);
  color: var(--color-text-inverse);
  border-color: var(--color-blue-gray);
}

.btn-submit {
  width: 100%;
}

.form-note {
  font-size: 12px;
  color: rgba(84, 84, 84, 0.65);
  margin-top: 16px;
}

.form-success {
  text-align: center;
  padding: 64px;
  background: var(--color-bg-secondary);
  border: 1px solid rgba(180, 170, 160, 0.35);
}

.form-success svg {
  margin: 0 auto 24px;
}

.form-success h3 {
  font-size: 24px;
  font-weight: 400;
  color: var(--color-text-primary);
  margin-bottom: 16px;
}

.form-success p {
  color: rgba(84, 84, 84, 0.85);
  margin-bottom: 32px;
}

.form-sidebar {
  background: var(--color-bg-secondary);
  padding: 32px;
  border: 1px solid rgba(180, 170, 160, 0.35);
  text-align: center;
  position: sticky;
  top: 120px;
}

.form-sidebar img {
  width: 96px;
  height: 96px;
  object-fit: cover;
  margin: 0 auto 24px;
}

.form-sidebar h3 {
  font-size: 18px;
  font-weight: 400;
  color: var(--color-text-primary);
  margin-bottom: 12px;
}

.form-sidebar > p {
  font-size: 14px;
  color: rgba(84, 84, 84, 0.82);
  margin-bottom: 24px;
}

.sidebar-contact {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 24px;
  border-top: 1px solid rgba(180, 170, 160, 0.35);
}

.sidebar-contact a {
  font-size: 14px;
  color: var(--color-blue-gray);
  transition: color 0.2s ease;
}

.sidebar-contact a:hover {
  color: #4f6570;
}

.whatsapp-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  background: var(--color-whatsapp);
  color: white !important;
  margin-top: 8px;
  transition: background 0.2s ease;
}

.whatsapp-link:hover {
  background: #1fb855;
}

/* =============================================
   FOOTER
   ============================================= */
.footer {
  background: var(--color-bg-accent);
  padding: 64px 0;
  color: var(--color-text-inverse);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 48px;
}

.footer-brand {
  display: block;
  font-size: 20px;
  color: #ffffff;
  margin-bottom: 16px;
}

.footer-desc {
  font-size: 14px;
  color: rgba(234, 233, 232, 0.75);
  line-height: 1.7;
  max-width: 400px;
}

.footer-title {
  font-size: 12px;
  font-weight: 400;
  color: rgba(234, 233, 232, 0.9);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 16px;
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-links a {
  font-size: 14px;
  color: rgba(234, 233, 232, 0.75);
  transition: color 0.2s ease;
}

.footer-links a:hover {
  color: #ffffff;
}

.footer-bottom {
  padding-top: 32px;
  border-top: 1px solid rgba(234, 233, 232, 0.25);
  text-align: center;
}

.footer-bottom p {
  font-size: 14px;
  color: rgba(234, 233, 232, 0.55);
}

/* =============================================
   WHATSAPP FLOATING BUTTON
   ============================================= */
.whatsapp-float {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 60px;
  height: 60px;
  background: var(--color-whatsapp);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(37, 211, 102, 0.4);
  z-index: 999;
  transition: all 0.3s ease;
}

.whatsapp-float:hover {
  background: #1fb855;
  transform: scale(1.1);
}

/* =============================================
   ANIMATIONS
   ============================================= */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate {
  opacity: 0;
}

.animate.visible {
  animation: fadeIn 0.6s ease-out forwards;
}

.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }
.delay-4 { animation-delay: 0.4s; }

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 1024px) {
  .header-inner {
    padding: 0 24px;
    height: 80px;
  }

  .nav {
    display: none;
  }

  .header-phone {
    display: none;
  }

  .menu-btn {
    display: block;
  }

  .mobile-menu {
    display: block;
  }

  .hero-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .hero-image {
    order: -1;
  }

  .hero-title {
    font-size: 36px;
  }

  .hero-text {
    font-size: 18px;
  }

  .container {
    padding: 0 24px;
  }

  .section {
    padding: 64px 0;
  }

  .services-grid {
    grid-template-columns: 1fr;
  }

  .sectors-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .about-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .contact-info {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .form-container {
    grid-template-columns: 1fr;
  }

  .form-sidebar {
    position: static;
  }

  .services-select {
    grid-template-columns: repeat(2, 1fr);
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }
}

@media (max-width: 640px) {
  .hero {
    padding: 100px 0 60px;
  }

  .hero-title {
    font-size: 28px;
  }

  .hero-text {
    font-size: 16px;
  }

  .hero-buttons {
    flex-direction: column;
  }

  .section-title {
    font-size: 28px;
  }

  .sectors-grid {
    grid-template-columns: 1fr;
  }

  .contact-buttons {
    flex-direction: column;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .services-select {
    grid-template-columns: 1fr;
  }

  .quote-form {
    padding: 24px;
  }

  .whatsapp-float {
    bottom: 16px;
    right: 16px;
    width: 56px;
    height: 56px;
  }
}

/* =========================
   HERO: text a la dreta (sense imatge)
   Usa class="hero-grid hero-grid--text-right"
   ========================= */

.hero .hero-grid.hero-grid--text-right{
  grid-template-columns: 1fr !important; /* una sola columna */
  justify-items: end !important;         /* contingut cap a la dreta */
}

.hero .hero-grid.hero-grid--text-right .hero-text-content{
  text-align: right !important;
}

.hero .hero-grid.hero-grid--text-right .hero-buttons{
  justify-content: flex-end !important;
}

.hero .hero-grid.hero-grid--text-right .hero-text{
  margin-left: auto !important; /* el max-width queda alineat a la dreta */
}

/* =========================
   HERO background (desktop vs mobile)
   ========================= */

.hero-bg{
  background-size: 80% auto;
  background-position: center 30%;
}

@media (max-width: 768px){
  .hero-bg{
    background-size: 110% auto;   /* prova 85% si la vols encara més petita */
    background-position: center 20%;
  }
}

/* Mobile: text a la dreta, botons a sota ocupant tot l’ample */
@media (max-width: 768px){
  .hero .hero-grid.hero-grid--text-right{
    grid-template-columns: 1fr 1fr !important;
    gap: 10px !important;
    align-items: center;
  }

  /* Text a la columna dreta */
  .hero .hero-grid.hero-grid--text-right > .hero-text-content{
    grid-column: 2 !important;
    justify-self: end !important;
    text-align: right !important;
    width: 100%;
    max-width: 420px;
  }

  /* Botons a sota, ample complet */
  .hero .hero-grid.hero-grid--text-right > .hero-buttons{
    grid-column: 1 / -1 !important;
    margin-top: 8px;
    width: 100%;
    justify-content: flex-start !important;
  }

  /* (Opcional) si vols que en mòbil quedin més "nets" i alineats */
  .hero .hero-grid.hero-grid--text-right > .hero-buttons a{
    flex: 1 1 auto;
  }
}

/* Mobile: amagar el text llarg del hero */
@media (max-width: 768px){
  .hero .hero-text{
    display: none;
  }
}

/* Mobile: pujar el text del hero */
@media (max-width: 768px){
  .hero{
    align-items: flex-start; /* deixa de centrar verticalment */
  }

  .hero-content{
    padding-top: 90px; /* ajusta: prova 70–110px */
  }
}
