:root {
  --contact-ink: #263c31;
  --contact-paper: #fbfcf8;
  --contact-moss: #3a5a40;
  --contact-line: #cbd7c7;
  --contact-rust: #a95836;
}

.contact-shell {
  flex: 1 0 auto;
  padding: clamp(1.75rem, 4vw, 3.5rem) 1rem;
  background:
    linear-gradient(90deg, rgba(58, 90, 64, 0.035) 1px, transparent 1px),
    var(--contact-paper);
  background-size: 36px 36px;
}

.contact-form-panel {
  position: relative;
  box-sizing: border-box;
  width: min(680px, 100%);
  margin: 0 auto;
  overflow: hidden;
  padding: clamp(1.35rem, 4vw, 2.25rem);
  border: 1px solid var(--contact-line);
  border-radius: 2px 18px 18px 18px;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 18px 45px rgba(38, 60, 49, 0.1);
}

.contact-form-panel::before {
  position: absolute;
  inset: 0 auto auto 0;
  width: 5rem;
  height: 4px;
  background: var(--contact-rust);
  content: "";
}

.contact-form-heading {
  margin-bottom: 1.5rem;
}

.contact-form-heading h1 {
  margin: 0;
  color: var(--contact-ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.15rem, 6vw, 3.2rem);
  font-weight: 400;
  letter-spacing: -0.04em;
  line-height: 1;
}

.contact-form-heading p {
  margin: 0.6rem 0 0;
  color: #596b61;
  line-height: 1.55;
}

.contact-field {
  margin: 0 0 1.15rem;
  padding: 0;
  border: 0;
}

.contact-field label,
.contact-field legend {
  display: block;
  margin: 0 0 0.42rem;
  color: var(--contact-ink);
  font-size: 0.88rem;
  font-weight: 800;
}

.contact-field legend span {
  color: #6a776f;
  font-weight: 500;
}

.contact-field .form-control {
  min-height: 44px;
  border-color: #bfcbbd;
  border-radius: 7px;
  background: #fdfefc;
  color: var(--contact-ink);
}

.contact-field textarea.form-control {
  min-height: 9.5rem;
  resize: vertical;
  line-height: 1.55;
}

.contact-field .form-control:focus {
  border-color: var(--contact-moss);
  box-shadow: 0 0 0 0.2rem rgba(58, 90, 64, 0.14);
}

.contact-label-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: baseline;
}

.contact-label-row > span,
.contact-field-note {
  color: #718078;
  font-size: 0.78rem;
}

.contact-field-note {
  margin: 0.38rem 0 0;
  line-height: 1.45;
}

.contact-drop-zone {
  display: flex !important;
  min-height: 3.75rem;
  margin: 0 !important;
  padding: 0.8rem 1rem;
  align-items: center;
  border: 1px dashed #9caf9a;
  border-radius: 8px;
  background: #f4f7f1;
  cursor: pointer;
  transition: border-color 150ms ease, background-color 150ms ease;
}

.contact-drop-zone:hover,
.contact-drop-zone.is-dragging {
  border-color: var(--contact-moss);
  background: #eaf0e6;
}

.contact-drop-zone:focus-within {
  outline: 3px solid rgba(58, 90, 64, 0.22);
  outline-offset: 2px;
}

.contact-drop-zone input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.contact-drop-copy {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.65rem;
  align-items: baseline;
  color: var(--contact-ink);
}

.contact-drop-copy strong {
  font-size: 0.88rem;
}

.contact-drop-copy small {
  color: #6a776f;
  font-weight: 500;
}

.contact-file-preview {
  display: grid;
  grid-template-columns: 4rem minmax(0, 1fr) auto;
  gap: 0.8rem;
  margin-top: 0.7rem;
  padding: 0.7rem;
  align-items: center;
  border: 1px solid var(--contact-line);
  border-radius: 8px;
  background: #fff;
}

.contact-file-preview[hidden],
.contact-file-error[hidden],
.contact-status[hidden] {
  display: none;
}

.contact-file-preview img {
  width: 4rem;
  height: 3.25rem;
  border-radius: 5px;
  object-fit: cover;
}

.contact-file-preview strong,
.contact-file-preview span,
.contact-file-preview small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.contact-file-preview strong {
  color: var(--contact-ink);
  font-size: 0.88rem;
}

.contact-file-preview span,
.contact-file-preview small {
  color: #6a776f;
  font-size: 0.76rem;
}

.contact-file-preview small {
  margin-top: 0.12rem;
  color: var(--contact-moss);
}

.contact-file-error {
  margin: 0.55rem 0 0;
  color: #9b2c2c;
  font-size: 0.84rem;
}

.contact-security-note {
  margin: -0.1rem 0 1rem;
  padding-left: 0.75rem;
  border-left: 3px solid var(--contact-line);
  color: #68776e;
  font-size: 0.8rem;
  line-height: 1.5;
}

.contact-status {
  margin: 0 0 1rem;
  padding: 0.75rem 0.85rem;
  border-radius: 7px;
  font-size: 0.88rem;
}

.contact-status.is-success {
  border: 1px solid #b9d0b5;
  background: #e8f2e6;
  color: #24482a;
}

.contact-status.is-error {
  border: 1px solid #e1b8b2;
  background: #f9e9e7;
  color: #792e26;
}

.contact-submit {
  min-width: 10rem;
  min-height: 44px;
  border-radius: 8px;
  font-weight: 800;
}

.contact-submit:disabled {
  cursor: wait;
}

@media (max-width: 575.98px) {
  .contact-shell {
    padding: 1rem 0.6rem 2rem;
  }

  .contact-form-panel {
    padding: 1.25rem 1rem 1.4rem;
    border-radius: 2px 14px 14px 14px;
  }

  .contact-file-preview {
    grid-template-columns: 3.5rem minmax(0, 1fr);
  }

  .contact-file-preview img {
    width: 3.5rem;
    height: 3.5rem;
  }

  .contact-file-preview .btn {
    grid-column: 1 / -1;
  }

  .contact-submit {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .contact-drop-zone {
    transition: none;
  }
}
