/* ==========================================================================
   Contact page (contact.html)
   Page-specific styles only. Use .contact-* class names; shared components
   live in css/style.css and must not be redefined here.
   ========================================================================== */

/* How far the form + direct-contact cards rise into the dark hero */
.contact-hero,
.contact-section {
  --contact-overlap: 120px;
  --contact-pad: clamp(28px, 3.6vw, 48px);
}


/* --- Hero ------------------------------------------------------------- */

.contact-hero {
  min-height: 0;
  padding-bottom: calc(88px + var(--contact-overlap));
}

.contact-hero-copy {
  max-width: 880px;
}

/* Two-line headline: white line, lime line */
.contact-hero .hl {
  display: block;
}

.contact-hero-lead {
  max-width: 600px;
}


/* --- Layout ----------------------------------------------------------- */

.contact-section {
  position: relative;
  z-index: 1;
  padding-top: 0;
}

.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: var(--grid-gap);
  margin-top: calc(var(--contact-overlap) * -1);
}

.contact-card-title {
  font-size: var(--fs-h-sm);
  line-height: 1.1;
  letter-spacing: -0.015em;
}


/* --- Form card -------------------------------------------------------- */

.contact-form-wrapper {
  padding: var(--contact-pad);
}

.contact-form .contact-card-title {
  margin-bottom: 32px;
}

.contact-label-split {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.contact-optional {
  color: var(--muted-2);
  font-size: var(--fs-caption);
  font-weight: 500;
}

.contact-form-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 24px;
  margin-top: 16px;
}

.contact-submit {
  flex-shrink: 0;
  min-width: 200px;
}

/* Keep the error ring while the script focuses the first invalid field */
.contact-form .form-group .form-error:focus {
  background-color: var(--white);
  box-shadow: inset 0 0 0 2px var(--danger);
}

/* Inline field error (text + icon, so the error isn't color-only).
   Shown by the validation script; [hidden] keeps it out otherwise. */
.contact-field-error {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin: 0;
  color: var(--danger);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
}

.contact-field-error::before {
  content: '';
  flex: 0 0 16px;
  height: 16px;
  margin-top: 2px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill-rule='evenodd' d='M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zm-1.2 5.5h2.4l-.3 7h-1.8zM12 15.6a1.45 1.45 0 1 1 0 2.9 1.45 1.45 0 0 1 0-2.9z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill-rule='evenodd' d='M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zm-1.2 5.5h2.4l-.3 7h-1.8zM12 15.6a1.45 1.45 0 1 1 0 2.9 1.45 1.45 0 0 1 0-2.9z'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* Privacy note next to the submit button */
.contact-privacy-note {
  flex: 1 1 240px;
  max-width: 380px;
  color: var(--muted-2);
  font-size: var(--fs-caption);
  line-height: 1.5;
}

.contact-privacy-note a {
  color: inherit;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  transition: color 0.2s ease;
}

.contact-privacy-note a:hover {
  color: var(--plum-900);
}

/* --- Success state (shown by js/contact.js after ?sent=true) --------- */

.contact-success {
  flex: 1;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  min-height: 360px;
}

.contact-success-icon {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  margin-bottom: 32px;
  border-radius: 50%;
  background: var(--lime);
  color: var(--plum-900);
}

.contact-success-title {
  font-size: var(--fs-h-md);
}

/* Focused by the script on ?sent=true so screen readers announce it;
   it isn't interactive, so no ring */
.contact-success-title:focus {
  outline: none;
}

.contact-success-text {
  max-width: 44ch;
  margin-top: 16px;
  color: var(--fg-muted);
  font-size: var(--fs-lead);
}

.contact-success-link {
  margin-top: 32px;
}


/* --- Direct contact card --------------------------------------------- */

.contact-info-block {
  overflow: hidden;
  padding: var(--contact-pad);
}

.contact-info-kicker {
  margin-top: 40px;
  margin-bottom: 8px;
  color: var(--fg-muted);
  font-family: var(--font-text);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: 0;
}

.contact-info-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  container-type: inline-size;
}

.contact-info-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 0;
  border-bottom: 1px solid var(--hairline);
  color: var(--fg);
}

.contact-info-icon {
  display: grid;
  flex-shrink: 0;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  color: var(--plum-900);
}

.contact-info-icon--lime { background: var(--lime); }
.contact-info-icon--pink { background: var(--pink); }

.contact-info-text {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.contact-info-label {
  color: var(--fg-muted);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.3;
}

.contact-info-value {
  color: var(--fg);
  font-size: 17px;
  font-weight: 600;
  line-height: 1.35;
  overflow-wrap: break-word;
}

.contact-info-go {
  display: grid;
  flex-shrink: 0;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px var(--hairline);
  color: var(--fg);
  transition: background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease, transform 0.2s var(--ease);
}

.contact-info-item:hover .contact-info-go {
  background: var(--lime);
  box-shadow: none;
  color: var(--plum-900);
  transform: translateX(3px);
}

.contact-info-item:hover .contact-info-value {
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 4px;
}

.contact-info-item:focus-visible {
  outline-offset: 4px;
  border-radius: 4px;
}

/* Narrow rows: the whole row is the link, so drop the arrow first, then
   step the value down so "linkedin.com/company/opratel" stays on one line */
@container (max-width: 359px) {
  .contact-info-go {
    display: none;
  }
}

@container (max-width: 299px) {
  .contact-info-value {
    font-size: 16px;
  }
}

@container (max-width: 285px) {
  .contact-info-item {
    gap: 12px;
  }

  .contact-info-icon {
    width: 44px;
    height: 44px;
  }

  .contact-info-value {
    font-size: 15px;
  }
}

/* Decorative vignette, bleeding off the card's bottom and right edges */
.contact-info-art {
  margin: auto calc(var(--contact-pad) * -1) calc(var(--contact-pad) * -1);
  padding-top: 40px;
  pointer-events: none;
}

.contact-info-art svg {
  display: block;
  width: 100%;
  height: auto;
}

.contact-art-lavender { fill: var(--lavender); }
.contact-art-pink { fill: var(--pink); }
.contact-art-lime { fill: var(--lime); }
.contact-art-white { fill: var(--white); }
.contact-art-bar { fill: var(--plum-700); }
.contact-art-bar--soft { fill: var(--line); }
.contact-art-dot { fill: var(--plum-900); }


/* --- Breakpoints ------------------------------------------------------ */

@media (max-width: 959px) {
  .contact-hero,
  .contact-section {
    --contact-overlap: 72px;
  }

  .contact-hero {
    padding-bottom: calc(64px + var(--contact-overlap));
  }

  .contact-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  /* Wide single column: copy left, vignette right */
  .contact-info-block {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 0.85fr);
    column-gap: 32px;
    align-content: start;
  }

  .contact-info-block > :not(.contact-info-art) {
    grid-column: 1;
  }

  .contact-info-art {
    grid-column: 2;
    grid-row: 1 / span 3;
    align-self: end;
    margin: 0 calc(var(--contact-pad) * -1) calc(var(--contact-pad) * -1) 0;
    padding-top: 0;
  }
}

@media (max-width: 640px) {
  .contact-info-block {
    display: flex;
  }

  .contact-info-art {
    margin: auto calc(var(--contact-pad) * -1) calc(var(--contact-pad) * -1);
    padding-top: 32px;
  }

  .contact-submit {
    flex: 1 1 100%;
  }

  .contact-privacy-note {
    max-width: none;
  }
}

@media (max-width: 480px) {
  .contact-hero,
  .contact-section {
    --contact-overlap: 48px;
  }

  .contact-hero {
    padding-bottom: calc(48px + var(--contact-overlap));
  }

  /* Keeps "Tu próximo paso" (the longer ES line) on one line down to 360px */
  .contact-hero .hero-title {
    font-size: min(48px, 11.6vw);
  }

  .contact-form .contact-card-title {
    margin-bottom: 24px;
  }

  .contact-info-kicker {
    margin-top: 32px;
  }

  .contact-success {
    min-height: 300px;
  }
}
