/* ============================================================
   PASSPORT GATEWAY — Contact Form Modal
   ============================================================ */

/* Overlay — covers the full viewport */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 15, 34, 0.82);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-5) var(--gutter);
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
}

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

/* Panel — same navy-deep + vesica piscis as the rest of the site */
.modal-panel {
  background-color: var(--color-navy-deep);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='140' height='140' viewBox='0 0 140 140'><g fill='none' stroke='%23C9A24A' stroke-width='1.5' opacity='0.7'><circle cx='0' cy='70' r='70'/><circle cx='70' cy='0' r='70'/><circle cx='140' cy='70' r='70'/><circle cx='70' cy='140' r='70'/><circle cx='70' cy='70' r='70'/></g></svg>");
  background-size: 140px 140px;
  background-position: top left;
  background-attachment: fixed;
  background-blend-mode: soft-light;
  border: 1px solid var(--color-border-gold);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 540px;
  max-height: 90dvh;
  overflow-y: auto;
  padding: var(--space-6);
  position: relative;
  transform: translateY(12px);
  transition: transform 0.22s ease;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6);
}

.modal-overlay.is-open .modal-panel {
  transform: translateY(0);
}

/* Close button — gold-framed, top-right corner */
.modal-close {
  position: absolute;
  top: var(--space-4);
  right: var(--space-4);
  background: rgba(201, 162, 74, 0.06);
  border: 1.5px solid rgba(201, 162, 74, 0.5);
  color: var(--color-gold);
  cursor: pointer;
  padding: var(--space-2);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
  z-index: 2;
}

.modal-close:hover {
  color: var(--color-gold-soft);
  background: rgba(201, 162, 74, 0.14);
  border-color: var(--color-gold);
}

.modal-close:focus-visible {
  outline: 2px solid var(--color-gold);
  outline-offset: 2px;
}

/* Modal header — flex row: text on left, logo on right */
.modal-header {
  display: flex;
  align-items: flex-start;
  gap: var(--space-4);
  margin-bottom: var(--space-5);
  padding-right: 2.2rem;
}

.modal-header-text {
  flex: 1 1 auto;
  min-width: 0;
  padding-top: var(--space-1);
}

/* Logo — background-image approach guarantees SVG never exceeds the box size */
.modal-logo {
  flex-shrink: 0;
  width: 110px;
  height: 110px;
  background-image: url("../assets/passport-gateway-gold.svg");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center top;
  opacity: 0.82;
  pointer-events: none;
}

.modal-title {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  color: var(--color-cream);
  margin-bottom: var(--space-2);
}

.modal-subtitle {
  font-size: var(--text-sm);
  color: var(--color-text-dim);
  line-height: 1.55;
}

/* Form layout */
.contact-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.form-label {
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-gold);
}

.form-label .required {
  color: rgba(201, 162, 74, 0.55);
  margin-left: 0.2em;
}

/* Input, select, textarea — unified dark-surface style */
.form-input,
.form-select,
.form-textarea {
  background: var(--color-surface-input);
  border: 1px solid var(--color-border-gold);
  border-radius: var(--radius-md);
  color: var(--color-cream);
  padding: 0.7rem var(--space-4);
  font-size: var(--text-base);
  width: 100%;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--color-border-gold-focus);
  background: rgba(247, 244, 236, 0.07);
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--color-text-dim);
}

/* Custom select arrow — gold chevron */
.form-select {
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23C9A24A' 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 0.75rem center;
  background-size: 1rem;
  padding-right: 2.5rem;
}

.form-select option {
  background: var(--color-navy-deep);
  color: var(--color-cream);
}

.form-textarea {
  resize: vertical;
  min-height: 110px;
}

/* Inline validation error */
.form-error {
  font-size: var(--text-xs);
  color: var(--color-error);
  min-height: 1.1em;
}

/* Submit button — full width inside modal */
.form-submit {
  width: 100%;
  justify-content: center;
  padding: 0.9rem var(--space-5);
  margin-top: var(--space-2);
  border: none;
  cursor: pointer;
}

/* Success state — replaces form after submission */
.modal-success {
  display: none;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--space-5);
  padding: var(--space-6) 0;
}

.modal-success.is-visible {
  display: flex;
}

.success-icon {
  width: 64px;
  height: 64px;
  background: rgba(201, 162, 74, 0.1);
  border: 1.5px solid rgba(201, 162, 74, 0.3);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-gold);
}

.success-title {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  color: var(--color-cream);
}

.success-body {
  font-size: var(--text-base);
  color: rgba(247, 244, 236, 0.6);
  max-width: 340px;
  line-height: 1.6;
}

/* Responsive: collapse two-column rows on narrow screens */
@media (max-width: 540px) {
  .form-row { grid-template-columns: 1fr; }
  .modal-panel { padding: var(--space-5) var(--space-4); }
}
