/* ============================================
   Variables y Base
   ============================================ */
:root {
  --primary: #1e40af;
  --primary-dark: #1e3a8a;
  --primary-light: #3b82f6;
  --whatsapp: #25d366;
  --whatsapp-dark: #1da851;
  --text: #0f172a;
  --text-light: #475569;
  --text-muted: #64748b;
  --bg: #ffffff;
  --bg-alt: #f8fafc;
  --bg-dark: #0f172a;
  --border: #e2e8f0;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1);
  --radius: 16px;
  --radius-sm: 12px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Poppins", system-ui, -apple-system, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
  line-height: 1.2;
  font-weight: 700;
}

h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800;
  letter-spacing: -0.02em;
}

h2 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 700;
}

h3 {
  font-size: 1.25rem;
  font-weight: 600;
}

p {
  margin: 0;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: all 0.2s ease;
}

a:hover {
  color: var(--primary-dark);
}

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

/* ============================================
   Header
   ============================================ */
.site-header {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
}

.brand-logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  transition: opacity 0.2s ease;
}

.brand-logo:hover {
  opacity: 0.8;
  transform: none;
}

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

@media (min-width: 640px) {
  .logo {
    height: 50px;
  }
}

@media (min-width: 1024px) {
  .logo {
    height: 60px;
  }
}

.contact-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.phone {
  font-weight: 600;
  color: var(--text);
  display: none;
}

@media (min-width: 640px) {
  .phone {
    display: inline;
  }
}

/* ============================================
   Buttons
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  border: 2px solid transparent;
  background: var(--bg);
  color: var(--text);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  text-decoration: none;
}

.btn:active {
  transform: translateY(0);
}

.btn-lg {
  padding: 16px 32px;
  font-size: 1rem;
}

.btn-primary {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.btn-primary:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
  color: white;
}

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

.btn-outline:hover {
  background: var(--bg-alt);
  border-color: var(--primary);
}

.btn-whatsapp {
  background: var(--whatsapp);
  color: white;
  border-color: var(--whatsapp);
}

.btn-whatsapp:hover {
  background: var(--whatsapp-dark);
  border-color: var(--whatsapp-dark);
  color: white;
}

/* ============================================
   Hero
   ============================================ */
.hero {
  position: relative;
  padding: 100px 0 80px;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background-image: url('media/fondotituloinstalacionaa.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  z-index: -1;
}

.hero-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 1;
}

.hero-inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: 40px;
  align-items: center;
  position: relative;
  z-index: 2;
}

@media (min-width: 1024px) {
  .hero-inner {
    grid-template-columns: 1fr 450px;
    gap: 60px;
  }
}

.hero-copy {
  text-align: center;
}

@media (min-width: 1024px) {
  .hero-copy {
    text-align: left;
  }
  
  .cta {
    justify-content: flex-start;
  }
  
  .trust-badges {
    justify-content: flex-start;
  }
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.95);
  color: var(--primary);
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 24px;
  box-shadow: var(--shadow-lg);
}

.hero h1 {
  margin-bottom: 16px;
  color: white;
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
}

.lead {
  font-size: 1.125rem;
  color: rgba(255, 255, 255, 0.95);
  margin-bottom: 32px;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.3);
}

.cta {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 40px;
}

.trust-badges {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  justify-content: center;
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.trust-item {
  display: flex;
  align-items: center;
  gap: 8px;
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.875rem;
  font-weight: 500;
}

.trust-item svg {
  color: white;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

/* Hero Form */
.hero-form-wrapper {
  width: 100%;
}

.hero-form {
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(10px);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow-xl);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.hero-form-header {
  margin-bottom: 24px;
  text-align: center;
}

.hero-form-header h3 {
  color: var(--text);
  margin-bottom: 4px;
  font-size: 1.5rem;
}

.hero-form-header p {
  color: var(--text-light);
  font-size: 0.875rem;
}

.hero-form .form-row {
  margin-bottom: 16px;
}

.hero-form label {
  color: var(--text);
  display: block;
  margin-bottom: 6px;
}

.hero-form input,
.hero-form select,
.hero-form textarea {
  width: 100%;
  padding: 12px 14px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: 0.95rem;
  transition: all 0.2s ease;
  background: var(--bg);
}

.hero-form input:focus,
.hero-form select:focus,
.hero-form textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.1);
}

.hero-form textarea {
  resize: vertical;
  min-height: 80px;
}

.btn-block {
  width: 100%;
}

.hero-form-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.8rem;
}

.hero-form-footer svg {
  color: var(--primary);
  flex-shrink: 0;
}

/* ============================================
   Sections
   ============================================ */
section {
  padding: 80px 0;
}

.section-header {
  text-align: center;
  margin-bottom: 48px;
}

.section-header h2 {
  margin-bottom: 12px;
}

.section-header p {
  font-size: 1.125rem;
  color: var(--text-light);
}

/* ============================================
   Grid & Cards
   ============================================ */
.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

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

@media (min-width: 768px) {
  .grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .grid-2 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  transition: all 0.3s ease;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary-light);
}

.card-icon {
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: white;
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}

.card h3 {
  margin-bottom: 12px;
  color: var(--text);
}

.card p {
  color: var(--text-light);
  line-height: 1.6;
}

.card-highlight {
  background: linear-gradient(135deg, var(--bg-alt) 0%, var(--bg) 100%);
  border: 2px solid var(--primary-light);
}

/* ============================================
   Guarantee Section
   ============================================ */
.guarantee {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
}

.guarantee-content {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
  align-items: center;
  text-align: center;
}

.guarantee-icon {
  display: flex;
  justify-content: center;
}

.guarantee-icon svg {
  width: 80px;
  height: 80px;
  opacity: 0.9;
}

.guarantee h2 {
  margin-bottom: 16px;
  color: white;
}

.guarantee p {
  font-size: 1.125rem;
  line-height: 1.7;
  opacity: 0.95;
  margin-bottom: 24px;
}

.guarantee .btn {
  background: white;
  color: var(--primary);
  border-color: white;
}

.guarantee .btn:hover {
  background: var(--bg-alt);
  transform: translateY(-2px);
  box-shadow: var(--shadow-xl);
}

@media (min-width: 768px) {
  .guarantee-content {
    grid-template-columns: auto 1fr;
    text-align: left;
  }
  
  .guarantee-icon {
    justify-content: flex-start;
  }
}

/* ============================================
   Contact Form
   ============================================ */
.contact {
  background: var(--bg-alt);
}

.contact-wrapper {
  max-width: 700px;
  margin: 0 auto;
}

.contact-form {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px;
  box-shadow: var(--shadow-lg);
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

@media (min-width: 640px) {
  .form-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.form-row {
  display: grid;
  gap: 8px;
}

.form-row.checkbox {
  grid-template-columns: 20px 1fr;
  align-items: start;
  gap: 12px;
  margin-top: 8px;
}

.form-row.checkbox input {
  margin-top: 4px;
}

label {
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--text);
}

input, select, textarea {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: 0.95rem;
  transition: all 0.2s ease;
  background: var(--bg);
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.1);
}

input[type="checkbox"] {
  width: 20px;
  height: 20px;
  cursor: pointer;
}

textarea {
  resize: vertical;
  min-height: 120px;
}

.form-actions {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 24px;
  align-items: stretch;
}

.form-divider {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 600;
}

.help {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  color: var(--text-light);
  font-size: 0.875rem;
  text-align: center;
  justify-content: center;
}

.help svg {
  flex-shrink: 0;
}

.help a {
  color: var(--primary);
  font-weight: 600;
}

@media (min-width: 640px) {
  .form-actions {
    flex-direction: row;
    align-items: center;
  }
  
  .form-divider {
    padding: 0 8px;
  }
}

/* ============================================
   Footer
   ============================================ */
.site-footer {
  background: var(--bg-dark);
  color: white;
  padding: 48px 0 32px;
}

.footer-inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
  text-align: center;
}

.footer-inner .col {
  display: grid;
  gap: 12px;
}

.footer-inner strong {
  font-size: 1.125rem;
  margin-bottom: 4px;
}

.footer-inner a {
  color: rgba(255, 255, 255, 0.7);
  transition: color 0.2s ease;
}

.footer-inner a:hover {
  color: white;
  text-decoration: none;
}

@media (min-width: 768px) {
  .footer-inner {
    grid-template-columns: 2fr 1fr 1fr;
    text-align: left;
  }
}

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

.hero-copy {
  animation: fadeInUp 0.6s ease-out;
}

/* ============================================
   Utilities
   ============================================ */
.stack {
  display: grid;
  gap: 16px;
}

/* ============================================
   Form Messages
   ============================================ */
.form-message {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
  font-weight: 500;
  font-size: 0.95rem;
  animation: slideDown 0.3s ease-out;
}

.form-message svg {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
}

.form-message.success {
  background: #dcfce7;
  color: #166534;
  border: 2px solid #86efac;
}

.form-message.success svg {
  color: #16a34a;
}

.form-message.error {
  background: #fee2e2;
  color: #991b1b;
  border: 2px solid #fca5a5;
}

.form-message.error svg {
  color: #dc2626;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Disabled button state */
button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

button:disabled:hover {
  transform: none;
}