/* =========================================================
   Irene Afonso — Arquitectura Técnica y Asesoramiento Inmobiliario
   Hoja de estilos principal
   ========================================================= */

:root {
  --color-primary: #1a3a5c;
  --color-primary-dark: #102947;
  --color-accent: #c9a86a;
  --color-accent-dark: #a68648;
  --color-bg: #ffffff;
  --color-bg-alt: #f5f2ec;
  --color-text: #1f2937;
  --color-text-soft: #4b5563;
  --color-border: #e5e7eb;
  --color-success: #15803d;
  --color-error: #b91c1c;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 12px 32px rgba(0,0,0,0.12);
  --radius: 6px;
  --max-width: 1200px;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-heading: "Playfair Display", Georgia, "Times New Roman", serif;
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--color-primary); text-decoration: none; transition: color .2s; }
a:hover { color: var(--color-accent-dark); }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

h1, h2, h3, h4 { font-family: var(--font-heading); color: var(--color-primary-dark); line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: clamp(2rem, 5vw, 3.25rem); }
h2 { font-size: clamp(1.6rem, 3.5vw, 2.25rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1em; color: var(--color-text-soft); }

/* Skip link */
.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--color-primary); color: #fff; padding: .75rem 1rem; z-index: 1000;
}
.skip-link:focus { left: 1rem; top: 1rem; }

/* Container */
.container { width: 100%; max-width: var(--max-width); margin: 0 auto; padding: 0 1.25rem; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,0.98);
  border-bottom: 1px solid var(--color-border);
  backdrop-filter: saturate(180%) blur(10px);
}
.site-header .container {
  display: flex; align-items: center; justify-content: space-between;
  min-height: 70px;
}
.brand { display: flex; flex-direction: column; }
.brand-name { font-family: var(--font-heading); font-size: 1.25rem; font-weight: 700; color: var(--color-primary-dark); }
.brand-tagline { font-size: .75rem; color: var(--color-text-soft); letter-spacing: .05em; text-transform: uppercase; }

.nav-toggle {
  display: none;
  background: none; border: 0; cursor: pointer; padding: .5rem;
}
.nav-toggle span {
  display: block; width: 24px; height: 2px; background: var(--color-primary-dark); margin: 5px 0;
  transition: transform .25s;
}
.main-nav ul {
  list-style: none; margin: 0; padding: 0;
  display: flex; gap: 1.75rem;
}
.main-nav a {
  color: var(--color-text); font-weight: 500; font-size: .95rem;
  padding: .25rem 0; border-bottom: 2px solid transparent;
}
.main-nav a:hover, .main-nav a[aria-current="page"] {
  color: var(--color-primary-dark); border-bottom-color: var(--color-accent);
}

/* Buttons */
.btn {
  display: inline-block; padding: .85rem 1.5rem;
  border-radius: var(--radius); font-weight: 600; font-size: .95rem;
  border: 2px solid transparent; cursor: pointer; transition: all .2s;
  text-align: center;
}
.btn-primary { background: var(--color-primary); color: #fff; }
.btn-primary:hover { background: var(--color-primary-dark); color: #fff; transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-secondary { background: transparent; color: var(--color-primary); border-color: var(--color-primary); }
.btn-secondary:hover { background: var(--color-primary); color: #fff; }
.btn-accent { background: var(--color-accent); color: var(--color-primary-dark); }
.btn-accent:hover { background: var(--color-accent-dark); color: #fff; }

/* Hero */
.hero {
  position: relative;
  padding: 5rem 0 4rem;
  background: linear-gradient(135deg, #f5f2ec 0%, #ffffff 60%);
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute; top: 0; right: 0; width: 40%; height: 100%;
  background: linear-gradient(135deg, rgba(26,58,92,0.08), transparent);
  pointer-events: none;
}
.hero-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; align-items: center;
}
.hero h1 { margin-bottom: 1rem; }
.hero .lead {
  font-size: 1.15rem; color: var(--color-text-soft); margin-bottom: 2rem;
  max-width: 52ch;
}
.hero-cta { display: flex; gap: 1rem; flex-wrap: wrap; }
.hero-img {
  aspect-ratio: 4/5;
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
}
.hero-img-placeholder {
  text-align: center; padding: 2rem;
  font-family: var(--font-heading); font-size: 1.25rem;
}
.hero-img-placeholder::before {
  content: ""; display: block; width: 60px; height: 60px; margin: 0 auto 1rem;
  background: var(--color-accent); border-radius: 50%;
}

/* Sections */
.section { padding: 5rem 0; }
.section-alt { background: var(--color-bg-alt); }
.section-header { text-align: center; max-width: 720px; margin: 0 auto 3rem; }
.section-header .eyebrow {
  display: inline-block; text-transform: uppercase; letter-spacing: .15em;
  font-size: .75rem; color: var(--color-accent-dark); font-weight: 700; margin-bottom: .75rem;
}

/* Grid cards */
.grid { display: grid; gap: 1.75rem; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }

.card {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 2rem;
  transition: transform .25s, box-shadow .25s, border-color .25s;
  height: 100%;
  display: flex; flex-direction: column;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--color-accent); }
.card-icon {
  width: 48px; height: 48px; border-radius: 50%;
  background: var(--color-bg-alt); color: var(--color-primary-dark);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; font-weight: 700; margin-bottom: 1.25rem;
  font-family: var(--font-heading);
}
.card h3 { color: var(--color-primary-dark); margin-bottom: .75rem; }
.card p { flex-grow: 1; font-size: .95rem; }
.card-link {
  font-weight: 600; font-size: .9rem;
  color: var(--color-accent-dark);
  margin-top: 1rem;
}
.card-link::after { content: " →"; transition: transform .2s; display: inline-block; }
.card-link:hover::after { transform: translateX(4px); }

/* Features list */
.features {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 2rem;
}
.feature { display: flex; gap: 1rem; }
.feature-check {
  flex-shrink: 0; width: 28px; height: 28px; border-radius: 50%;
  background: var(--color-accent); color: var(--color-primary-dark);
  display: flex; align-items: center; justify-content: center; font-weight: 700;
}
.feature h3 { margin-bottom: .5rem; font-size: 1.1rem; }
.feature p { font-size: .9rem; margin: 0; }

/* CTA section */
.cta {
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
  color: #fff; text-align: center; padding: 4rem 0;
}
.cta h2 { color: #fff; }
.cta p { color: rgba(255,255,255,0.85); font-size: 1.1rem; margin-bottom: 2rem; }
.cta .btn-accent { font-size: 1rem; padding: 1rem 2rem; }

/* About section */
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; align-items: center; }
.about-stats {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem;
  margin-top: 2rem; padding-top: 2rem; border-top: 1px solid var(--color-border);
}
.stat-number {
  font-family: var(--font-heading); font-size: 2.25rem; font-weight: 700;
  color: var(--color-primary-dark); line-height: 1;
}
.stat-label { font-size: .85rem; color: var(--color-text-soft); margin-top: .25rem; }

/* Contact */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; }
.contact-info { }
.contact-info ul { list-style: none; padding: 0; margin: 0; }
.contact-info li {
  padding: 1rem 0; border-bottom: 1px solid var(--color-border);
  display: flex; gap: 1rem; align-items: flex-start;
}
.contact-info li:last-child { border-bottom: 0; }
.contact-info strong { display: block; color: var(--color-primary-dark); margin-bottom: .25rem; }
.contact-info a { color: var(--color-text); }

/* Form */
form { display: flex; flex-direction: column; gap: 1.25rem; }
.form-group { display: flex; flex-direction: column; gap: .35rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
label { font-weight: 600; font-size: .9rem; color: var(--color-primary-dark); }
label .req { color: var(--color-error); }
input, textarea, select {
  font: inherit; padding: .75rem .9rem;
  border: 1px solid var(--color-border); border-radius: var(--radius);
  background: #fff; color: var(--color-text); width: 100%;
  transition: border-color .2s, box-shadow .2s;
}
input:focus, textarea:focus, select:focus {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(201, 168, 106, .25);
  outline: none;
}
textarea { resize: vertical; min-height: 140px; }
.checkbox-group { display: flex; gap: .75rem; align-items: flex-start; font-size: .875rem; color: var(--color-text-soft); }
.checkbox-group input { width: auto; margin-top: .25rem; }
.form-hint { font-size: .8rem; color: var(--color-text-soft); }
.form-error { color: var(--color-error); font-size: .85rem; display: none; }
.form-error.show { display: block; }
.form-success {
  display: none; padding: 1rem; background: #ecfdf5; color: var(--color-success);
  border-radius: var(--radius); border: 1px solid #a7f3d0;
}
.form-success.show { display: block; }
/* Honeypot */
.hp-field { position: absolute; left: -5000px; top: -5000px; height: 0; width: 0; overflow: hidden; }

/* Footer */
.site-footer {
  background: var(--color-primary-dark);
  color: rgba(255,255,255,0.85);
  padding: 3rem 0 1.5rem;
  margin-top: 5rem;
}
.site-footer h4 { color: #fff; font-family: var(--font-body); font-size: 1rem; margin-bottom: 1rem; }
.footer-grid {
  display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 2.5rem;
}
.footer-brand { font-family: var(--font-heading); font-size: 1.25rem; color: #fff; display: block; margin-bottom: .5rem; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { padding: .35rem 0; }
.site-footer a { color: rgba(255,255,255,0.75); font-size: .9rem; }
.site-footer a:hover { color: var(--color-accent); }
.footer-bottom {
  margin-top: 2.5rem; padding-top: 1.5rem;
  border-top: 1px solid rgba(255,255,255,0.15);
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 1rem;
  font-size: .85rem; color: rgba(255,255,255,0.6);
}

/* Cookie banner */
.cookie-banner {
  position: fixed; bottom: 1rem; left: 1rem; right: 1rem;
  max-width: 480px; margin: 0 auto;
  background: #fff; border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--color-border);
  padding: 1.5rem; z-index: 1000;
  transform: translateY(150%); transition: transform .4s ease-out;
}
.cookie-banner.show { transform: translateY(0); }
.cookie-banner h3 { font-family: var(--font-body); font-size: 1.1rem; margin-bottom: .5rem; }
.cookie-banner p { font-size: .875rem; margin-bottom: 1rem; }
.cookie-banner p a { color: var(--color-primary); text-decoration: underline; }
.cookie-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.cookie-actions .btn { padding: .6rem 1rem; font-size: .85rem; flex: 1; min-width: 110px; }

.cookie-prefs {
  display: none; margin-top: 1rem; padding-top: 1rem;
  border-top: 1px solid var(--color-border);
}
.cookie-prefs.show { display: block; }
.cookie-cat {
  display: flex; justify-content: space-between; align-items: flex-start;
  padding: .75rem 0; border-bottom: 1px solid var(--color-border); gap: 1rem;
}
.cookie-cat:last-child { border-bottom: 0; }
.cookie-cat-info { flex: 1; }
.cookie-cat-info strong { display: block; font-size: .9rem; margin-bottom: .25rem; color: var(--color-primary-dark); }
.cookie-cat-info span { font-size: .8rem; color: var(--color-text-soft); }

/* Toggle switch */
.switch { position: relative; width: 42px; height: 24px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.slider-switch {
  position: absolute; cursor: pointer; inset: 0;
  background: #ccc; border-radius: 24px; transition: .3s;
}
.slider-switch::before {
  content: ""; position: absolute; height: 18px; width: 18px;
  left: 3px; bottom: 3px; background: #fff; border-radius: 50%; transition: .3s;
}
.switch input:checked + .slider-switch { background: var(--color-primary); }
.switch input:checked + .slider-switch::before { transform: translateX(18px); }
.switch input:disabled + .slider-switch { background: var(--color-accent); cursor: not-allowed; opacity: .7; }

/* Legal pages */
.legal-content { max-width: 860px; margin: 0 auto; padding: 3rem 1.25rem; }
.legal-content h1 { font-size: 2rem; margin-bottom: .5rem; }
.legal-content .updated { color: var(--color-text-soft); font-size: .9rem; margin-bottom: 2rem; }
.legal-content h2 { margin-top: 2.5rem; font-size: 1.4rem; color: var(--color-primary-dark); }
.legal-content h3 { margin-top: 1.5rem; font-size: 1.1rem; font-family: var(--font-body); }
.legal-content p, .legal-content li { font-size: .95rem; color: var(--color-text); }
.legal-content ul, .legal-content ol { padding-left: 1.5rem; }
.legal-content li { margin-bottom: .4rem; }
.legal-content table {
  width: 100%; border-collapse: collapse; margin: 1rem 0; font-size: .9rem;
}
.legal-content th, .legal-content td {
  padding: .6rem .75rem; border: 1px solid var(--color-border); text-align: left;
}
.legal-content th { background: var(--color-bg-alt); font-weight: 600; }

.page-hero {
  background: var(--color-bg-alt); padding: 4rem 0 3rem; text-align: center;
}
.page-hero p { max-width: 640px; margin: 0 auto; font-size: 1.05rem; }

/* Responsive */
@media (max-width: 900px) {
  .hero-grid, .about-grid, .contact-grid { grid-template-columns: 1fr; }
  .hero-img { max-width: 400px; margin: 0 auto; }
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .about-stats { grid-template-columns: repeat(3, 1fr); }
  .main-nav {
    position: absolute; top: 70px; left: 0; right: 0;
    background: #fff; border-bottom: 1px solid var(--color-border);
    max-height: 0; overflow: hidden; transition: max-height .3s;
  }
  .main-nav.open { max-height: 500px; box-shadow: var(--shadow-md); }
  .main-nav ul { flex-direction: column; gap: 0; padding: 1rem 1.25rem; }
  .main-nav li { border-bottom: 1px solid var(--color-border); }
  .main-nav li:last-child { border-bottom: 0; }
  .main-nav a { display: block; padding: .85rem 0; }
  .nav-toggle { display: block; }
}
@media (max-width: 560px) {
  .footer-grid { grid-template-columns: 1fr; }
  .about-stats { grid-template-columns: 1fr 1fr; }
  .cookie-banner { left: .75rem; right: .75rem; padding: 1.25rem; }
}

/* Print */
@media print {
  .site-header, .site-footer, .cookie-banner, .hero-cta, .nav-toggle { display: none; }
  body { color: #000; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important; transition-duration: .001ms !important;
  }
  html { scroll-behavior: auto; }
}
