/* =====================================================
   CONTABILIDADES BARCELONA — Stylesheet
   ===================================================== */

:root {
  --navy:       #1e3a5f;
  --blue:       #2d6a9f;
  --blue-light: #e8f0f8;
  --gold:       #b8922a;
  --gold-light: #fef3d0;
  --teal:       #b8922a;
  --teal-dark:  #9a7820;
  --teal-light: #fef3d0;
  --gray-bg:    #f7f8fa;
  --gray-mid:   #e2e6ea;
  --gray-text:  #5a6472;
  --text:       #222831;
  --white:      #ffffff;
  --radius:     8px;
  --shadow:     0 4px 20px rgba(30,58,95,.10);
  --shadow-lg:  0 8px 40px rgba(30,58,95,.15);
  --font:       'Inter', 'Segoe UI', system-ui, sans-serif;
}

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

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

body {
  font-family: var(--font);
  color: var(--text);
  background: var(--white);
  line-height: 1.6;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

/* ---- UTILITY ---- */
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.section    { padding: 80px 0; }
.section-sm { padding: 60px 0; }
.tag {
  display: inline-block;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 12px;
}
.section-title {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 800;
  color: var(--navy);
  line-height: 1.2;
  margin-bottom: 16px;
}
.section-sub {
  font-size: 1.05rem;
  color: #5a6472;
  max-width: 620px;
  margin-bottom: 48px;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 28px;
  border-radius: var(--radius);
  font-weight: 700;
  font-size: .95rem;
  cursor: pointer;
  transition: all .2s;
  border: 2px solid transparent;
}
.btn-primary   { background: var(--gold); color: var(--navy); }
.btn-primary:hover { background: #b8943e; }
.btn-outline   { border-color: var(--navy); color: var(--navy); background: transparent; }
.btn-outline:hover { background: var(--navy); color: var(--white); }
.btn-teal      { background: var(--teal); color: var(--white); border-color: var(--teal); }
.btn-teal:hover { background: var(--teal-dark); border-color: var(--teal-dark); }
.btn-white     { background: var(--white); color: var(--navy); }
.btn-white:hover { background: var(--blue-light); }

/* ===================== HEADER ===================== */
#site-header {
  position: sticky; top: 0; z-index: 900;
  background: var(--white);
  border-bottom: 1px solid var(--gray-mid);
  box-shadow: 0 2px 8px rgba(30,58,95,.07);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}
.logo { display: flex; flex-direction: column; line-height: 1.1; }
.logo-main { font-size: 1.25rem; font-weight: 800; color: var(--navy); }
.logo-sub  { font-size: .7rem;  font-weight: 500; color: var(--gray-text); letter-spacing: .06em; text-transform: uppercase; margin-top: 4px; }

nav { display: flex; align-items: center; gap: 4px; }
nav a {
  padding: 8px 14px;
  border-radius: 6px;
  font-size: .9rem;
  font-weight: 500;
  color: var(--text);
  transition: background .15s;
}
nav a:hover, nav a.active { background: var(--blue-light); color: var(--navy); }

.btn-client-zone {
  background: var(--navy);
  color: var(--white) !important;
  padding: 8px 18px !important;
  border-radius: 6px !important;
  font-weight: 700 !important;
  font-size: .85rem !important;
}
.btn-client-zone:hover { background: var(--blue) !important; }

/* Hamburger */
.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}
.menu-toggle span {
  display: block;
  width: 24px; height: 2px;
  background: var(--navy);
  border-radius: 2px;
  transition: all .25s;
}

/* ===================== HERO ===================== */
#hero {
  background: var(--navy);
  padding: 100px 0 80px;
  overflow: hidden;
  position: relative;
}
.hero-content {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
}
.hero-text h1 {
  font-size: clamp(2rem, 4.5vw, 3.2rem);
  font-weight: 900;
  color: var(--white);
  line-height: 1.15;
  margin-bottom: 20px;
}
.hero-text h1 span { color: var(--gold); }
.hero-text p {
  color: rgba(255,255,255,.85);
  font-size: 1.1rem;
  margin-bottom: 36px;
  max-width: 480px;
}
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; }
.hero-deco {
  position: absolute;
  right: -80px;
  bottom: -60px;
  font-size: 26rem;
  font-weight: 900;
  color: rgba(255,255,255,.04);
  line-height: 1;
  pointer-events: none;
  user-select: none;
  letter-spacing: -.05em;
}

/* ===================== STATS BAR ===================== */
.stats-bar {
  background: var(--navy);
  padding: 0;
  border-top: 1px solid rgba(255,255,255,.08);
}
.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1px 1fr 1px 1fr;
  align-items: stretch;
}
.stat-item {
  text-align: center;
  padding: 36px 24px;
}
.stat-num {
  display: block;
  font-size: 2.8rem;
  font-weight: 900;
  color: var(--gold);
  line-height: 1;
  letter-spacing: -.02em;
}
.stat-label {
  display: block;
  font-size: .78rem;
  color: rgba(255,255,255,.55);
  margin-top: 8px;
  text-transform: uppercase;
  letter-spacing: .09em;
  font-weight: 600;
}
.stat-divider {
  background: rgba(255,255,255,.1);
  align-self: stretch;
}
@media (max-width: 640px) {
  .stats-grid { grid-template-columns: 1fr; }
  .stat-divider { display: none; }
  .stat-item { padding: 24px; border-bottom: 1px solid rgba(255,255,255,.08); }
  .stat-item:last-child { border-bottom: none; }
}

/* ===================== VALUES ===================== */
#valores { background: var(--white); }
.values-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.value-card {
  background: var(--white);
  border-radius: 12px;
  padding: 32px;
  box-shadow: var(--shadow);
  display: flex;
  gap: 20px;
  align-items: flex-start;
}
.value-icon {
  width: 52px; height: 52px;
  border-radius: 12px;
  background: var(--blue-light);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  font-size: 1.4rem;
}
.value-card h3 { font-size: 1rem; font-weight: 700; color: #1e3a5f !important; margin-bottom: 6px; }
.value-card p  { font-size: .88rem; color: #5a6472 !important; }

/* ===================== SERVICES ===================== */
#servicios { background: var(--white); }
.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.service-card {
  border: 1.5px solid var(--gray-mid);
  border-radius: 14px;
  padding: 32px 28px;
  transition: all .25s;
  cursor: default;
  position: relative;
  overflow: hidden;
}
.service-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--gold);
  transform: scaleX(0);
  transition: transform .25s;
  transform-origin: left;
}
.service-card:hover { border-color: var(--gold-light); box-shadow: var(--shadow); transform: translateY(-2px); }
.service-card:hover::before { transform: scaleX(1); }
.service-card:hover h3 { color: var(--gold); }
.service-icon {
  font-size: 2rem;
  margin-bottom: 16px;
  display: block;
}
.service-card h3 { font-size: 1.05rem; font-weight: 700; color: var(--navy); margin-bottom: 10px; }
.service-card p  { font-size: .88rem; color: #5a6472; line-height: 1.65; }
.service-tag {
  display: inline-block;
  margin-top: 16px;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .08em;
  color: var(--blue);
  background: var(--blue-light);
  padding: 3px 10px;
  border-radius: 12px;
}

/* ===================== CONTACT ===================== */
#contacto { background: var(--white); }
.contact-layout {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 60px;
  align-items: start;
}
.contact-info { }
.contact-info h2 { font-size: 1.8rem; color: var(--navy); font-weight: 800; margin-bottom: 16px; }
.contact-info p  { color: var(--gray-text); margin-bottom: 36px; }

.contact-detail {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 24px;
}
.contact-detail-icon {
  width: 46px; height: 46px; flex-shrink: 0;
  background: var(--blue-light);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
}
.contact-detail-text strong { display: block; font-size: .82rem; color: var(--gray-text); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 2px; }
.contact-detail-text span   { font-size: .95rem; color: var(--text); font-weight: 500; }

/* Forms */
.form-card {
  background: var(--white);
  border-radius: 16px;
  padding: 40px;
  box-shadow: var(--shadow-lg);
}
.form-group { margin-bottom: 20px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
label {
  display: block;
  font-size: .82rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 6px;
  letter-spacing: .03em;
}
label .req { color: var(--teal); margin-left: 2px; }
input[type="text"],
input[type="email"],
input[type="tel"],
select,
textarea {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid var(--gray-mid);
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: .92rem;
  color: var(--text);
  background: var(--white);
  transition: border-color .2s, box-shadow .2s;
  outline: none;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(45,106,159,.12);
}
textarea { resize: vertical; min-height: 120px; }
select { cursor: pointer; }

/* Honeypot */
.hp-field { position: absolute; left: -9999px; opacity: 0; pointer-events: none; tab-index: -1; }

.form-check {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: .82rem;
  color: var(--gray-text);
  margin-bottom: 20px;
}
.form-check input[type="checkbox"] {
  width: 16px; height: 16px;
  margin-top: 2px;
  flex-shrink: 0;
  accent-color: var(--navy);
  cursor: pointer;
}
.form-check a { color: var(--blue); text-decoration: underline; }

.form-message {
  padding: 14px 18px;
  border-radius: var(--radius);
  font-size: .88rem;
  font-weight: 600;
  margin-bottom: 16px;
  display: none;
}
.form-message.success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; display: block; }
.form-message.error   { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; display: block; }

/* ===================== FOOTER ===================== */
footer {
  background: var(--navy);
  color: rgba(255,255,255,.75);
}
.footer-top {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 48px;
  padding: 60px 0 40px;
  border-bottom: 1px solid rgba(255,255,255,.1);
}
.footer-brand .logo-main { color: var(--white); font-size: 1.2rem; }
.footer-brand .logo-sub  { color: rgba(255,255,255,.5); }
.footer-brand p { font-size: .85rem; margin-top: 16px; line-height: 1.7; max-width: 300px; }

.footer-col h4 {
  color: var(--white);
  font-size: .85rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  margin-bottom: 16px;
}
.footer-col ul { list-style: none; }
.footer-col ul li { margin-bottom: 10px; }
.footer-col ul li a {
  font-size: .85rem;
  color: rgba(255,255,255,.65);
  transition: color .15s;
}
.footer-col ul li a:hover { color: var(--gold); }

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  padding: 24px 0;
  font-size: .78rem;
}
.footer-legal { display: flex; gap: 20px; flex-wrap: wrap; }
.footer-legal a { color: rgba(255,255,255,.5); transition: color .15s; }
.footer-legal a:hover { color: var(--gold); }

/* ===================== COOKIE BANNER ===================== */
#cookie-banner {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 9999;
  background: var(--white);
  border-top: 3px solid var(--navy);
  box-shadow: 0 -4px 24px rgba(0,0,0,.15);
  padding: 20px 24px;
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
  transform: translateY(0);
  transition: transform .35s ease;
}
#cookie-banner.hidden { transform: translateY(110%); }
.cookie-text { flex: 1; font-size: .85rem; color: var(--text); min-width: 260px; }
.cookie-text strong { color: var(--navy); }
.cookie-text a { color: var(--blue); text-decoration: underline; }
.cookie-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.btn-cookie-accept  { background: var(--navy); color: var(--white); padding: 10px 22px; border-radius: 6px; font-weight: 700; font-size: .85rem; cursor: pointer; border: none; }
.btn-cookie-reject  { background: transparent; color: var(--gray-text); padding: 10px 18px; border-radius: 6px; font-weight: 600; font-size: .85rem; cursor: pointer; border: 1.5px solid var(--gray-mid); }
.btn-cookie-config  { background: transparent; color: var(--blue); padding: 10px 18px; font-weight: 600; font-size: .85rem; cursor: pointer; border: none; text-decoration: underline; }

/* ===================== MODALS ===================== */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.55);
  z-index: 10000;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal-box {
  background: var(--white);
  border-radius: 16px;
  max-width: 740px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  padding: 40px;
  position: relative;
  transform: translateY(20px);
  transition: transform .25s;
}
.modal-overlay.open .modal-box { transform: translateY(0); }
.modal-close {
  position: absolute; top: 16px; right: 16px;
  width: 36px; height: 36px;
  background: var(--gray-bg);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.1rem;
  display: flex; align-items: center; justify-content: center;
  color: var(--text);
}
.modal-close:hover { background: var(--gray-mid); }
.modal-box h2 { font-size: 1.5rem; color: var(--navy); margin-bottom: 20px; }
.modal-box h3 { font-size: 1rem; color: var(--navy); margin: 24px 0 10px; }
.modal-box p  { font-size: .88rem; color: var(--gray-text); line-height: 1.75; margin-bottom: 12px; }
.modal-box ul { padding-left: 20px; margin-bottom: 12px; }
.modal-box ul li { font-size: .88rem; color: var(--gray-text); line-height: 1.75; }
.modal-box table { width: 100%; border-collapse: collapse; font-size: .82rem; margin: 16px 0; }
.modal-box th { background: var(--blue-light); color: var(--navy); padding: 10px 12px; text-align: left; font-weight: 700; }
.modal-box td { padding: 9px 12px; border-bottom: 1px solid var(--gray-mid); color: var(--gray-text); }

/* Cookie preferences modal */
.cookie-pref-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 0;
  border-bottom: 1px solid var(--gray-mid);
}
.cookie-pref-row:last-child { border-bottom: none; }
.cookie-pref-info strong { display: block; font-size: .9rem; color: var(--navy); margin-bottom: 4px; }
.cookie-pref-info p { font-size: .8rem; color: var(--gray-text); margin: 0; }
.toggle-switch { position: relative; width: 46px; height: 26px; flex-shrink: 0; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; inset: 0;
  background: var(--gray-mid);
  border-radius: 26px;
  cursor: pointer;
  transition: background .2s;
}
.toggle-slider::before {
  content: '';
  position: absolute;
  width: 20px; height: 20px;
  left: 3px; top: 3px;
  background: var(--white);
  border-radius: 50%;
  transition: transform .2s;
  box-shadow: 0 1px 4px rgba(0,0,0,.2);
}
.toggle-switch input:checked + .toggle-slider { background: var(--navy); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(20px); }
.toggle-switch.disabled .toggle-slider { opacity: .7; cursor: not-allowed; }

/* Loading spinner */
.spinner {
  display: inline-block;
  width: 18px; height: 18px;
  border: 2px solid rgba(255,255,255,.4);
  border-top-color: var(--white);
  border-radius: 50%;
  animation: spin .6s linear infinite;
  margin-left: 6px;
  vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===================== RESPONSIVE ===================== */
@media (max-width: 1024px) {
  .services-grid { grid-template-columns: repeat(2, 1fr); }
  .values-grid   { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .section { padding: 60px 0; }

  nav { display: none; flex-direction: column; gap: 4px; position: absolute; top: 72px; left: 0; right: 0; background: var(--white); padding: 12px 16px; border-bottom: 1px solid var(--gray-mid); box-shadow: 0 4px 12px rgba(0,0,0,.1); }
  nav.open { display: flex; }
  nav a { padding: 12px 16px; }
  .menu-toggle { display: flex; }
  .header-inner { position: relative; }

  .hero-content { grid-template-columns: 1fr; gap: 36px; }
  .hero-card { display: none; }

  .values-grid   { grid-template-columns: 1fr; }
  .services-grid { grid-template-columns: 1fr; }
  .contact-layout { grid-template-columns: 1fr; }
  .form-row      { grid-template-columns: 1fr; }
  .footer-top    { grid-template-columns: 1fr; gap: 32px; }
  .footer-bottom { flex-direction: column; text-align: center; }
  #cookie-banner { flex-direction: column; align-items: flex-start; }
  .cookie-actions { width: 100%; }
}

@media (max-width: 480px) {
  .hero-cta { flex-direction: column; }
  .hero-cta .btn { width: 100%; justify-content: center; }
}
