/* ============================================================
   TRIBU ANIMAL — contacto.css
   Dirección: editorial luxury / refined organic
   Lo que se recuerda: el número decorativo °01 en el hero
   y los floating labels del formulario
   ============================================================ */

/* ---------- HERO ---------- */

.contact-hero {
  background: var(--c-cream);
  padding: 32px 0 48px;
  position: relative;
  overflow: hidden;
}

/* Grain */
.contact-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: 0.045;
  pointer-events: none;
}

/* Número decorativo de fondo — sutil */
.contact-hero::after {
  content: '°';
  position: absolute;
  right: -2%;
  top: 50%;
  transform: translateY(-52%);
  font-family: var(--f-display);
  font-size: clamp(200px, 28vw, 380px);
  font-weight: 400;
  color: transparent;
  -webkit-text-stroke: 1px rgba(61,92,58,0.06);
  line-height: 1;
  pointer-events: none;
  user-select: none;
}

.contact-hero-inner {
  position: relative;
  z-index: 1;
  max-width: 600px;
}

/* Animaciones entrada hero */
.contact-hero .section-eyebrow,
.contact-hero h1,
.contact-hero-desc {
  opacity: 0;
  transform: translateY(20px);
  animation: contact-fadein 0.6s ease forwards;
}

.contact-hero .section-eyebrow { animation-delay: 0s; }
.contact-hero h1                { animation-delay: 0.12s; }
.contact-hero-desc              { animation-delay: 0.22s; }

@keyframes contact-fadein {
  to { opacity: 1; transform: translateY(0); }
}

.contact-hero h1 {
  font-family: var(--f-display);
  font-size: clamp(36px, 5vw, 56px);
  font-weight: 400;
  line-height: 1.08;
  letter-spacing: -0.02em;
  color: var(--c-ink);
  margin: 18px 0 22px;
}

.contact-hero h1 em {
  font-style: italic;
  color: var(--c-moss);
}

.contact-hero-desc {
  font-size: 15px;
  font-weight: 300;
  color: var(--c-ink-mid);
  line-height: 1.8;
  max-width: 460px;
}

/* Mensaje de error inline */
.contact-field-error {
  display: block;
  font-size: 11px;
  font-weight: 400;
  color: var(--c-terra);
  margin-top: 5px;
  min-height: 16px;
  padding-left: 2px;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.contact-field.is-error .contact-field-error {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- FRANJA DECORATIVA VERTICAL ---------- */
/* Rompe el grid — elemento editorial que sale del contenedor */

.contact-deco-line {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  pointer-events: none;
}

.contact-deco-line span {
  font-family: var(--f-body);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--c-ink-light);
  opacity: 0.4;
  white-space: nowrap;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
}

/* El section necesita position relative para contener la franja */
.contact-body {
  position: relative;
}

/* ---------- CUERPO ---------- */

.contact-body {
  background: var(--c-white);
  padding: 56px 0 80px;
}

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 72px;
  align-items: start;
}

/* ---------- Sidebar ---------- */

.contact-sidebar {
  position: sticky;
  top: 88px;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.contact-info-item {
  padding: 28px 0;
  border-bottom: 0.5px solid var(--c-cream-border);
  opacity: 0;
  transform: translateX(-16px);
  animation: contact-slidein 0.5s ease forwards;
}

.contact-info-item:nth-child(1) { animation-delay: 0.1s; }
.contact-info-item:nth-child(2) { animation-delay: 0.18s; }
.contact-info-item:nth-child(3) { animation-delay: 0.26s; }
.contact-info-item:nth-child(4) { animation-delay: 0.34s; }
.contact-info-item:nth-child(5) { animation-delay: 0.42s; }

@keyframes contact-slidein {
  to { opacity: 1; transform: translateX(0); }
}

.contact-info-item:first-child { border-top: 0.5px solid var(--c-cream-border); }

.contact-info-num {
  font-family: var(--f-numeric);
  font-size: 10px;
  font-weight: 500;
  color: var(--c-ink-light);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 8px;
}

.contact-info-item h3 {
  font-family: var(--f-display);
  font-size: 17px;
  font-weight: 400;
  color: var(--c-ink);
  margin-bottom: 6px;
  line-height: 1.3;
}

.contact-info-item p {
  font-size: 12px;
  font-weight: 300;
  color: var(--c-ink-mid);
  line-height: 1.75;
}

/* Bloque tiempo de respuesta */
.contact-response {
  margin-top: 28px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 20px;
  background: var(--c-cream);
  border: 0.5px solid var(--c-cream-border);
  border-radius: var(--radius-md);
  opacity: 0;
  animation: contact-slidein 0.5s ease 0.5s forwards;
}

.contact-response svg {
  width: 20px;
  height: 20px;
  stroke: var(--c-moss);
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

.contact-response p {
  font-size: 12px;
  font-weight: 300;
  color: var(--c-ink-mid);
  line-height: 1.6;
}

.contact-response strong {
  font-weight: 500;
  color: var(--c-ink-soft);
  display: block;
  margin-bottom: 2px;
}

/* ---------- Panel formulario ---------- */

.contact-form-panel {
  background: var(--c-cream);
  border: 0.5px solid var(--c-cream-border);
  border-radius: 24px;
  padding: 48px;
  opacity: 0;
  transform: translateY(24px);
  animation: contact-fadein 0.6s ease 0.15s forwards;
  box-shadow: 0 2px 40px rgba(26,28,24,0.04);
}

.contact-form-title {
  font-family: var(--f-display);
  font-size: 24px;
  font-weight: 400;
  color: var(--c-ink);
  margin-bottom: 36px;
  letter-spacing: -0.01em;
}

.contact-form-title em {
  font-style: italic;
  color: var(--c-moss);
}

/* ---------- Floating labels ---------- */

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.contact-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.contact-field {
  position: relative;
}

.contact-field-label {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--f-body);
  font-size: 13px;
  font-weight: 300;
  color: var(--c-ink-light);
  pointer-events: none;
  transition: top 0.18s ease, font-size 0.18s ease, color 0.18s ease, font-weight 0.18s ease;
  background: transparent;
  padding: 0 2px;
  line-height: 1;
}

/* Textarea label arriba por defecto */
.contact-field--textarea .contact-field-label {
  top: 18px;
  transform: none;
}

/* Select label siempre flotado */
.contact-field--select .contact-field-label {
  top: -8px;
  transform: none;
  font-size: 10px;
  font-weight: 500;
  color: var(--c-ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: var(--c-cream);
}

/* Estado flotado (js añade .is-active) */
.contact-field.is-active .contact-field-label,
.contact-field.is-filled .contact-field-label {
  top: -8px;
  transform: none;
  font-size: 10px;
  font-weight: 500;
  color: var(--c-moss);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: var(--c-cream);
}

.contact-field--textarea.is-active .contact-field-label,
.contact-field--textarea.is-filled .contact-field-label {
  top: -8px;
}

.contact-field.is-error .contact-field-label {
  color: var(--c-terra);
}

.contact-form-input {
  font-family: var(--f-body);
  font-size: 14px;
  font-weight: 400;
  color: var(--c-ink);
  background: var(--c-white);
  border: 0.5px solid var(--c-cream-border);
  border-radius: var(--radius-sm);
  padding: 14px;
  outline: none;
  width: 100%;
  transition: border-color var(--transition), box-shadow var(--transition);
  -webkit-appearance: none;
}

.contact-form-input::placeholder { color: transparent; }

.contact-form-input:focus {
  border-color: var(--c-moss);
  box-shadow: 0 0 0 3px rgba(61,92,58,0.08);
}

.contact-field.is-error .contact-form-input {
  border-color: var(--c-terra);
  box-shadow: 0 0 0 3px rgba(168,80,48,0.08);
}

.contact-form-textarea {
  resize: vertical;
  min-height: 130px;
  line-height: 1.6;
  padding-top: 14px;
}

.contact-form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M6 9l6 6 6-6' stroke='%239A9D90' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
  padding-right: 36px;
  cursor: pointer;
}

/* Submit */
.contact-form-submit {
  width: 100%;
  justify-content: center;
  font-size: 14px;
  padding: 15px 24px;
  gap: 8px;
  box-shadow: 0 4px 16px rgba(61,92,58,0.22);
}

.contact-form-submit:hover {
  box-shadow: 0 6px 24px rgba(61,92,58,0.32);
}

.contact-submit-icon {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform var(--transition);
}

.contact-form-submit:hover .contact-submit-icon {
  transform: translateX(4px);
}

.contact-submit-spinner {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  animation: contact-spin 0.8s linear infinite;
}

@keyframes contact-spin { to { transform: rotate(360deg); } }

.contact-form-rgpd {
  font-size: 10px;
  font-weight: 300;
  color: var(--c-ink-light);
  text-align: center;
  line-height: 1.7;
}

/* ---------- Estado éxito ---------- */

.contact-success {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 64px 32px;
  gap: 20px;
}

.contact-success-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--c-moss-light);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.contact-success-icon svg {
  width: 24px;
  height: 24px;
  stroke: var(--c-moss);
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.contact-success h3 {
  font-family: var(--f-display);
  font-size: 26px;
  font-weight: 400;
  color: var(--c-ink);
  letter-spacing: -0.01em;
}

.contact-success p {
  font-size: 14px;
  font-weight: 300;
  color: var(--c-ink-mid);
  line-height: 1.75;
  max-width: 360px;
}

/* ---------- Utilidad ---------- */

.contact-hidden { display: none !important; }

/* ---------- Responsive ---------- */

@media (max-width: 1023px) {
  .contact-grid    { grid-template-columns: 1fr; gap: 48px; }
  .contact-sidebar { position: static; }
}

@media (max-width: 767px) {
  .contact-hero    { padding: 72px 0 64px; min-height: auto; }
  .contact-hero h1 { font-size: 34px; }
  .contact-form-panel { padding: 28px 24px; }
  .contact-form-row   { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .contact-hero h1 { font-size: 28px; }
}
