/* ==============================================
   Contacto — Diseño moderno y confiable
   ============================================== */

/* Variables específicas para contacto */
:root {
  --contact-primary: #2563eb;
  --contact-accent: #06b6d4;
  --contact-success: #059669;
  --contact-error: #dc2626;
  --contact-bg: #f8fafc;
  --contact-text: #0f172a;
  --contact-muted: #64748b;
  --contact-border: #e2e8f0;
  --contact-card: #ffffff;
  --contact-shadow: 0 20px 40px rgba(15, 23, 42, .08);
  --contact-radius: 16px;
  --contact-input-bg: #ffffff;
  --contact-focus-ring: rgba(37, 99, 235, .15);
}

/* Reset y base */
.contact-page {
  background: linear-gradient(180deg, #ffffff, var(--contact-bg) 15%);
  min-height: 100vh;
}

/* Hero section */
.contact-hero {
  padding: clamp(40px, 6vw, 72px) 0 clamp(32px, 4vw, 56px);
  text-align: center;
}

.contact-hero h1 {
  font-size: clamp(2rem, 3vw + 1rem, 3.2rem);
  line-height: 1.1;
  margin: 0 0 16px;
  background: linear-gradient(135deg, var(--contact-text), var(--contact-primary));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.02em;
}

.contact-hero p {
  font-size: clamp(1.1rem, 1.2vw + 0.5rem, 1.25rem);
  color: var(--contact-muted);
  max-width: 65ch;
  margin: 0 auto 24px;
}

/* Form layout */
.contact-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 40px;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

@media (max-width: 860px) {
  .contact-layout {
    grid-template-columns: 1fr;
    gap: 32px;
  }
}

/* Form styling */
.contact-form {
  background: var(--contact-card);
  border: 1px solid var(--contact-border);
  padding: clamp(24px, 4vw, 32px);
  border-radius: var(--contact-radius);
  box-shadow: var(--contact-shadow);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-bottom: 20px;
}

@media (max-width: 480px) {
  .form-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

/* Form elements */
.form-group {
  margin-bottom: 20px;
}

label {
  display: block;
  font-weight: 600;
  color: var(--contact-text);
  margin-bottom: 8px;
  font-size: 0.95rem;
}

input,
select,
textarea {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--contact-border);
  background: var(--contact-input-bg);
  border-radius: 12px;
  color: var(--contact-text);
  font-size: 1rem;
  transition: all 0.2s ease;
}

select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%2364748b' viewBox='0 0 16 16'%3E%3Cpath d='M8 10.5l-4-4h8l-4 4z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 40px;
}

textarea {
  min-height: 120px;
  resize: vertical;
}

input:hover,
select:hover,
textarea:hover {
  border-color: #94a3b8;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--contact-primary);
  box-shadow: 0 0 0 4px var(--contact-focus-ring);
}

/* Form actions */
.form-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 1rem;
  transition: all 0.2s ease;
  cursor: pointer;
}

.btn.primary {
  background: linear-gradient(135deg, var(--contact-primary), var(--contact-accent));
  color: white;
  border: none;
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.25);
}

.btn.primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(37, 99, 235, 0.3);
}

.btn.secondary {
  background: white;
  border: 2px solid var(--contact-border);
  color: var(--contact-text);
}

.btn.secondary:hover {
  background: var(--contact-bg);
  border-color: #94a3b8;
}

/* Sidebar content */
.contact-sidebar {
  position: relative;
}

.contact-card {
  background: var(--contact-card);
  border: 1px solid var(--contact-border);
  padding: 32px;
  border-radius: var(--contact-radius);
  position: sticky;
  top: 100px;
  box-shadow: var(--contact-shadow);
}

.contact-card h2 {
  font-size: 1.5rem;
  margin: 0 0 28px;
  color: var(--contact-text);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.contact-methods {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.contact-method {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 24px;
  border-radius: 14px;
  background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
  border: 1.5px solid var(--contact-border);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: default;
}

.contact-method:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(37, 99, 235, 0.12);
  border-color: rgba(37, 99, 235, 0.3);
  background: white;
}

.method-icon {
  width: 56px;
  height: 56px;
  min-width: 56px;
  border-radius: 14px;
  background: linear-gradient(135deg, #eef2ff 0%, #dbeafe 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  flex-shrink: 0;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.08);
}

.contact-method:hover .method-icon {
  transform: scale(1.15) rotate(5deg);
  background: linear-gradient(135deg, var(--contact-primary) 0%, var(--contact-accent) 100%);
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.25);
}

.method-info {
  flex: 1;
  min-width: 0;
}

.method-info h3 {
  font-size: 1.1rem;
  margin: 0 0 6px;
  color: var(--contact-text);
  font-weight: 700;
  letter-spacing: -0.01em;
}

.method-info p {
  font-size: 0.95rem;
  color: var(--contact-muted);
  margin: 0;
  line-height: 1.5;
  word-break: break-word;
}

.method-info a {
  color: var(--contact-primary);
  text-decoration: none;
  font-weight: 600;
  transition: all 0.2s ease;
  display: inline-block;
}

.method-info a:hover {
  color: var(--contact-accent);
  text-decoration: underline;
  transform: translateX(2px);
}

/* Response messages */
.form-message {
  padding: 12px 16px;
  border-radius: 10px;
  margin-top: 16px;
  font-size: 0.95rem;
  display: none;
}

.form-message.success {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #065f46;
  display: block;
}

.form-message.error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
  display: block;
}

/* Privacy note */
.privacy-note {
  font-size: 0.9rem;
  color: var(--contact-muted);
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--contact-border);
}

/* Honeypot */
.hidden {
  display: none !important;
}

/* Loading state */
.btn.loading {
  position: relative;
  color: transparent;
}

.btn.loading::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Responsive adjustments */
@media (max-width: 640px) {
  .contact-hero {
    padding: 32px 0 24px;
  }

  .contact-form {
    padding: 20px;
  }

  .form-actions {
    flex-direction: column;
  }

  .btn {
    width: 100%;
    justify-content: center;
  }
}

/* Print styles */
@media print {
  .contact-page {
    background: none;
  }

  .contact-form,
  .contact-card {
    box-shadow: none;
    border: 1px solid #ddd;
  }

  .btn {
    display: none;
  }
}