/* ============================================================
   MODAL.CSS — Contact modal styles
   ============================================================ */

.contact-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
  overflow-y: auto;
}

.contact-modal[hidden] { display: none; }

.contact-modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.contact-modal__box {
  position: relative;
  width: 100%;
  max-width: 760px;
  background: var(--surface-raised);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-lg);
  padding: var(--space-5) var(--space-6);
  z-index: 1;
  margin: auto;
}

.contact-modal__close {
  position: absolute;
  top: var(--space-4);
  right: var(--space-4);
  width: 32px;
  height: 32px;
  border-radius: var(--radius);
  border: none;
  background: var(--surface);
  color: var(--text-3);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color var(--transition), background var(--transition);
}
.contact-modal__close:hover { background: var(--border); color: var(--text); }

.contact-modal__title {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 2px;
}

.contact-modal__sub {
  font-size: 12px;
  color: var(--text-3);
  margin-bottom: var(--space-3);
}

/* ── Form fields ── */
.contact-modal__form { display: flex; flex-direction: column; gap: var(--space-2); }

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2);
}

@media (max-width: 600px) {
  .contact-modal { padding: var(--space-2); align-items: flex-start; }
  .contact-modal__box { padding: var(--space-4) var(--space-3); border-radius: var(--radius-md); }
  .form-row { grid-template-columns: 1fr; }
}

.form-field { display: flex; flex-direction: column; gap: 4px; }

.form-field label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.form-field input,
.form-field select,
.form-field textarea {
  background: var(--bg-2);
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  padding: 7px 10px;
  font-size: 13px;
  color: var(--text);
  font-family: inherit;
  width: 100%;
  box-sizing: border-box;
  transition: border-color var(--transition);
  resize: vertical;
}

.form-field select {
  appearance: none;
  -webkit-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'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
  cursor: pointer;
}

.form-field select option { background: var(--bg-2); }

.form-field input::placeholder,
.form-field textarea::placeholder { color: var(--text-3); }

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px hsla(210, 78%, 48%, 0.15);
}

/* ── Validation ── */
.form-field__error { font-size: 12px; color: hsl(0, 70%, 65%); }
.form-field__error[hidden] { display: none; }

.form-field--error input,
.form-field--error select,
.form-field--error textarea {
  border-color: hsl(0, 70%, 60%);
  box-shadow: 0 0 0 3px hsla(0, 70%, 60%, 0.12);
}

/* ── Submit ── */
.contact-modal__submit { width: 100%; justify-content: center; margin-top: var(--space-1); }
.contact-modal__submit:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

/* ── Success / error states ── */
.contact-modal__success,
.contact-modal__error { text-align: center; padding: var(--space-6) 0; }

.contact-modal__success[hidden],
.contact-modal__error[hidden] { display: none; }

.contact-modal__success-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: hsla(142, 65%, 44%, 0.15);
  color: var(--green);
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--space-4);
}

.contact-modal__success h4 { font-size: 18px; margin-bottom: var(--space-2); }
.contact-modal__success p  { font-size: 14px; color: var(--text-2); line-height: 1.6; }

.contact-modal__error p {
  font-size: 14px;
  color: hsl(0, 70%, 65%);
  line-height: 1.6;
}
