@import "./styles.shared-theme.css";

/* Task / landing cards only — admin researcher shell uses `.panel` as flat block sections */
body.page-survey .page > main.panel.stack,
.page > main.main-card {
  display: grid;
  gap: 14px;
}

.task-item {
  border: 1px solid #4a4a4a;
  border-radius: 10px;
  background: var(--surface-2);
  padding: 12px;
  display: grid;
  gap: 10px;
}

.task-img {
  width: 100%;
  max-height: 260px;
  object-fit: contain;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #1e1e1e;
}

.textarea-with-voice__row {
  display: flex;
  gap: 10px;
  align-items: stretch;
}

.textarea-with-voice__row textarea {
  flex: 1;
  min-width: 0;
}

.btn-voice {
  flex: 0 0 auto;
  min-width: 72px;
  opacity: 0.55;
  cursor: not-allowed;
}

/* Title + stepper stay visible while scrolling the long form. */
.survey-sticky-header {
  position: sticky;
  top: 0;
  z-index: 40;
  display: grid;
  gap: 8px;
  margin: -14px -14px 12px;
  padding: 12px 14px 12px;
  background: var(--surface, #2f2f2f);
  border-bottom: 1px solid var(--border, #444);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
}

/* Progress stepper: dots + connectors (not interactive). */
.progress-stepper {
  width: 100%;
  margin: 0;
}

.progress-stepper__rail {
  display: flex;
  align-items: flex-start;
  width: 100%;
  gap: 0;
}

.progress-step {
  flex: 0 1 24%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
}

.progress-step__dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  box-sizing: border-box;
  border: 2px solid var(--muted, #a1a1aa);
  background: transparent;
  flex-shrink: 0;
}

.progress-step__dot--reached {
  border-color: var(--primary, #2563eb);
  background: var(--primary, #2563eb);
}

.progress-step__dot--current {
  box-shadow: 0 0 0 3px rgba(22, 119, 255, 0.35);
}

.progress-step__dot--future {
  opacity: 0.9;
}

.progress-step__text {
  font-size: 11px;
  line-height: 1.3;
  color: var(--muted, #a1a1aa);
  max-width: 6.5rem;
  hyphens: auto;
}

.progress-step__text--reached {
  color: var(--fg, #f4f4f5);
}

.progress-stepper__line {
  flex: 1 1 0;
  min-width: 6px;
  height: 2px;
  margin-top: 5px;
  align-self: flex-start;
  background: var(--border, #4a4a4a);
  border-radius: 1px;
}

.progress-stepper__line--done {
  background: var(--primary, #2563eb);
}

@media (max-width: 520px) {
  .progress-step__text {
    font-size: 10px;
    max-width: 5.5rem;
  }
}

.collapsible {
  border: 1px solid #4a4a4a;
  border-radius: 10px;
  padding: 12px;
}

.slot-boxes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  align-items: stretch;
}

.slot-box {
  position: relative;
  aspect-ratio: 1 / 1;
  width: 100%;
  min-height: 0;
  border: 2px solid #4a4a4a;
  border-radius: 12px;
  background: #474747;
  color: var(--fg);
  font-size: clamp(18px, 5vw, 22px);
  font-weight: 700;
  display: grid;
  place-items: center;
  padding: 0;
  overflow: hidden;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.slot-box:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.slot-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.slot-box--active {
  border-color: var(--primary);
  box-shadow:
    0 0 0 2px rgba(22, 119, 255, 0.45),
    inset 0 0 0 2px var(--primary);
  transform: scale(1.02);
  z-index: 1;
}

.slot-box--filled:not(.slot-box--active) {
  border-color: #5a5a5a;
}

.slot-box--filled {
  background: #2d3344;
}

/* Mobile-friendly file picker: full-width hit target, no native “Choose File” chrome */
.file-upload-field {
  gap: 8px;
}

.file-upload-field-label {
  color: var(--fg);
  font-size: 14px;
}

.file-upload-tile {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 14px 12px;
  border-radius: 12px;
  border: 1px dashed #6b6b6b;
  background: var(--surface);
  overflow: hidden;
}

.file-upload-tile:focus-within {
  border-color: var(--primary);
  border-style: solid;
  box-shadow: 0 0 0 1px rgba(22, 119, 255, 0.35);
}

.file-upload-native {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  opacity: 0;
  cursor: pointer;
  font-size: 16px;
  border: none;
  border-radius: 0;
  background: transparent;
  min-height: 100%;
  box-shadow: none;
  appearance: none;
  -webkit-appearance: none;
}

.file-upload-face {
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-align: center;
}

.file-upload-cta {
  font-weight: 700;
  font-size: 15px;
  color: var(--fg);
}

.file-upload-summary {
  margin: 0;
  font-size: 12px;
  line-height: 1.35;
  color: var(--muted);
  word-break: break-word;
}

.file-upload-summary.is-empty {
  color: var(--muted);
  font-style: italic;
}

.file-upload-summary.has-file {
  color: var(--fg);
  font-weight: 600;
  font-style: normal;
}

@media (max-width: 720px) {
  .textarea-with-voice__row {
    flex-direction: column;
  }

  .btn-voice {
    width: 100%;
  }

  .file-upload-tile {
    min-height: 56px;
    padding: 16px 12px;
  }
}

.catalog-project {
  border: 1px solid var(--border, #4a4a4a);
  border-radius: 12px;
  padding: 14px;
  display: grid;
  gap: 12px;
  background: var(--surface-2, #2a2a2a);
}

.catalog-project__head {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-end;
}

.catalog-project__label {
  flex: 1 1 220px;
}

.catalog-task {
  border: 1px solid var(--border, #4a4a4a);
  border-radius: 10px;
  padding: 12px;
  display: grid;
  gap: 10px;
  background: var(--surface, #1e1e1e);
}

.intro-thumb-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.intro-thumb {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border, #4a4a4a);
}

/* Task brief images: same width rhythm as `.actions .btn` (100% width ≤720px; content-width row above). */
#taskIntroSection .intro-images-strip {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  max-width: 100%;
}

#taskIntroSection .intro-images-strip .task-img {
  width: 100%;
  max-width: 100%;
  max-height: min(56vh, 420px);
  height: auto;
  object-fit: contain;
  display: block;
  /* Match `.btn` (border-radius: 10px; border: none) in styles.shared-theme.css */
  border-radius: 10px;
  border: none;
  box-sizing: border-box;
}

