/* ═══════════════════════════════════════════════
   GRUPO ALTURA — Contact Modal
   ═══════════════════════════════════════════════ */

.contact-modal__overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 200;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.contact-modal__overlay.open {
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
}

.contact-modal {
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  margin: var(--space-md);
  background: #FFFFFF;
  border: 1px solid var(--color-glass-border);
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.15);
  animation: modalSlideUp 0.35s var(--ease-spring);
}

@keyframes modalSlideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.contact-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 28px 0;
}

.contact-modal__title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--color-text);
  letter-spacing: -0.02em;
}

.contact-modal__close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-glass-border);
  border-radius: 8px;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: all 0.2s;
}

.contact-modal__close:hover {
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.2);
  color: #EF4444;
}

.contact-modal__close svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
}

.contact-modal__sub {
  padding: 8px 28px 0;
  font-size: 0.88rem;
  color: var(--color-text-muted);
  line-height: 1.5;
}

.contact-modal__form {
  padding: 20px 28px 28px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.contact-modal__field label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--color-text-muted);
  margin-bottom: 6px;
  letter-spacing: 0.01em;
}

.contact-modal__input {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--color-glass-border);
  border-radius: 10px;
  background: var(--color-bg-elevated);
  font-family: var(--font-display);
  font-size: 0.9rem;
  color: var(--color-text);
  transition: border-color 0.2s;
  outline: none;
}

.contact-modal__input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(11, 36, 71, 0.08);
}

.contact-modal__input::placeholder {
  color: var(--color-text-dim);
}

textarea.contact-modal__input {
  resize: vertical;
  min-height: 80px;
}

select.contact-modal__input {
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394A3B8' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

select.contact-modal__input option {
  background: #FFFFFF;
  color: var(--color-text);
}

.contact-modal__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.contact-modal__error {
  font-size: 0.72rem;
  color: #EF4444;
  margin-top: 4px;
  display: block;
  min-height: 0;
}

.contact-modal__submit {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 0;
  margin-top: 4px;
  background: var(--color-primary);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s;
}

.contact-modal__submit:hover {
  background: var(--color-primary-light);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(11, 36, 71, 0.2);
}

.contact-modal__submit:disabled {
  opacity: 0.6;
  cursor: default;
  transform: none;
  box-shadow: none;
}

.contact-modal__submit svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2.5;
  stroke-linecap: round;
}

.contact-modal__spinner {
  display: none;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

.contact-modal__submit.loading .contact-modal__spinner { display: block; }
.contact-modal__submit.loading .contact-modal__submit-text { display: none; }
.contact-modal__submit.loading .contact-modal__submit-icon { display: none; }

/* Success state */
.contact-modal__success {
  display: none;
  padding: 48px 28px;
  text-align: center;
}

.contact-modal__success.show { display: block; }
.contact-modal__success.show + .contact-modal__form { display: none; }
.contact-modal__success.show ~ .contact-modal__sub { display: none; }

.contact-modal__success-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(5, 150, 105, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  color: var(--color-success);
}

.contact-modal__success-icon svg {
  width: 28px;
  height: 28px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.contact-modal__success-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 8px;
}

.contact-modal__success-desc {
  font-size: 0.88rem;
  color: var(--color-text-muted);
  line-height: 1.6;
}

/* Responsive */
@media (max-width: 768px) {
  .contact-modal__overlay.open {
    align-items: flex-end;
  }

  .contact-modal {
    margin: 0;
    max-height: 95vh;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    animation: modalSlideUpMobile 0.35s var(--ease-spring);
  }

  @keyframes modalSlideUpMobile {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
  }

  .contact-modal__row {
    grid-template-columns: 1fr;
  }

  .contact-modal__input {
    font-size: 16px;
  }
}
