/* Fixboard forms: fields, inputs, radio cards and segmented choices, the
   privacy checkbox, the screenshot picker and the upload progress bar.
   Inputs are 16px so iPhones never zoom into them. Radio cards and the
   drop zone take their edge from --border-strong (3:1, tokens.css). */

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; margin: 0; padding: 0; border: 0; }
.field__label { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; font-weight: 650; font-size: 0.9375rem; color: var(--text); padding: 0; }
.field__optional { font-weight: 500; font-size: 0.8125rem; color: var(--text-3); }
.field__hint { font-size: 0.875rem; color: var(--text-3); margin-top: -2px; }
.field__error { display: flex; align-items: flex-start; gap: 6px; color: var(--danger); font-size: 0.875rem; font-weight: 600; }
.field__error .icon { flex-shrink: 0; margin-top: 2px; }

.input, .select {
  width: 100%; min-height: 48px; padding: 11px 14px;
  border: 1px solid var(--input-border); border-radius: 10px;
  background: var(--surface); color: var(--text);
  font-size: 1rem; line-height: 1.45;
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
.input::placeholder { color: var(--text-3); opacity: 1; }
@media (hover: hover) { .input:hover, .select:hover { border-color: var(--text-3); } }
.input:focus, .select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(30, 78, 216, 0.25); }
.input--area { min-height: 96px; resize: vertical; }
.input--sm { min-height: 44px; padding: 9px 12px; }
.field.is-invalid .input, .field.is-invalid .select { border-color: var(--danger); }
.field.is-invalid .input:focus { box-shadow: 0 0 0 3px rgba(180, 35, 24, 0.22); }
input[type="search"]::-webkit-search-cancel-button { cursor: pointer; }

.select-wrap { position: relative; min-width: 0; }
.select { appearance: none; -webkit-appearance: none; padding-right: 40px; cursor: pointer; }
.select-wrap__icon { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); pointer-events: none; color: var(--text-3); }

/* ------------------------------------------------------------ choices */

.choices { display: grid; gap: 10px; }
.choices--cards { grid-template-columns: 1fr; }
.choices--segmented { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
@media (min-width: 560px) { .choices--cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 900px) { .choices--segmented { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); } }

.choice { position: relative; display: block; cursor: pointer; min-width: 0; }
.choice__input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.choice__body {
  position: relative; display: flex; flex-direction: column; justify-content: center; gap: 2px;
  min-height: 48px; height: 100%; padding: 12px 40px 12px 14px;
  border: 1px solid var(--border-strong); border-radius: 12px; background: var(--surface);
  transition: border-color 0.15s var(--ease), background-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
.choice--segmented .choice__body { min-height: 48px; padding: 10px 34px 10px 12px; }
.choice__title { font-weight: 650; color: var(--text); line-height: 1.3; }
.choice--segmented .choice__title { font-size: 0.9375rem; }
.choice__hint { font-size: 0.875rem; color: var(--text-3); line-height: 1.35; }
/* The ring on the right reads as "pick one"; picked, it fills with a check. */
.choice__check {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 50%;
  border: 2px solid var(--input-border); background: var(--surface); color: transparent;
  transition: background-color 0.15s var(--ease), border-color 0.15s var(--ease), color 0.15s var(--ease);
}
.choice--segmented .choice__check { right: 8px; width: 20px; height: 20px; }
.choice__check .icon { stroke-width: 3; width: 14px; height: 14px; }
@media (hover: hover) { .choice:hover .choice__body { border-color: var(--input-border); } }
.choice__input:checked + .choice__body {
  border-color: var(--brand); background: var(--brand-wash);
  box-shadow: inset 0 0 0 1px var(--brand);
}
.choice__input:checked + .choice__body .choice__check { border-color: var(--brand); background: var(--brand); color: #FFFFFF; }
.choice__input:checked + .choice__body .choice__title { color: var(--brand-ink); }
.choice__input:checked + .choice__body .choice__hint { color: var(--text-2); }
.choice__input:focus-visible + .choice__body { outline: 3px solid var(--focus); outline-offset: 2px; }
.choice-group.is-invalid .choice__body { border-color: var(--danger); }
.choice-group > .field__label { margin-bottom: 4px; }

/* ------------------------------------------------------------ checkbox */

.check { display: flex; align-items: flex-start; gap: 12px; min-height: 44px; padding: 10px 0; cursor: pointer; }
.check__input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.check__box {
  flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; margin-top: 1px; border-radius: 7px;
  border: 2px solid var(--input-border); background: var(--surface); color: transparent;
  transition: background-color 0.15s var(--ease), border-color 0.15s var(--ease);
}
.check__box .icon { stroke-width: 3; }
.check__label { font-weight: 600; color: var(--text); }
.check__input:checked + .check__box { background: var(--brand); border-color: var(--brand); color: #FFFFFF; }
.check__input:focus-visible + .check__box { outline: 3px solid var(--focus); outline-offset: 2px; }
.check-field.is-invalid .check__box { border-color: var(--danger); }

.privacy {
  display: flex; flex-direction: column; gap: 6px;
  padding: 16px; border-radius: var(--radius-lg);
  background: var(--st-needs-bg); border: 1px solid rgba(217, 119, 6, 0.35);
}
.privacy__head { display: flex; align-items: flex-start; gap: 12px; }
.privacy__icon {
  flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 50%; background: var(--surface); color: var(--st-needs);
}
.privacy__text { color: var(--st-needs-ink); font-weight: 600; }
.privacy .check__label { color: var(--text); }
.privacy .check { padding: 12px; border-radius: var(--radius); background: var(--surface); border: 1px solid rgba(217, 119, 6, 0.3); }

.hp { position: absolute !important; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }

/* ------------------------------------------------------------ screenshot picker */

.picker { display: flex; flex-direction: column; gap: 12px; }
.picker__input { display: none; }
.picker__zone {
  display: flex; align-items: center; gap: 14px; width: 100%; min-height: 88px;
  padding: 16px; text-align: left;
  border: 2px dashed var(--border-strong); border-radius: var(--radius-lg);
  background: var(--surface-2); color: var(--text);
  transition: border-color 0.15s var(--ease), background-color 0.15s var(--ease);
}
@media (hover: hover) { .picker__zone:hover:not(:disabled) { border-color: var(--brand); background: var(--brand-wash); } }
.picker__zone.is-dragging { border-color: var(--brand); background: var(--brand-wash); }
.picker__zone:disabled { cursor: not-allowed; opacity: 0.7; }
.picker__zone.is-invalid { border-color: var(--danger); }
.picker__zone-icon {
  flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center;
  width: 48px; height: 48px; border-radius: 12px; background: var(--brand-wash); color: var(--brand-ink);
}
.picker__zone-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.picker__zone-text strong { font-size: 1rem; }
.picker__zone-text span { font-size: 0.875rem; color: var(--text-3); }
.picker__count {
  flex-shrink: 0; align-self: flex-start; padding: 2px 9px; border-radius: var(--radius-pill);
  background: var(--surface); border: 1px solid var(--border); color: var(--text-2);
  font-size: 0.8125rem; font-weight: 700; font-variant-numeric: tabular-nums;
}
.picker__problems:empty { display: none; }
.picker__problem { display: flex; gap: 8px; align-items: flex-start; color: var(--danger); font-size: 0.875rem; font-weight: 600; }
.picker__problem .icon { flex-shrink: 0; margin-top: 1px; }
.picker__list { display: grid; grid-template-columns: 1fr; gap: 10px; }
@media (min-width: 720px) { .picker__list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.picker__item {
  display: flex; gap: 12px; padding: 10px; min-width: 0;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface);
  animation: pop-in 0.18s var(--ease);
}
.picker__thumb {
  flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  width: 92px; height: 92px; padding: 0; overflow: hidden;
  border: 1px solid var(--border); border-radius: 10px; background: var(--surface-3);
}
.picker__thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top center; }
.picker__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.picker__row { display: flex; align-items: flex-start; justify-content: space-between; gap: 6px; margin: -4px -4px 0 0; }
.picker__name { padding-top: 10px; min-width: 0; font-size: 0.875rem; overflow-wrap: anywhere; }
.picker__label { font-weight: 700; color: var(--text); }
.picker__meta { color: var(--text-3); }
.picker__tag { display: inline-flex; align-items: center; gap: 4px; align-self: flex-start; color: var(--st-fixed-ink); background: var(--st-fixed-bg); padding: 1px 8px; border-radius: 6px; font-size: 0.8125rem; font-weight: 700; }
.picker__note { font-size: 0.8125rem; color: var(--st-needs-ink); font-weight: 600; }
.picker__body .btn { align-self: flex-start; }

.spinner {
  width: 26px; height: 26px; border-radius: 50%;
  border: 3px solid var(--border-mid); border-top-color: var(--brand);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ------------------------------------------------------------ progress */

.progress { display: flex; flex-direction: column; gap: 8px; }
.progress__text { font-weight: 600; color: var(--text-2); font-variant-numeric: tabular-nums; }
.progress__track { height: 8px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.progress__fill { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--brand); transition: width 0.2s var(--ease); }

.reveal { animation: pop-in 0.18s var(--ease); }
