/* ============================================
   Lalo: Contact page
   Layers on top of styles.css; no overrides of shared components.
   ============================================ */

.header--solid {
  background: rgba(10, 10, 15, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

.contact-page {
  position: relative;
  padding: 160px 0 120px;
  overflow: hidden;
}

/* Soft accent wash behind the page, echoing the hero glow */
.contact-page::before {
  content: '';
  position: absolute;
  top: -240px;
  left: 50%;
  transform: translateX(-50%);
  width: 900px;
  height: 600px;
  background: radial-gradient(closest-side, var(--accent-glow), transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.contact__grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 72px;
  align-items: start;
}

/* --- Left column --- */
.contact__title {
  font-size: clamp(2.2rem, 4.4vw, 3.2rem);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.03em;
  margin-bottom: 20px;
}

.contact__lead {
  font-size: 1.1rem;
  color: var(--text-secondary);
  line-height: 1.8;
  max-width: 480px;
  margin-bottom: 44px;
}

.contact__reasons {
  display: flex;
  flex-direction: column;
  gap: 24px;
  margin-bottom: 44px;
}

.contact__reasons li {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.contact__reason-icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.2);
  color: var(--accent-light);
}

.contact__reasons h3 {
  font-size: 0.98rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.contact__reasons p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.65;
}

.contact__direct {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
  font-size: 0.9rem;
  color: var(--text-muted);
}

.contact__direct a {
  font-family: var(--font-mono);
  color: var(--orange-light);
  transition: var(--transition);
}

.contact__direct a:hover {
  color: var(--orange);
}

/* --- Form card --- */
.contact__card {
  position: relative;
  padding: 40px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
}

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

/* The display rules above outrank the browser's [hidden] rule, so the
   form/success swap needs its own higher-specificity selector. */
.contact-form[hidden],
.contact__success[hidden] {
  display: none;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
}

.field label {
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--text-primary);
}

.field .req {
  color: var(--orange);
  margin-left: 2px;
}

.field .opt {
  font-weight: 400;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-left: 4px;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 12px 14px;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--border);
  border-radius: 10px;
  transition: border-color var(--transition), background var(--transition), box-shadow var(--transition);
  -webkit-appearance: none;
  appearance: none;
}

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

.field select {
  cursor: pointer;
  /* Chevron drawn inline so the control matches the dark theme */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238a8a9a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 38px;
}

.field select option {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

.field input::placeholder,
.field textarea::placeholder {
  color: var(--text-muted);
}

.field input:hover,
.field select:hover,
.field textarea:hover {
  border-color: var(--border-hover);
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(99, 102, 241, 0.6);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.14);
}

.field--invalid input,
.field--invalid select,
.field--invalid textarea {
  border-color: rgba(248, 113, 113, 0.6);
}

.field--invalid input:focus,
.field--invalid textarea:focus {
  box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.14);
}

.field__error {
  display: none;
  font-size: 0.82rem;
  color: #f87171;
}

.field--invalid .field__error {
  display: block;
}

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

.field__count {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* Honeypot: off-screen rather than display:none so bots still see it */
.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.contact-form__submit {
  justify-content: center;
  width: 100%;
  padding: 15px 28px;
  margin-top: 2px;
}

.contact-form__submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.contact-form__spinner {
  display: none;
  animation: cfSpin 0.7s linear infinite;
}

.contact-form--sending .contact-form__spinner {
  display: block;
}

@keyframes cfSpin {
  to { transform: rotate(360deg); }
}

.contact-form__note {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
}

.form-status {
  display: none;
  padding: 12px 16px;
  font-size: 0.88rem;
  line-height: 1.6;
  border-radius: 10px;
  border: 1px solid rgba(248, 113, 113, 0.3);
  background: rgba(248, 113, 113, 0.08);
  color: #fca5a5;
}

.form-status--visible {
  display: block;
}

.form-status a {
  color: inherit;
  text-decoration: underline;
}

/* --- Success state --- */
.contact__success {
  text-align: center;
  padding: 24px 8px 8px;
}

.contact__success-icon {
  width: 60px;
  height: 60px;
  margin: 0 auto 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--hr-color);
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  box-shadow: 0 0 32px rgba(16, 185, 129, 0.16);
}

.contact__success h2 {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}

.contact__success p {
  font-size: 0.98rem;
  color: var(--text-secondary);
  line-height: 1.7;
  max-width: 380px;
  margin: 0 auto 28px;
}

.contact__success-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

/* --- Responsive --- */
@media (max-width: 960px) {
  .contact-page {
    padding: 130px 0 90px;
  }

  .contact__grid {
    grid-template-columns: 1fr;
    gap: 56px;
  }

  .contact__lead {
    max-width: none;
  }
}

@media (max-width: 640px) {
  .contact-page {
    padding: 110px 0 70px;
  }

  .contact__card {
    padding: 28px 22px;
  }

  .field-row {
    grid-template-columns: 1fr;
    gap: 22px;
  }

  /* iOS zooms the page on focus for anything under 16px */
  .field input,
  .field select,
  .field textarea {
    font-size: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .contact-form__spinner {
    animation-duration: 2s;
  }
}
