/* ==========================================================
   Contact page (contact.html)
   Mobile first: memo on top, badge underneath.
   900px+: badge on the left, memo on the right.
   Shared header, tokens and utilities live in base.css.
   ========================================================== */

body {
  background-color: #7d6a4a;
  /* faint diagonal texture, like a desk surface */
  background-image: repeating-linear-gradient(45deg, rgba(0, 0, 0, 0.05) 0 2px, transparent 2px 8px);
  background-size: auto;
}

/* ---------- Layout ---------- */
.contact {
  display: flex;
  flex-direction: column;
  gap: 40px;
  max-width: 1120px;
  margin: 0 auto;
  padding: 32px 16px 64px;
}

.memo {
  order: 1;
}
.badge-wrap {
  order: 2;
}

/* ==========================================================
   THE MEMO (manila envelope)
   ========================================================== */
.memo {
  position: relative;
  background-color: #dcc38f;
  border-radius: 4px;
  padding: 28px 22px;
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* the string-tie circle on the envelope */
.memo-hole {
  position: absolute;
  top: 18px;
  right: 20px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 3px solid #8a7752;
}

.memo-title {
  font-family: var(--font-display);
  font-size: 26px;
  letter-spacing: 3px;
  text-transform: uppercase;
  padding-right: 48px; /* keeps the title clear of the circle */
}

.memo-intro {
  font-size: 15px;
  color: var(--color-slot);
  margin: 8px 0 12px;
  line-height: 1.5;
}

/* One labeled line: label on the left, input on the right */
.memo-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  border-bottom: 1.5px solid #8a7752;
}

.memo-label {
  flex: 0 0 82px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--color-slot);
}

.memo-fixed,
.memo-row input,
.memo-row select {
  flex: 1;
  min-width: 0;
  font-family: var(--font-display);
  font-size: 17px;
  color: var(--color-blue);
}

.memo-row input,
.memo-row select {
  border: 0;
  background: transparent;
  min-height: 44px;
}

.memo-row input::placeholder {
  color: var(--color-ink-faded);
}

.memo-message {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 16px;
}

.memo-message textarea {
  font-family: var(--font-display);
  font-size: 17px;
  line-height: 28px;
  color: var(--color-blue);
  background-color: var(--color-manila);
  border: 1.5px solid #8a7752;
  padding: 10px 12px;
  resize: vertical;
}

.memo-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
}

.memo-note {
  font-size: 14px;
  color: var(--color-slot);
}

/* Visible keyboard focus on every field */
.memo input:focus,
.memo select:focus,
.memo textarea:focus,
.badge input:focus {
  outline: 3px solid var(--color-blue);
  outline-offset: 2px;
}

/* ==========================================================
   THE BADGE (sign-in)
   ========================================================== */
.badge-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.lanyard {
  width: 16px;
  height: 60px;
  background-color: var(--color-blue);
  border-radius: 3px;
}

.clip {
  width: 54px;
  height: 22px;
  margin-top: -6px;
  border: 4px solid #c0c4cc;
  border-radius: 8px;
}

.badge {
  width: 100%;
  max-width: 360px;
  background-color: white;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.35);
}

.badge-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 22px;
  background-color: var(--color-blue);
  color: white;
}

.badge-title {
  font-family: var(--font-display);
  font-size: 22px;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.badge-tag {
  font-size: 12px;
  letter-spacing: 3px;
  text-transform: uppercase;
}

.badge-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 22px;
}

.badge-intro {
  display: flex;
  align-items: center;
  gap: 16px;
}

.photo {
  flex: 0 0 64px;
  height: 80px;
  background-color: #e5e7eb;
  border: 2px dashed #9aa3b2;
  border-radius: 8px;
}

.badge-intro h2 {
  font-size: 22px;
}

.badge-intro p {
  font-size: 14px;
  color: #4b5563;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.field input {
  font-family: var(--font-body);
  font-size: 16px;
  min-height: 46px;
  padding: 10px 12px;
  border: 2px solid #9aa3b2;
  border-radius: 8px;
}

/* striped barcode, drawn with a gradient */
.barcode {
  height: 36px;
  background: repeating-linear-gradient(
    90deg,
    var(--color-ink) 0 2px,
    transparent 2px 5px,
    var(--color-ink) 5px 9px,
    transparent 9px 11px
  );
}

/* ---------- Buttons ---------- */
.btn {
  min-height: 50px;
  padding: 0 28px;
  border: 0;
  border-radius: 6px;
  color: white;
  font-family: var(--font-display);
  font-size: 18px;
  letter-spacing: 3px;
  text-transform: uppercase;
  cursor: pointer;
}

.btn-red {
  background-color: var(--color-red);
}
.btn-blue {
  background-color: var(--color-blue);
}

.btn-red:hover {
  background-color: var(--color-red-dark);
}
.btn-blue:hover {
  background-color: var(--color-blue-dark);
}

.btn:focus-visible {
  outline: 3px solid var(--color-amber);
  outline-offset: 3px;
}

/* ==========================================================
   DESKTOP (900px+)
   ========================================================== */
@media (min-width: 900px) {
  .contact {
    flex-direction: row;
    align-items: flex-start;
    justify-content: center;
    padding-top: 48px;
  }

  .badge-wrap {
    order: 1;
    flex: 0 0 360px;
  }

  .memo {
    order: 2;
    flex: 1 1 560px;
    max-width: 640px;
    margin-top: 40px;
    padding: 32px;
  }

  .memo-title {
    font-size: 30px;
  }
}

/* ==========================================================
   FORM CHECKS, STATUS, AND DELIVERED STAMP
   ========================================================== */
.error {
  min-height: 0;
  font-size: 13px;
  font-weight: 700;
  color: #9f1d14;
}

.error:empty {
  display: none;
}

.memo [aria-invalid='true'] {
  outline: 2px solid #9f1d14;
  outline-offset: 2px;
}

/* Spam trap: kept off screen so only bots fill it in */
.trap {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form-status {
  font-size: 14px;
  font-weight: 700;
  color: var(--color-slot);
}

.form-status:empty {
  display: none;
}

.btn:disabled {
  opacity: 0.7;
  cursor: wait;
}

.delivered {
  order: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 48px 24px;
  text-align: center;
  background-color: #dcc38f;
  border-radius: 4px;
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.35);
}

.delivered-stamp {
  font-family: var(--font-display);
  font-size: 34px;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--color-green);
  border: 4px double var(--color-green);
  border-radius: 6px;
  padding: 8px 20px;
  transform: rotate(-6deg);
}

/* ---------- Badge contact details ---------- */
.badge-info {
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 14px;
}

.badge-info dt {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #4b5563;
}

.badge-info dd {
  margin: 2px 0 0;
  overflow-wrap: anywhere;
}

.btn-link {
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.btn-link:hover {
  color: white;
}

@media (min-width: 900px) {
  .delivered {
    order: 2;
    flex: 1 1 560px;
    max-width: 640px;
    margin-top: 40px;
  }
}

/* The message label sits above its box, so it shouldn't stretch */
.memo-message .memo-label {
  flex: none;
}
