/* Contacto: giant word with the form panel on top (js/pages/contacto.js). Loaded after css/base/pages.css. */

.contact-page {
  --black: #0E0E0E;
  --green: #1E7A5D;
  --error: #FFD2D2;
  --pad: clamp(10px, 1.2vw, 18px);
}

html.contact-page,
.contact-page body {
  color: #fff;
  background: var(--black);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.contact-page a:focus-visible,
.contact-page button:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 4px;
}

/* ---------- Header: logo, quote button and hamburger with the site menu ---------- */

.contact-page .topbar {
  top: 18px;
  right: var(--pad);
  left: var(--pad);
  display: flex;
  justify-content: space-between;
}

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

.quote-btn {
  padding: 10px 18px;
  border-radius: 999px;
  color: var(--black);
  background: #fff;
  font-size: .85rem;
  font-weight: 600;
  white-space: nowrap;
  transition: background .2s;
}

.quote-btn:hover {
  background: #e6e6e6;
}

.contact-page .menu {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: #fff;
  background: transparent;
}

.contact-page .menu:hover {
  background: #ffffff1a;
}

.contact-page .menu svg {
  width: 28px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.2;
}

.contact-page .topbar nav {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  left: auto;
  display: none;
  flex-direction: column;
  align-items: stretch;
  gap: 2px;
  min-width: 240px;
  padding: 10px;
  border: 1px solid #ffffff1f;
  border-radius: 18px;
  background: #1a1a1a;
}

.contact-page .topbar nav.open {
  display: flex;
}

.contact-page .topbar nav a {
  padding: 12px 16px;
  border-radius: 12px;
  font-size: .95rem;
}

.contact-page .topbar nav a:hover {
  color: #fff;
  background: #ffffff14;
}

.contact-page .topbar nav a[aria-current=page] {
  color: var(--black);
  background: #fff;
}

/* ---------- Giant word ---------- */

.contact {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100svh;
  padding: 80px var(--pad) 0;
}

.contact-word {
  position: relative;
  z-index: 1;
}

/* js/pages/contacto.js sets --word-h: full width, stretched towards ~62% of the screen height. */
.contact-word svg {
  display: block;
  width: 100%;
  height: var(--word-h, 58vh);
  overflow: hidden;
  fill: #fff;
  font-family: 'Big Shoulders Display', 'Arial Narrow', Impact, sans-serif;
  font-size: 100px;
  font-weight: 900;
}

/* js/pages/contacto.js reveals these once the word is built and the entrance can start. */
.contact.is-pending .contact-word,
.contact.is-pending .contact-panel {
  visibility: hidden;
}

/* ---------- Form panel ---------- */

/* Covers the lower part of the letters: its top edge sits at ~57% of the word's height. */
.contact-panel {
  position: relative;
  z-index: 2;
  flex: 1;
  margin: calc(var(--word-h, 58vh) * -.43) 0 0 25%;
  padding: clamp(40px, 5.5vw, 80px);
  background: var(--green);
}

.contact-eyebrow {
  margin: 0 0 clamp(28px, 4vw, 52px);
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .06em;
}

.cf-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px clamp(32px, 6vw, 96px);
}

.cf-col {
  display: flex;
  flex-direction: column;
  gap: 34px;
}

.cf-field {
  position: relative;
}

.cf-field input,
.cf-field textarea {
  display: block;
  width: 100%;
  padding: 24px 0 10px;
  border: 0;
  border-radius: 0;
  color: #fff;
  background: transparent;
  font: inherit;
  font-size: 1.3rem;
  font-weight: 500;
  outline: none;
}

.cf-field input::placeholder,
.cf-field textarea::placeholder {
  color: transparent;
}

.cf-field textarea {
  min-height: 140px;
  resize: none;
}

/* The message box is as tall as the fields beside it. */
.cf-field--message {
  display: flex;
  flex: 1;
  flex-direction: column;
}

.cf-field--message textarea {
  flex: 1;
}

/* Label reads as the field's title, then floats up while typing. */
.cf-field > :is(input, textarea) + label {
  position: absolute;
  top: 24px;
  left: 0;
  font-size: 1.3rem;
  font-weight: 500;
  line-height: 1.2;
  pointer-events: none;
  transform-origin: left top;
  transition: transform .25s cubic-bezier(.2, .8, .2, 1), opacity .25s;
}

.cf-field input:focus + label,
.cf-field input:not(:placeholder-shown) + label,
.cf-field textarea:focus + label,
.cf-field textarea:not(:placeholder-shown) + label {
  opacity: .9;
  transform: translateY(-22px) scale(.62);
}

/* 1px rule, drawn in by the entrance; the 2px line grows from the left on focus. */
.cf-rule,
.cf-line {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  background: #fff;
  transform-origin: left center;
}

.cf-rule {
  height: 1px;
}

.cf-line {
  height: 2px;
  transform: scaleX(0);
  transition: transform .4s cubic-bezier(.2, .8, .2, 1);
}

.cf-field:focus-within .cf-line {
  transform: scaleX(1);
}

.cf-field.is-invalid .cf-rule,
.cf-field.is-invalid .cf-line {
  background: var(--error);
}

.cf-field.is-invalid .cf-rule {
  height: 2px;
}

.cf-error {
  position: absolute;
  top: 100%;
  left: 0;
  margin: 6px 0 0;
  font-size: .8rem;
  line-height: 1.3;
}

/* Consent checkbox: white square, green tick. */
.cf-check {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  max-width: 34ch;
  font-size: .95rem;
  line-height: 1.4;
  cursor: pointer;
}

.cf-check input {
  position: absolute;
  width: 16px;
  height: 16px;
  margin: 3px 0 0;
  opacity: 0;
}

.cf-box {
  display: grid;
  flex: none;
  place-items: center;
  width: 16px;
  height: 16px;
  margin-top: 3px;
  background: #fff;
}

.cf-check input:checked + .cf-box::after {
  content: '';
  width: 8px;
  height: 4px;
  border-bottom: 2px solid var(--green);
  border-left: 2px solid var(--green);
  transform: translateY(-1px) rotate(-45deg);
}

.cf-check input:focus-visible + .cf-box {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

.cf-consent.is-invalid .cf-box {
  box-shadow: 0 0 0 2px var(--error);
}

/* 90% white keeps the 12px text above 4.5:1 on the green. */
.cf-legal {
  max-width: 46ch;
  margin: 0;
  color: #ffffffe6;
  font-size: 12px;
  line-height: 1.5;
}

.cf-legal a {
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.cf-hp {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.cf-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 14px;
  margin-top: clamp(36px, 4vw, 52px);
}

.cf-status {
  order: 2;
  min-height: 1.4em;
  margin: 0;
  font-size: .9rem;
  text-align: right;
}

.cf-submit {
  display: inline-flex;
  align-items: center;
  gap: 18px;
  padding: 14px 22px 14px 28px;
  border: 1px solid #fff;
  border-radius: 999px;
  color: #fff;
  background: transparent;
  font-size: 1.25rem;
  font-weight: 500;
  transition: background .25s, color .25s;
}

.cf-arrow {
  transition: transform .25s;
}

.cf-submit:hover:not(:disabled) {
  color: var(--green);
  background: #fff;
}

.cf-submit:hover:not(:disabled) .cf-arrow {
  transform: translateX(4px);
}

.cf-submit:disabled {
  opacity: .75;
  cursor: progress;
}

.cf-success p {
  max-width: 20ch;
  margin: 0;
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 500;
  line-height: 1.2;
}

.cf-success:focus {
  outline: none;
}

/* ---------- Footer ---------- */

.contact-footer {
  margin: 0;
  padding: 32px var(--pad) 40px;
}

.contact-page .socials a {
  color: #fff;
  background: #ffffff14;
}

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

@media (max-width: 1100px) {
  .contact-panel {
    margin-left: 10%;
  }
}

@media (max-width: 767px) {
  .contact {
    padding-top: 76px;
  }

  /* Full width, overlapping only the base of the letters. */
  .contact-panel {
    margin: calc(var(--word-h, 30vh) * -.2) 0 0;
    padding: 36px 22px 44px;
  }

  .cf-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .cf-actions {
    align-items: stretch;
  }

  .cf-submit {
    justify-content: center;
  }

  .cf-status {
    text-align: left;
  }

  .quote-btn {
    padding: 8px 14px;
    font-size: .75rem;
  }

  .contact-page .brand {
    font-size: .7rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cf-field > :is(input, textarea) + label,
  .cf-line,
  .cf-arrow,
  .cf-submit,
  .quote-btn {
    transition: none;
  }
}

@media (max-width: 480px) {
  .contact-page .topbar {
    flex-wrap: wrap;
    gap: 10px;
  }

  .contact-actions {
    order: 3;
    width: 100%;
    justify-content: space-between;
  }

  .contact {
    padding-top: 132px;
  }
}
