/* Bloqueio de horário: the Bloquear horário form. Its rows in the agenda and on the day page are
   agenda.css's. */

@layer components {
  .time-block-form {
    display: flex;
    flex-direction: column;
    gap: var(--section-gap);
  }

  /* Times or Dia inteiro, on top: what it picks is the form beneath it. Drawn like the install
     guide's iPhone / Android switch. */
  .time-block-switch {
    display: flex;
    padding: 4px;
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-pill);
  }

  .time-block-switch-option {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    border-radius: var(--radius-pill);
    color: var(--color-text-light);
    font-weight: var(--font-weight-semibold);
    cursor: pointer;
    transition: background 150ms ease, color 150ms ease, box-shadow 150ms ease;

    &:has(.time-block-switch-input:checked) {
      background: var(--color-bg-white);
      color: var(--color-text);
      box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
    }

    &:has(.time-block-switch-input:focus-visible) {
      outline: 2px solid var(--color-primary);
      outline-offset: 2px;
    }

    @media (prefers-reduced-motion: reduce) {
      transition: none;
    }
  }

  .time-block-switch-input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
  }

  .time-block-form-days {
    display: flex;
    gap: var(--row-gap);
  }

  .time-block-form-field {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;

    .time-block-form-label {
      font-size: var(--text-sm);
      font-weight: var(--font-weight-medium);
      color: var(--color-muted);
    }
  }

  .time-block-range {
    display: flex;
    align-items: center;
    gap: var(--inline-space);

    .wizard_input {
      flex: 1;
      min-width: 0;
    }
  }

  .time-block-day-off {
    color: var(--color-muted);
  }

  .time-block-range-separator {
    color: var(--color-muted);
  }

  .time-block-range-remove {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    background: none;
    border: none;
    color: var(--color-muted);
    cursor: pointer;
  }

  .time-block-range-remove-icon {
    width: 18px;
    height: 18px;
  }

  .time-block-form-add {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 48px;
    padding: 0;
    background: none;
    border: none;
    font: inherit;
    font-weight: var(--font-weight-medium);
    color: var(--color-primary);
    cursor: pointer;
  }

  .time-block-form-add-icon {
    width: 18px;
    height: 18px;
  }

  .time-block-form .wizard_cta {
    margin-top: calc(var(--cta-gap) - var(--section-gap));
  }
}
