/* ==================================================
   Submit your problem — Figma "Submit your problem ↗"
   (9077:2016, 1440 x 2539)
   ================================================== */

/* Figma: the form card ends at y1312.75, footer starts at y1458 */
.page__main {
  padding-bottom: 145.25px;
}

/* --------------------------------------------------
   Head — 9077:2668 (heading at y158)
   -------------------------------------------------- */

.submit-head {
  padding-top: 57px;
}

.submit-head__text {
  margin-top: 32px;
  max-width: 672px;
}

/* --------------------------------------------------
   Form card — 9077:2682
   #1a1c1c panel, radius 12, 33px padding
   -------------------------------------------------- */

.submit-form {
  margin-top: 57.25px;
}

.form-card {
  padding: 31px 32px 32px;
  background-color: var(--color-input);
  border: 1px solid #333535;
  border-radius: 12px;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.2));
}

.form-card__grid {
  display: flex;
  flex-direction: column;
  gap: 23px;
}

/* A field block: 11px label + 6px gap + control */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* The visibility block uses an 8px label gap, the rest use 6px */
.field--visibility {
  gap: 8px;
}

.field__label {
  margin: 0;
  color: #8a9291;
  font-size: 11px;
  font-weight: 700;
  /* Figma measures the label box at 17px */
  line-height: 17px;
  letter-spacing: 0.55px;
  text-transform: uppercase;
}

.field__label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.field__optional {
  color: #8a9291;
  font-size: 10px;
  font-weight: 600;
  line-height: 15px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

/* Two-up rows (category|location, urgency|attachment, name|email).
   Figma fixes each row's height and bottom-aligns the columns. */
.field-row {
  display: flex;
  gap: 16px;
  align-items: flex-end;
  height: 65.5px;
}

.field-row--urgency {
  height: 67.5px;
}

.field-row > .field {
  flex: 1 1 0;
  min-width: 0;
}

/* Figma gives the name field 618px and the email field 600px of 1248 */
.field-row--name {
  gap: 30px;
  height: 65.5px;
}

.field-row--name > .field:first-child {
  flex: 618 1 0;
}

.field-row--name > .field:last-child {
  flex: 600 1 0;
}

/* --- Controls -------------------------------------- */

/* Every control shares the dark treatment (the Figma file has the four
   text inputs on white; dark was requested instead). */
.control {
  width: 100%;
  height: 42px;
  padding: 11px 12px;
  background-color: var(--color-bg);
  border: 1px solid #404847;
  border-radius: 6px;
  color: var(--color-text-strong);
  font-family: inherit;
  font-size: 14px;
  line-height: 18px;
}

/* Chrome repaints autofilled fields white — keep them dark */
.control:-webkit-autofill,
.control:-webkit-autofill:hover,
.control:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--color-text-strong);
  -webkit-box-shadow: inset 0 0 0 100px var(--color-bg);
  caret-color: var(--color-text-strong);
}

.control::placeholder {
  color: #8a9291;
}

/* One indicator per field: the global :focus-visible outline sits 3px
   outside the box and read as a second border, so inside the form the
   focused field just turns its own border green. */
.form-card :focus-visible {
  outline: none;
}

.control:focus-visible,
.segmented__option:focus-visible,
.visibility__option:focus-within,
.upload:focus-within {
  border-color: var(--color-accent);
}

/* The submit pill is already accent-filled, so it rings inward instead */
.form-foot__submit:focus-visible {
  box-shadow: inset 0 0 0 2px var(--color-accent-ink);
}

.select {
  position: relative;
}

.control--select {
  padding: 8px 12px;
  line-height: 20px;
  appearance: none;
}

/* Figma places the chevron 339px into the field, not at its right edge */
.select__chevron {
  position: absolute;
  left: 339px;
  top: 50%;
  width: 21px;
  height: 21px;
  transform: translateY(-50%);
  pointer-events: none;
}

.textarea-wrap {
  position: relative;
  padding-bottom: 6px;
}

.control--textarea {
  display: block;
  height: 106px;
  min-height: 100px;
  padding: 12px;
  line-height: 20px;
  resize: vertical;
}

.textarea-wrap__count {
  position: absolute;
  right: 12px;
  bottom: 12px;
  margin: 0;
  color: #8a9291;
  font-size: 12px;
  line-height: 16px;
  pointer-events: none;
}

/* --- Urgency segmented control --------------------- */

.segmented {
  display: flex;
  justify-content: center;
  gap: 0;
  padding: 5px;
  background-color: var(--color-footer-bg);
  border: 1px solid #404847;
  border-radius: 6px;
}

.segmented__option {
  width: 119.67px;
  padding-block: 6px;
  border-radius: 16px;
  color: #8a9291;
  font-size: 12px;
  font-weight: 600;
  line-height: 16px;
  text-align: center;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.segmented__option:hover {
  color: var(--color-text-strong);
}

.segmented__option.is-active {
  background-color: var(--color-text-strong);
  color: var(--color-bg);
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.05));
}

/* --- Attachment ------------------------------------ */

.upload {
  display: flex;
  width: 100%;
  height: 38px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background-color: var(--color-footer-bg);
  border: 1px dashed #404847;
  border-radius: 6px;
  color: #8a9291;
  font-size: 14px;
  line-height: 20px;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.upload:hover {
  border-color: var(--color-accent);
  color: var(--color-text-strong);
}

.upload img {
  width: 9.375px;
  height: 15px;
}

/* --- Visibility radios ----------------------------- */

.visibility {
  display: flex;
  gap: 12px;
}

.visibility__option {
  display: flex;
  flex: 1 1 0;
  align-items: flex-start;
  gap: 12px;
  min-width: 0;
  padding: 12px;
  border: 1px solid #404847;
  border-radius: 6px;
  cursor: pointer;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.visibility__option:hover {
  border-color: #8a9291;
}

.visibility__option.is-selected {
  background-color: #123f3c;
  border-color: var(--color-accent);
}

.visibility__dot {
  display: flex;
  width: 18px;
  height: 18px;
  flex: none;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
  background-color: var(--color-bg);
  border: 1px solid #8a9291;
  border-radius: 16px;
}

.visibility__dot img {
  display: none;
  width: 16px;
  height: 16px;
}

.visibility__option.is-selected .visibility__dot {
  background-color: var(--color-accent);
  border-color: transparent;
}

.visibility__option.is-selected .visibility__dot img {
  display: block;
}

.visibility__text {
  display: block;
  min-width: 0;
}

.visibility__title {
  display: block;
  margin: 0;
  color: var(--color-text-strong);
  font-size: 14px;
  font-weight: 600;
  line-height: 20px;
}

.visibility__hint {
  display: block;
  margin: 2px 0 0;
  color: #8a9291;
  font-size: 12px;
  line-height: 16px;
}

.visibility__option.is-selected .visibility__hint {
  color: var(--color-text-muted);
}

/* --- Disclaimer + footer --------------------------- */

.disclaimer {
  display: flex;
  height: 18px;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: #8a9291;
  font-size: 11px;
  line-height: 16.5px;
}

.disclaimer img {
  width: 9.3333px;
  height: 11.6667px;
  flex: none;
}

.form-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 25px;
  border-top: 1px solid #404847;
}

.form-foot__note {
  margin: 0;
  color: #8a9291;
  font-size: 14px;
  line-height: 20px;
}

.form-foot__submit {
  display: inline-flex;
  height: 44px;
  align-items: center;
  gap: 8px;
  padding-inline: 24px;
  background-color: var(--color-accent);
  border-radius: var(--radius-pill);
  color: #123f3c;
  font-size: 14px;
  font-weight: 600;
  line-height: 20px;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.form-foot__submit:hover {
  background-color: #94ec81;
}

.form-foot__submit:active {
  transform: translateY(1px);
}

.form-foot__submit img {
  width: 12px;
  height: 12px;
}

/* ==================================================
   Responsive
   ================================================== */

@media (max-width: 1240px), (min-width: 1441px) {
  /* The chevron's fixed 339px offset only holds at the design width */
  .select__chevron {
    left: auto;
    right: 12px;
  }
}

@media (max-width: 1100px) {
  .submit-head {
    padding-top: 48px;
  }

  .submit-form {
    margin-top: 40px;
  }

  .page__main {
    padding-bottom: 96px;
  }

  .visibility {
    flex-wrap: wrap;
  }

  .visibility__option {
    flex-basis: calc(50% - 6px);
  }
}

@media (max-width: 720px) {
  .form-card {
    padding: 20px;
  }

  .field-row,
  .field-row--urgency,
  .field-row--name {
    height: auto;
    flex-direction: column;
    gap: 23px;
    align-items: stretch;
  }

  .segmented__option {
    width: auto;
    flex: 1 1 0;
  }

  .visibility__option {
    flex-basis: 100%;
  }

  .form-foot {
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
  }

  .disclaimer {
    align-items: flex-start;
  }
}

/* ==================================================
   Toasts — submit feedback
   ================================================== */

.toast-stack {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 400;
  display: flex;
  width: min(420px, calc(100vw - 48px));
  flex-direction: column;
  gap: 12px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px 18px;
  background-color: var(--color-panel);
  border: 1px solid var(--color-card-border);
  border-left: 3px solid var(--color-accent);
  border-radius: 12px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
  color: var(--color-text-strong);
  font-size: 14px;
  line-height: 20px;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.25s ease, transform 0.25s ease;
  pointer-events: auto;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.toast--error {
  border-left-color: var(--color-danger);
}

.toast__icon {
  width: 14px;
  height: 14px;
  flex: none;
  margin-top: 3px;
}

.toast--error .toast__icon {
  display: none;
}

.toast__message {
  flex: 1 1 auto;
  min-width: 0;
}

.toast__close {
  flex: none;
  margin: -2px -4px 0 0;
  color: var(--color-text-muted);
  font-size: 18px;
  line-height: 1;
  transition: color 0.2s ease;
}

.toast__close:hover {
  color: var(--color-text-strong);
}

@media (max-width: 720px) {
  .toast-stack {
    right: 16px;
    left: 16px;
    bottom: 16px;
    width: auto;
  }
}
