/* ============================================================
   Form component — BEM, mobile-first, design tokens from styles.css
   ============================================================ */

.form {
  max-width: 720px;
  margin: 0 auto;
  display: grid;
  gap: 18px;
}

/* `display: grid` above would override the UA [hidden] rule on tied
   specificity (author beats UA). Re-assert hide for the form. */
.form[hidden] {
  display: none;
}

.form__row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}

@media (min-width: 700px) {
  .form__row {
    grid-template-columns: 1fr 1fr;
  }
}

.form__field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form__label {
  font-size: 13px;
  font-weight: 700;
  color: var(--dk);
  letter-spacing: 0.2px;
}

.form__input,
.form__select,
.form__textarea {
  width: 100%;
  font-family: inherit;
  font-size: 15px;
  color: var(--dk);
  background: var(--w);
  border: 1.5px solid var(--g3);
  border-radius: 10px;
  padding: 12px 14px;
  line-height: 1.4;
  transition: border-color .2s, box-shadow .2s, background-color .2s;
  -webkit-appearance: none;
  appearance: none;
}

.form__textarea {
  resize: vertical;
  min-height: 140px;
  font-family: inherit;
}

.form__select {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'><path fill='%23555' d='M6 8 0 0h12z'/></svg>");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 10px 7px;
  padding-right: 38px;
  cursor: pointer;
}

.form__input:hover,
.form__select:hover,
.form__textarea:hover {
  border-color: var(--g5);
}

.form__input:focus,
.form__select:focus,
.form__textarea:focus {
  outline: none;
  border-color: var(--t);
  box-shadow: 0 0 0 3px rgba(0, 180, 160, .18);
}

.form__input[aria-invalid="true"],
.form__select[aria-invalid="true"],
.form__textarea[aria-invalid="true"] {
  border-color: #D93D3D;
  background-color: #FEF6F6;
}

.form__input[aria-invalid="true"]:focus,
.form__select[aria-invalid="true"]:focus,
.form__textarea[aria-invalid="true"]:focus {
  box-shadow: 0 0 0 3px rgba(217, 61, 61, .18);
}

.form__error {
  font-size: 13px;
  color: #B72727;
  font-weight: 600;
  margin: 0;
  line-height: 1.4;
}

.form__hint {
  font-size: 13px;
  color: var(--g7);
  margin: 0;
  line-height: 1.4;
}

.form__warning {
  color: #8A5A00;
  background: #FFF6E0;
  border-left: 3px solid #F5A623;
  padding: 6px 10px;
  border-radius: 6px;
}

.form__char-counter {
  font-size: 12px;
  color: var(--g5);
  text-align: right;
  margin: 0;
  font-variant-numeric: tabular-nums;
}

.form__char-counter--warn {
  color: #8A5A00;
}

.form__char-counter--over {
  color: #B72727;
  font-weight: 700;
}

/* Honeypot — visually hidden but kept in DOM */
.form__honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form__field--consent {
  margin-top: 4px;
}

.form__consent {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14px;
  color: var(--g7);
  line-height: 1.5;
  cursor: pointer;
}

.form__consent input[type="checkbox"] {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--t);
  cursor: pointer;
}

.form__consent a {
  color: var(--t);
  font-weight: 600;
  text-decoration: underline;
}

.form__submit {
  justify-self: start;
  margin-top: 8px;
  min-width: 200px;
  justify-content: center;
  position: relative;
}

.form__submit:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
  box-shadow: 0 4px 20px rgba(0, 180, 160, .15);
}

.form__spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, .35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: form-spin .7s linear infinite;
  margin-left: 4px;
}

.form__spinner[hidden] {
  display: none;
}

@keyframes form-spin {
  to { transform: rotate(360deg); }
}

.form__status {
  font-size: 14px;
  color: var(--g7);
  margin: 0;
  min-height: 1.4em;
}

.form__status--error {
  color: #B72727;
  background: #FEF6F6;
  border-left: 3px solid #D93D3D;
  padding: 10px 14px;
  border-radius: 6px;
  font-weight: 600;
}

.form__success {
  max-width: 720px;
  margin: 0 auto;
  text-align: center;
  background: var(--tl);
  border: 1.5px solid var(--t);
  border-radius: var(--r);
  padding: 40px 28px;
}

.form__success h3 {
  font-size: 22px;
  font-weight: 800;
  color: var(--dk);
  margin: 0 0 10px;
  outline: none;
}

.form__success p {
  font-size: 15px;
  color: var(--g7);
  margin: 0 0 22px;
  line-height: 1.6;
}

/* Privacy notice placeholder */
.privacy-placeholder {
  max-width: 720px;
  margin: 0 auto;
  padding: 32px;
  border: 1.5px dashed var(--g3);
  border-radius: var(--r);
  background: var(--g1);
  text-align: center;
}

.privacy-placeholder h2 {
  font-size: 18px;
  font-weight: 700;
  color: var(--dk);
  margin: 0 0 12px;
}

.privacy-placeholder p {
  font-size: 14px;
  color: var(--g7);
  line-height: 1.7;
  margin: 0 0 10px;
}
