/*
 * posthorn-forms.css - styling for the embedded support forms.
 * Load once from index.html. Inherits docsify's theme variables where they
 * exist and falls back to sane values where they do not.
 */

.ph-form {
  max-width: 46rem;
  margin: 1.5rem 0 2.5rem;
}

.ph-form fieldset {
  border: 1px solid var(--ph-border, #e3e8ef);
  border-radius: 8px;
  padding: 1.25rem 1.25rem 0.5rem;
  margin: 0 0 1.25rem;
}

.ph-form legend {
  padding: 0 0.5rem;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--theme-color, #42b983);
}

.ph-row {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.ph-row > .ph-field {
  flex: 1 1 14rem;
  min-width: 0;
}

.ph-field {
  margin-bottom: 1rem;
}

.ph-field label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.ph-field .ph-req {
  color: #c92a2a;
  margin-left: 0.15rem;
}

.ph-field .ph-hint {
  display: block;
  font-weight: 400;
  font-size: 0.8rem;
  opacity: 0.7;
  margin-top: 0.15rem;
}

.ph-form input[type="text"],
.ph-form input[type="email"],
.ph-form input[type="tel"],
.ph-form input[type="file"],
.ph-form select,
.ph-form textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 0.55rem 0.65rem;
  font: inherit;
  font-size: 0.925rem;
  color: inherit;
  background: var(--ph-input-bg, #fff);
  border: 1px solid var(--ph-border, #cbd2dc);
  border-radius: 6px;
}

.ph-form textarea {
  min-height: 9rem;
  resize: vertical;
}

.ph-form input:focus,
.ph-form select:focus,
.ph-form textarea:focus {
  outline: 2px solid var(--theme-color, #42b983);
  outline-offset: 1px;
  border-color: transparent;
}

.ph-form [aria-invalid="true"] {
  border-color: #c92a2a;
}

.ph-field-error {
  display: block;
  margin-top: 0.3rem;
  font-size: 0.825rem;
  color: #c92a2a;
}

.ph-form button[type="submit"] {
  padding: 0.6rem 1.4rem;
  font: inherit;
  font-weight: 600;
  color: #fff;
  background: var(--theme-color, #42b983);
  border: 0;
  border-radius: 6px;
  cursor: pointer;
}

.ph-form button[type="submit"]:disabled {
  opacity: 0.6;
  cursor: progress;
}

.ph-status {
  margin: 1rem 0 0;
  padding: 0.7rem 0.9rem;
  border-radius: 6px;
  border-left: 4px solid;
  font-size: 0.9rem;
}

.ph-status--pending { border-color: #868e96; background: rgba(134, 142, 150, 0.1); }
.ph-status--ok      { border-color: #2b8a3e; background: rgba(43, 138, 62, 0.1); }
.ph-status--error   { border-color: #c92a2a; background: rgba(201, 42, 42, 0.1); }

/* The honeypot. Off-screen rather than display:none - some bots skip
   hidden fields, and this one only works if they fill it in. */
.ph-trap {
  position: absolute !important;
  left: -9999px !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

@media (prefers-color-scheme: dark) {
  .ph-form {
    --ph-border: #3a4350;
    --ph-input-bg: #1c2128;
  }
}
