/* app/assets/stylesheets/form.css */

form {
  fieldset {
    border: 0;
    margin: 0 0 15px 0;

    legend {
      color: #444;
      font-weight: bold;
    }
  }

  label {
    font-size: 13px;
    font-weight: 700;
  }

  input[type=text], input[type=email], input[type=tel], input[type=password], textarea {
    background-color: #fbfafc !important;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
    color: #000;
    cursor:auto;
    font-size: 14px;
    font-weight: 500;
    height: 32px;
    line-height: normal;
    outline: none;
    margin: 8px 0;
    padding: 0 8px;
    width: 100%;
    -webkit-text-fill-color: #000;
    -webkit-box-shadow: 0 0 0px 1000px #fbfafc inset
  }

  .submit {
    margin-top: 15px;
  }
}
/* Card width picker (items/_form): each choice previews a page with cards at that width. */
.width-choices {
  .width-choices__list {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 8px;
  }

  .width-choice {
    border: 2px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px;
    width: 160px;

    input[type=radio] {
      position: absolute;
      opacity: 0;
      pointer-events: none;
    }

    &:hover {
      border-color: #aaa;
    }

    &:has(input:checked) {
      border-color: #46E3B7;
      box-shadow: 0 0 0 2px rgba(70, 227, 183, .25);
    }

    &:has(input:focus-visible) {
      outline: 2px solid #000;
      outline-offset: 2px;
    }
  }

  /* A page of 752px drawn 136px wide: cards keep their width ratio to the page. */
  .width-choice__preview {
    align-content: flex-start;
    background: #fbfafc;
    border: 1px solid #ddd;
    border-radius: 3px;
    box-sizing: border-box;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    height: 64px;
    justify-content: center;
    overflow: hidden;
    padding: 6px;
  }

  .width-choice__card {
    background: #c8c8d0;
    border-radius: 2px;
    height: 22px;
  }

  .width-choice__preview--r__xs .width-choice__card { width: 27%; }
  .width-choice__preview--r__s .width-choice__card { width: 40%; }
  .width-choice__preview--r__m .width-choice__card { width: 85%; }

  .width-choice:has(input:checked) .width-choice__card {
    background: #46E3B7;
  }

  .width-choice__label {
    font-size: 13px;
    font-weight: 700;
  }

  .width-choice__hint {
    color: #666;
    font-size: 12px;
    font-weight: 400;
  }
}

/* Help text right under a field label, and a label standing above a block (the text editor). */
form .field-hint {
  display: block;
  margin: 2px 0 0;
}

form .field-label {
  display: block;
  margin-bottom: 8px;
}
