/* -- CONTACT FORM MODAL -- */
.contact-modal {
  /* Reset browser dialog defaults */
  border: none;
  padding: 1.5rem;
  background: transparent;
  max-width: 100%;
  max-height: 100%;
  overflow: visible;
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 600;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s ease;
}

/* Only show as flex layout when the dialog is open */
.contact-modal[open] {
  display: flex;
}

/* Use our own animated backdrop div; suppress the native one */
.contact-modal::backdrop {
  display: none;
}

.contact-modal.open {
  opacity: 1;
  pointer-events: auto;
}

.contact-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(31, 35, 41, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

/* -- PANEL -- */
.contact-modal-panel {
  position: relative;
  z-index: 1;
  background: #fff;
  border-radius: 24px;
  width: min(520px, 94vw);
  max-height: 90vh;
  overflow: auto;
  display: flex;
  flex-direction: column;
  transform: scale(0.9) translateY(16px);
  transition: transform 0.42s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow:
    0 36px 90px rgba(31, 35, 41, 0.3),
    0 0 0 1px rgba(255, 255, 255, 0.06);
}

.contact-modal.open .contact-modal-panel {
  transform: scale(1) translateY(0);
}

/* -- HEADER -- */
.contact-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 2rem 2rem 1.6rem;
  flex-shrink: 0;
  background: var(--blue-50);
}

.contact-modal-header-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.contact-modal-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--blue-500);
  color: white;
  flex-shrink: 0;
}

.contact-modal-header-text {
  flex: 1;
}

.contact-modal-title {
  font-family: "Processity", serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--ink);
  margin: 0;
  line-height: 1.2;
}

.contact-modal-subtitle {
  font-size: 0.875rem;
  color: var(--stone-600);
  margin: 0.25rem 0 0;
}

.contact-modal-close {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: background 0.2s ease;
}

.contact-modal-close:hover {
  background: rgba(26, 35, 50, 0.08);
}

/* -- DIVIDER -- */
.contact-modal-divider {
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(26, 35, 50, 0.1) 20%,
    rgba(26, 35, 50, 0.1) 80%,
    transparent
  );
  flex-shrink: 0;
}

/* -- FORM -- */
.contact-form {
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-group label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ink);
}

.form-group input,
.form-group textarea {
  padding: 0.75rem 1rem;
  border: 1px solid var(--stone-300);
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--ink);
  background: white;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--blue-500);
  box-shadow: 0 0 0 3px var(--blue-50);
}

.form-group textarea {
  resize: vertical;
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu,
    Cantarell, sans-serif;
}

/* -- CHECKBOX -- */
.form-checkbox {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  font-size: 0.875rem;
  color: var(--stone-700);
}

.form-checkbox input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  flex-shrink: 0;
  cursor: pointer;
  accent-color: var(--blue-600);
}

.form-checkbox a {
  color: var(--blue-600);
  text-decoration: none;
  transition: color 0.2s ease;
}

.form-checkbox a:hover {
  color: var(--blue-700);
  text-decoration: underline;
}

/* -- SUBMIT BUTTON -- */
.contact-form-submit {
  padding: 0.875rem 1.5rem;
  border: none;
  border-radius: 8px;
  background: var(--blue-600);
  color: white;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition:
    background 0.2s ease,
    transform 0.15s ease;
}

.contact-form-submit:hover {
  background: var(--blue-700);
}

.contact-form-submit:active {
  transform: scale(0.98);
}

.contact-form-submit:disabled {
  background: var(--stone-300);
  cursor: not-allowed;
}

/* -- RESPONSIVE -- */
@media (max-width: 640px) {
  .contact-modal-panel {
    width: 100%;
    border-radius: 16px 16px 0 0;
    max-height: 85vh;
  }

  .contact-modal-title {
    font-size: 1.25rem;
  }

  .contact-form {
    padding: 1.5rem;
    gap: 1.25rem;
  }
}
