/* /creators/: one short form, replacing the mailto behind "For creators". Tokens are styles.css's;
   the field look is the review page's (assets/review.css), kept as its own small file. */

.cr {
  padding-block: clamp(2rem, 6vw, 4.5rem) clamp(3.5rem, 9vw, 6.5rem);
}

.cr__in {
  max-width: 40rem;
}

.cr h1 {
  font-size: clamp(2.25rem, 1.5rem + 3.6vw, 4rem);
  font-variation-settings: "wdth" 122;
  font-weight: 800;
}

.cr__sub {
  margin-top: 1rem;
  font-size: var(--t-body);
  line-height: 1.5;
  color: var(--ink-muted);
}

.cr__form {
  margin-top: clamp(1.75rem, 5vw, 2.75rem);
}

.cr-fields {
  display: grid;
  gap: 1.25rem;
}

.cr-fields[hidden] {
  display: none;
}

.cr-field {
  display: grid;
  gap: 0.45rem;
  min-width: 0;
}

.cr-label {
  font-size: 1.0625rem;
  font-weight: 650;
  font-variation-settings: "wdth" 106;
  line-height: 1.3;
  color: var(--ink);
}

.cr-opt {
  margin-left: 0.5rem;
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 500;
  font-variation-settings: "wdth" 85;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.cr-input {
  width: 100%;
  min-width: 0;
  padding: 0.8rem 1rem;
  border-radius: var(--r-control);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  caret-color: var(--accent);
  font: inherit;
  /* 16px or more, or iOS zooms the page when the field takes the focus */
  font-size: 1.0625rem;
  line-height: 1.4;
  transition: border-color 0.2s var(--ease);
}

.cr-input::placeholder {
  color: var(--ink-faint);
  opacity: 1;
}

.cr-input:hover {
  border-color: var(--accent-dim);
}

.cr-input:focus {
  border-color: var(--accent);
}

/* A field the check refused. Brighter, never red: the sentence under it says why. */
.cr-input[aria-invalid="true"] {
  border-color: var(--ink);
}

/* Tick boxes: a fieldset of wrapping chips. The real checkbox stays in the page (focusable, read out
   by screen readers) and is drawn as the chip's own box. */
.cr-group {
  margin: 0;
  padding: 0;
  border: 0;
}

.cr-group > .cr-label {
  padding: 0;
  margin-bottom: 0.45rem;
}

.cr-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.cr-chip {
  position: relative;
  display: inline-flex;
  cursor: pointer;
}

.cr-chip input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.cr-chip span {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 2.75rem;
  padding: 0.5rem 1rem 0.5rem 0.75rem;
  border-radius: var(--r-control);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font-size: 1.0625rem;
  line-height: 1.2;
  transition: border-color 0.2s var(--ease), background-color 0.2s var(--ease);
}

.cr-chip span::before {
  content: "";
  flex: none;
  width: 1.05rem;
  height: 1.05rem;
  border-radius: 0.3rem;
  border: 1.5px solid var(--ink-faint);
  background-position: center;
  background-repeat: no-repeat;
  background-size: 0.75rem;
}

.cr-chip:hover span {
  border-color: var(--accent-dim);
}

.cr-chip input:checked + span {
  border-color: var(--accent);
}

.cr-chip input:checked + span::before {
  border-color: var(--accent);
  background-color: var(--accent);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23fff' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3.5 8.5l3 3 6-7'/%3E%3C/svg%3E");
}

.cr-chip input:focus-visible + span {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* A group the check refused: brighter chips' edges, never red. */
.cr-group[aria-invalid="true"] .cr-chip span {
  border-color: var(--ink);
}

.cr-more {
  display: block;
  min-height: 7rem;
  resize: vertical;
}

.cr-error {
  font-size: 0.9375rem;
  line-height: 1.4;
  color: var(--ink);
}

.cr-error:empty {
  display: none;
}

.cr-trap {
  position: absolute;
  left: -200vw;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.cr-send {
  display: grid;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.cr-send__btn {
  width: 100%;
  min-height: 3.5rem;
}

@media (min-width: 36rem) {
  .cr-send__btn {
    width: auto;
    justify-self: start;
    min-width: 13rem;
  }
}

.cr-send__btn[aria-busy="true"] {
  pointer-events: none;
  background: var(--accent-dim);
  transform: none;
}

.cr-status {
  font-size: 1.0625rem;
  color: var(--ink);
}

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

.cr-done {
  font-size: clamp(1.25rem, 1.1rem + 0.8vw, 1.625rem);
  line-height: 1.4;
  color: var(--ink);
}

.cr-done[hidden] {
  display: none;
}

.cr-done:focus {
  outline: none;
}

/* Where you're from: the review form's native select with the flag inside it at the left
   (assets/review-country.js drives it through its data-rv attributes). */
.cr-country {
  position: relative;
}

.cr-country__pick {
  appearance: none;
  padding-left: calc(1rem + 20px + 0.7rem);
  padding-right: 2.6rem;
  cursor: pointer;
  text-overflow: ellipsis;
}

.cr-country__pick option {
  background: var(--surface);
  color: var(--ink);
}

.cr-country::after {
  content: "";
  position: absolute;
  right: 1.15rem;
  top: 50%;
  width: 0.45rem;
  height: 0.45rem;
  border-right: 1.5px solid var(--ink-faint);
  border-bottom: 1.5px solid var(--ink-faint);
  translate: 0 -70%;
  rotate: 45deg;
  pointer-events: none;
}

.cr-flag {
  position: absolute;
  left: 1rem;
  top: 50%;
  translate: 0 -50%;
  width: 20px;
  height: 15px;
  border-radius: 2px;
  pointer-events: none;
}

.cr-flag img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
}

.cr-flag img[hidden] {
  display: none;
}

.cr-flag::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--ink) 22%, transparent);
}

/* One pick of chips (your audience): the same chips, round, with a dot where the tick goes. */
.cr-chip--one span::before {
  border-radius: 50%;
}

.cr-chip--one input:checked + span::before {
  background-image: radial-gradient(circle, #fff 0 28%, transparent 32%);
  background-size: auto;
}
