/* ================================================================
   FORM — Shared contact-form styles (used on homepage + contact page)
   Lives in @layer layout so it doesn't conflict with subpage.css
================================================================ */

@layer layout {

  /* ── Form Wrapper ────────────────────────────────────────── */
  .form-wrap {
    max-width: 480px;
  }

  .form-title {
    font-family: var(--serif);
    font-size: 22px;
    font-weight: 300;
    color: var(--t-head);
    margin-bottom: 32px;
  }

  /* ── Field Layout ────────────────────────────────────────── */
  .field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;

    @media (max-width: 640px) { grid-template-columns: 1fr; }
  }

  .field {
    display: flex;
    flex-direction: column;
    gap: 7px;
    margin-bottom: 20px;

    & label {
      font-family: var(--mono);
      font-size: 8.5px;
      letter-spacing: .14em;
      text-transform: uppercase;
      color: var(--t-muted);
    }

    & input,
    & select {
      background: var(--card);
      border: 1px solid var(--line);
      border-radius: 10px;
      padding: 13px 16px;
      font-family: var(--sans);
      font-size: 14px;
      font-weight: 300;
      color: var(--t-head);
      outline: none;
      transition: border-color .2s, background .2s, box-shadow .2s;
      appearance: none;
      -webkit-appearance: none;
      width: 100%;
      min-height: 44px;

      &:focus {
        border-color: var(--line-g);
        background: var(--card-h);
        box-shadow: 0 0 0 3px rgba(138, 102, 32, .08);
      }

      &::placeholder {
        color: var(--t-muted);
      }

      &.error {
        border-color: rgba(180, 60, 40, .4);
      }
    }

    & select {
      cursor: pointer;
      background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none'%3E%3Cpath d='M2 4l4 4 4-4' stroke='%238A6620' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
      background-repeat: no-repeat;
      background-position: right 14px center;
      padding-right: 36px;

      & option {
        background: var(--bg);
        color: var(--t-head);
      }
    }
  }

  .req {
    color: var(--gold);
    margin-left: 2px;
  }

  .field-error {
    font-size: 11px;
    color: rgba(180, 60, 40, .8);
    font-family: var(--mono);
    letter-spacing: .04em;
    margin-top: -14px;
    margin-bottom: 6px;
  }

  /* ── Submit ──────────────────────────────────────────────── */
  .submit-row {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-top: 8px;
    flex-wrap: wrap;
  }

  .btn-submit {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 15px 36px;
    background: var(--gold);
    color: var(--bg);
    font-family: var(--sans);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: .09em;
    text-transform: uppercase;
    border-radius: 100px;
    border: none;
    cursor: pointer;
    transition: background .2s, transform .25s var(--ease), box-shadow .25s;

    &:hover {
      background: var(--gold-mid);
      transform: translateY(-2px);
      box-shadow: 0 12px 36px rgba(138, 102, 32, .22);
    }

    &:disabled {
      opacity: .6;
      cursor: not-allowed;
      transform: none;
      box-shadow: none;
    }

    & svg {
      width: 13px;
      height: 13px;
      stroke: currentColor;
      fill: none;
      stroke-width: 1.8;
      stroke-linecap: round;
      stroke-linejoin: round;
    }
  }

  .submit-note {
    font-size: 11.5px;
    color: var(--t-muted);
    line-height: 1.6;
    font-family: var(--mono);
    letter-spacing: .04em;
  }

  /* ── Thank You State ─────────────────────────────────────── */
  #thankYou {
    display: none;
    max-width: 480px;

    &.show {
      display: flex;
      flex-direction: column;
    }
  }

  .ty-icon {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: rgba(138, 102, 32, .08);
    border: 1px solid var(--line-g);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 28px;

    & svg {
      width: 22px;
      height: 22px;
      stroke: var(--gold);
      fill: none;
      stroke-width: 1.5;
      stroke-linecap: round;
      stroke-linejoin: round;
    }
  }

  .ty-h {
    font-family: var(--serif);
    font-size: clamp(28px, 3vw, 42px);
    font-weight: 300;
    color: var(--t-head);
    line-height: 1.08;
    margin-bottom: 16px;

    & em {
      font-style: italic;
      color: var(--gold);
    }
  }

  .ty-p {
    font-size: 14.5px;
    color: var(--t-body);
    line-height: 1.88;
    margin-bottom: 12px;

    & strong {
      color: var(--t-head);
      font-weight: 400;
    }
  }

  .ty-rule {
    height: 1px;
    background: var(--line);
    margin: 28px 0;
  }

  .ty-next-label {
    font-family: var(--mono);
    font-size: 8.5px;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--t-muted);
    margin-bottom: 16px;
  }

  .ty-links {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
  }

  .ty-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 22px;
    border-radius: 100px;
    font-size: 11.5px;
    font-weight: 500;
    letter-spacing: .08em;
    text-transform: uppercase;
    border: 1px solid var(--line-g);
    color: var(--gold);
    transition: background .2s, transform .2s var(--ease);

    &:hover {
      background: rgba(138, 102, 32, .07);
      transform: translateY(-1px);
    }
  }

  /* ── Responsive (contact page: full-width form) ──────────── */
  @media (max-width: 1024px) {
    .form-wrap,
    #thankYou {
      max-width: 100%;
    }
  }
}
