.arraysubs-onboarding {
  --arraysubs-onboarding-done-color: #00a36e;
  --arraysubs-onboarding-pending-color: var(--wp-admin-theme-color);
  color: #414141;

  position: relative;

  &.is-dismissible &__header {
    padding-inline-end: 112px;
  }

  &__dismiss {
    padding: 6px 0 6px 8px;
    position: absolute;
    right: 0;
    top: 12px;
    inset-inline-end: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    box-sizing: border-box;
    min-height: 36px;
    border: 0;
    border-radius: 3px;
    background: transparent;
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
    white-space: nowrap;
    cursor: pointer;

    &:hover {
      background: rgb(255 255 255 / 14%);
    }

    &:focus-visible {
      outline: 2px solid var(--wp-admin-theme-color);
      outline-offset: 2px;
    }

    &:disabled {
      cursor: wait;
    }

    svg {
      flex-shrink: 0;
    }
  }

  &__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 10px;
    margin-top: 10px;

    h2 {
      margin: 0 0 6px;
      font-size: 22px;
      line-height: 1.35;
    }

    p {
      margin: 0;
      font-size: 13px;
      line-height: 1.5;
    }
  }

  &__progress {
    display: grid;
    gap: 9px;
    flex-shrink: 0;
    width: 160px;
    font-size: 13px;
    font-weight: 600;

    progress {
      display: block;
      width: 100%;
      height: 6px;
      overflow: hidden;
      border: 0;
      border-radius: 3px;
      appearance: none;
      background: rgb(132, 132, 132);
      color: var(--wp-admin-theme-color);

      &::-webkit-progress-bar {
        background: rgb(132, 132, 132);
      }

      &::-webkit-progress-value {
        background: var(--wp-admin-theme-color);
      }

      &::-moz-progress-bar {
        background: var(--wp-admin-theme-color);
      }
    }
  }

  &__tasks {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin: 0;
    padding: 0;
    list-style: none;
  }

  &__task {
    display: flex;
    flex-direction: column;
    min-width: 0;
    margin: 0;
    padding: 18px;
    border-radius: 3px;
    color: #fff;
    background: var(--arraysubs-onboarding-pending-color);
    border: 1px solid rgb(255 255 255 / 14%);
    h3 {
      margin: 14px 0 6px;
      color: inherit;
      font-size: 16px;
      line-height: 1.4;
    }

    p {
      margin: 0 0 18px;
      color: rgb(255 255 255 / 90%);
      font-size: 13px;
      line-height: 1.5;
    }
  }

  &__task-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
  }

  &__status {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 12px;
    background: rgb(255 255 255 / 14%);
    font-size: 11px;
    font-weight: 600;
    line-height: 1.4;
  }

  &__action {
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 38px;
    margin-top: auto;
    padding: 8px 12px;
    border: 1px solid #ffffff75;
    border-radius: 2px;
    background: #fff;
    color: var(--wp-admin-theme-color);
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
    text-align: center;
    text-decoration: none;
    max-width: 400px;
    cursor: pointer;

    svg {
      flex-shrink: 0;
    }

    &:hover {
      background: rgb(255 255 255 / 90%);
    }

    &:focus-visible {
      outline: 2px solid #fff;
      outline-offset: 3px;
      box-shadow: none;
      color: var(--arraysubs-onboarding-color);
    }
  }

  &__task.is-complete &__action {
    background: transparent;
    color: #fff;

    &:hover {
      background: rgb(255 255 255 / 14%);
    }
  }

  @media (max-width: 960px) {
    &__tasks {
      grid-template-columns: 1fr;
    }
  }

  @media (max-width: 600px) {
    padding: 20px;

    &.is-dismissible &__header {
      padding-top: 32px;
      padding-inline-end: 0;
    }

    &__header {
      align-items: stretch;
      flex-direction: column;
      gap: 16px;

      h2 {
        font-size: 20px;
      }
    }

    &__progress {
      width: 100%;
    }
  }
}

.arraysubs-onboarding--compact {
  padding: 16px 0 0;
  border-top: 1px solid #f0f0f1;
  color: #1d2327;

  .arraysubs-onboarding__header {
    gap: 12px;
    min-height: 26px;
    margin: 0 0 12px;

    h2 {
      margin: 0;
      font-size: 13px;
      font-weight: 600;
    }
  }

  .arraysubs-onboarding__progress {
    width: 112px;
    gap: 5px;
    color: #50575e;
    font-size: 11px;

    progress {
      height: 4px;
      background: #dcdcde;

      &::-webkit-progress-bar {
        background: #dcdcde;
      }
    }
  }

  .arraysubs-onboarding__tasks {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
  }

  .arraysubs-onboarding__task {
    padding: 12px;
    border-radius: 4px;

    h3 {
      margin: 10px 0 4px;
      font-size: 13px;
    }

    p {
      margin: 0 0 12px;
      font-size: 12px;
    }
  }

  .arraysubs-onboarding__task-head {
    min-height: 22px;
    gap: 6px;

    > svg {
      flex-shrink: 0;
    }
  }

  .arraysubs-onboarding__status {
    padding: 2px 6px;
    font-size: 10px;
  }

  .arraysubs-onboarding__action,
  .arraysubs-onboarding__task.is-complete .arraysubs-onboarding__action {
    min-height: 32px;
    padding: 6px 8px;
    gap: 6px;
    border-color: rgb(255 255 255 / 46%);
    background: #fff;
    color: var(--wp-admin-theme-color);
    font-size: 12px;

    &:hover {
      border-color: #fff;
      background: color-mix(in srgb, var(--wp-admin-theme-color) 6%, white);
      color: var(--wp-admin-theme-color-darker-10);
    }

    &:focus-visible {
      outline: 2px solid #fff;
      outline-offset: 2px;
      color: var(--wp-admin-theme-color);
    }
  }

  @media (max-width: 600px) {
    .arraysubs-onboarding__header {
      flex-direction: row;
      align-items: center;
    }

    .arraysubs-onboarding__tasks {
      grid-template-columns: 1fr;
    }
  }
}
