/* ═══════════════════════════════════════════════════════
   contacto.css | Contacto page styles
   ═══════════════════════════════════════════════════════ */

/* ─── TYPOGRAPHY ─────────────────────────────────────── */
.t-hero {
  font-family: 'DM Sans', sans-serif;
  font-size: clamp(32px, 4.2vw, 64px);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--black);
}

/* ─── SUBPAGE HERO OVERRIDE ──────────────────────────── */
.subpage-hero {
  min-height: unset;
  padding: 40px 0 40px;
}

/* ─── PAGE LAYOUT ────────────────────────────────────── */
.contacto-page {
  width: 100%;
  max-width: var(--max-w);
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 20px;
  align-items: start;
  padding: clamp(40px, 5vw, 80px) 0 clamp(60px, 8vw, 120px);
}

/* ─── INFO COLUMN ────────────────────────────────────── */
.contacto-info {
  display: flex;
  flex-direction: column;
  gap: clamp(28px, 3vw, 40px);
  padding: clamp(28px, 3vw, 44px);
  border-radius: 20px;
  border: 1px solid var(--divider);
  background: #fafafa;
  position: sticky;
  top: 100px;
}

.contacto-info-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.contacto-label {
  font-family: 'Roboto Mono', monospace;
  font-size: clamp(10px, 0.85vw, 11px);
  font-weight: 400;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent-1);
}

.contacto-info-text {
  font-family: 'DM Sans', sans-serif;
  font-size: clamp(13px, 1vw, 15px);
  font-weight: 400;
  line-height: 1.6;
  letter-spacing: -0.005em;
  color: var(--dark-grey);
}

.contacto-email {
  font-family: 'DM Sans', sans-serif;
  font-size: clamp(14px, 1.1vw, 16px);
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--black);
  transition: color 0.2s;
}
.contacto-email:hover {
  color: var(--accent-1);
}

.contacto-divider {
  width: 100%;
  height: 1px;
  background: var(--divider);
}

.contacto-tagline {
  font-family: 'Crimson Text', serif;
  font-size: clamp(16px, 1.4vw, 22px);
  font-weight: 400;
  line-height: 1.3;
  letter-spacing: -0.02em;
  color: var(--grey-mid);
}

/* ─── FORM CARD ──────────────────────────────────────── */
.contacto-form-card {
  background: #fff;
  border-radius: 20px;
  border: 1px solid var(--divider);
  box-shadow:
    0 2px 8px rgba(0, 0, 0, 0.04),
    0 8px 32px rgba(0, 0, 0, 0.05);
  padding: clamp(28px, 3.5vw, 52px);
  /* Fixed min-height so the card doesn't collapse on success */
  min-height: 440px;
  position: relative;
  overflow: hidden;
}

/* ─── SECTION LABEL ──────────────────────────────────── */
.contacto-section-label {
  font-family: 'Roboto Mono', monospace;
  font-size: clamp(10px, 0.85vw, 12px);
  font-weight: 400;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--accent-1);
  margin-bottom: 16px;
}

/* ─── FORM TITLE ─────────────────────────────────────── */
.contacto-form-title {
  font-family: 'Crimson Text', serif;
  font-size: clamp(22px, 2.2vw, 32px);
  font-weight: 400;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: var(--black);
  margin-bottom: clamp(28px, 3vw, 40px);
}

/* ─── FIELDS ─────────────────────────────────────────── */
.contacto-field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.contacto-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.contacto-field:last-child {
  margin-bottom: 0;
}

.contacto-field label {
  font-family: 'DM Sans', sans-serif;
  font-size: clamp(11px, 0.9vw, 13px);
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--black);
}

.contacto-field input,
.contacto-field textarea {
  width: 100%;
  font-family: 'DM Sans', sans-serif;
  font-size: clamp(13px, 1vw, 14px);
  font-weight: 400;
  letter-spacing: -0.005em;
  color: var(--black);
  background: #fafafa;
  border: 1px solid var(--divider);
  border-radius: 10px;
  padding: 12px 14px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  outline: none;
  resize: none;
  appearance: none;
  -webkit-appearance: none;
}

.contacto-field input::placeholder,
.contacto-field textarea::placeholder {
  color: #bbb;
  font-weight: 400;
}

.contacto-field input:focus,
.contacto-field textarea:focus {
  border-color: var(--accent-1);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(60, 114, 161, 0.10);
}

/* invalid fields after attempted submit */
.contacto-field input.invalid,
.contacto-field textarea.invalid,
.phone-number-input.invalid {
  border-color: #e05252;
  box-shadow: 0 0 0 3px rgba(224, 82, 82, 0.10);
}

/* red label when field has error */
.contacto-field.field-error > label {
  color: #e05252;
  transition: color 0.2s;
}

/* required asterisk */
.contacto-required {
  color: #e05252;
  font-weight: 700;
  margin-left: 1px;
}

/* easter egg error | monospace terminal style, hidden when empty */
.contacto-error.is-easter-egg {
  font-family: 'Roboto Mono', monospace;
  font-size: clamp(11px, 0.85vw, 12px);
  letter-spacing: 0.02em;
}
.contacto-error:empty {
  display: none;
}

/* ─── ACTIONS ROW ────────────────────────────────────── */
.contacto-actions {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-top: clamp(24px, 2.5vw, 36px);
  flex-wrap: wrap;
}

.contacto-submit {
  flex-shrink: 0;
  transition: opacity 0.2s, transform 0.15s;
}

.contacto-submit:active {
  transform: scale(0.97);
}

.contacto-submit.loading {
  opacity: 0.6;
  pointer-events: none;
}

.contacto-disclaimer {
  font-family: 'DM Sans', sans-serif;
  font-size: clamp(11px, 0.85vw, 12px);
  font-weight: 400;
  letter-spacing: -0.005em;
  color: var(--grey-mid);
  line-height: 1.5;
  flex: 1;
  min-width: 160px;
}

/* ─── ERROR MESSAGE ──────────────────────────────────── */
.contacto-error {
  font-family: 'DM Sans', sans-serif;
  font-size: clamp(12px, 0.9vw, 13px);
  font-weight: 400;
  color: #e05252;
  margin-top: 12px;
  min-height: 18px;
  transition: opacity 0.2s;
}

/* ─── SUCCESS STATE ──────────────────────────────────── */
.contacto-form-inner,
.contacto-success {
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.contacto-success {
  display: none;
  flex-direction: column;
  align-items: flex-start;
  gap: clamp(20px, 2.5vw, 28px);
  opacity: 0;
  transform: translateY(16px);
}

.contacto-success.visible {
  display: flex;
  opacity: 1;
  transform: translateY(0);
}

.success-icon svg {
  width: 48px;
  height: 48px;
}

.success-title {
  font-family: 'Crimson Text', serif;
  font-size: clamp(22px, 2.2vw, 32px);
  font-weight: 400;
  letter-spacing: -0.03em;
  color: var(--black);
  line-height: 1.1;
}

.success-body {
  font-family: 'DM Sans', sans-serif;
  font-size: clamp(13px, 1.05vw, 15px);
  font-weight: 400;
  line-height: 1.6;
  color: var(--dark-grey);
}

.success-body strong {
  color: var(--black);
  font-weight: 600;
}

/* ─── ANIMATIONS ─────────────────────────────────────── */
.contacto-info,
.contacto-form-card {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}

.contacto-info.visible,
.contacto-form-card.visible {
  opacity: 1;
  transform: translateY(0);
}

.contacto-form-card { transition-delay: 0.08s; }

/* ─── PHONE FIELD ───────────────────────────────────── */
.contacto-field-optional {
  font-weight: 400;
  color: var(--grey-mid);
  font-size: 0.9em;
}

.phone-input-wrap {
  display: flex;
  align-items: stretch;
  gap: 0;
  position: relative;
  width: 100%;
}

/* Prefix button */
.phone-prefix-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  padding: 12px 12px;
  background: #fafafa;
  border: 1px solid var(--divider);
  border-right: none;
  border-radius: 10px 0 0 10px;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  font-size: clamp(13px, 1vw, 14px);
  color: var(--black);
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
  white-space: nowrap;
  outline: none;
}

.phone-prefix-btn:focus,
.phone-prefix-btn.open {
  border-color: var(--accent-1);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(60, 114, 161, 0.10);
  z-index: 1;
}

.phone-prefix-flag {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.c-flag-img {
  display: block;
  width: 20px;
  height: 14px;
  object-fit: cover;
  border-radius: 2px;
  flex-shrink: 0;
}

.phone-prefix-code {
  font-weight: 500;
  letter-spacing: -0.01em;
}

.phone-prefix-arrow {
  width: 10px;
  height: 6px;
  color: var(--grey-mid);
  transition: transform 0.2s;
  flex-shrink: 0;
}

.phone-prefix-btn.open .phone-prefix-arrow {
  transform: rotate(180deg);
}

/* Number input */
.phone-number-input {
  flex: 1;
  font-family: 'DM Sans', sans-serif;
  font-size: clamp(13px, 1vw, 14px);
  font-weight: 400;
  letter-spacing: -0.005em;
  color: var(--black);
  background: #fafafa;
  border: 1px solid var(--divider);
  border-radius: 0 10px 10px 0;
  padding: 12px 14px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  min-width: 0;
}

.phone-number-input::placeholder {
  color: #bbb;
  font-weight: 400;
}

.phone-number-input:focus {
  border-color: var(--accent-1);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(60, 114, 161, 0.10);
}

/* Sync focus ring between button and input */
.phone-input-wrap:has(.phone-prefix-btn.open) .phone-number-input,
.phone-input-wrap:has(.phone-number-input:focus) .phone-prefix-btn {
  border-color: var(--accent-1);
}

/* Dropdown panel */
.phone-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  width: clamp(260px, 80%, 360px);
  background: #fff;
  border: 1px solid var(--divider);
  border-radius: 12px;
  box-shadow:
    0 4px 16px rgba(0,0,0,0.08),
    0 1px 4px rgba(0,0,0,0.04);
  z-index: 200;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.phone-dropdown[hidden] {
  display: none !important;
}

/* Search row */
.phone-search-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--divider);
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 1;
}

.phone-search-icon {
  width: 14px;
  height: 14px;
  color: var(--grey-mid);
  flex-shrink: 0;
}

.phone-search {
  flex: 1;
  border: none;
  outline: none;
  font-family: 'DM Sans', sans-serif;
  font-size: clamp(12px, 0.95vw, 13px);
  color: var(--black);
  background: transparent;
}

.phone-search::placeholder {
  color: #bbb;
}

/* Country list */
.phone-country-list {
  list-style: none;
  margin: 0;
  padding: 6px 0;
  overflow-y: auto;
  max-height: 220px;
  scroll-behavior: smooth;
}

.phone-country-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  font-size: clamp(12px, 0.95vw, 13px);
  color: var(--black);
  transition: background 0.12s;
  user-select: none;
}

.phone-country-list li:hover,
.phone-country-list li.highlighted {
  background: rgba(60, 114, 161, 0.07);
}

.phone-country-list li.selected {
  background: rgba(60, 114, 161, 0.12);
  font-weight: 600;
}

.phone-country-list li .c-flag {
  font-size: 16px;
  line-height: 1;
  flex-shrink: 0;
}

.phone-country-list li .c-name {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.phone-country-list li .c-dial {
  color: var(--grey-mid);
  font-size: 11px;
  flex-shrink: 0;
}

.phone-country-list .no-results {
  padding: 16px 14px;
  color: var(--grey-mid);
  font-size: 12px;
  text-align: center;
  cursor: default;
}

/* ─── RESPONSIVE ─────────────────────────────────────── */
@media (max-width: 900px) {
  .contacto-page {
    grid-template-columns: 1fr;
  }

  .contacto-info {
    position: static;
    flex-direction: column;
    gap: 10px;
    padding: 16px 18px;
  }

  .contacto-info-block {
    gap: 3px;
  }

  .contacto-divider,
  .contacto-tagline {
    display: none;
  }
}

@media (max-width: 768px) {

  .contacto-field-row {
    grid-template-columns: 1fr;
  }

  .contacto-form-card {
    padding: 20px;
  }

  .contacto-actions {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .contacto-submit {
    width: 100%;
    justify-content: center;
  }
}