/*
  The process drawer: a walked set of steps inside an add_window() drawer on the mchat frame —
  a teal header with the back chevron, the step dots (and a + when the step has an "add new"),
  a question, a hint, cards or a form, and Back / Next in the footer. The employer's Add staff
  drawer (class.add_staff_drawer.php) and Create an event drawer (class.create_event_drawer.php)
  are built on it; the compose wizard (compose_wizard.css) is the same shape with its own
  cw_ classes from before this file existed.

  Each drawer's own pieces (the people rows, the month grid, the recap) live in that drawer's
  stylesheet; the container carries `process_drawer` plus the drawer's own class.

  NOTE: no rem units in here. lib/bootstrap_old sets html { font-size: 10px }, so a rem is 10px
  on this site. px throughout.
*/

.process_drawer
{
  --pd_ink: #0F2044;
  --pd_muted: #61727a;
  --pd_faint: #8a9a9f;
  --pd_line: #dbe4e6;
  --pd_brand: #007A85;
  --pd_brand_deep: #006470;
  --pd_brand_wash: #e6f3f4;
  --pd_brand_edge: #9fd3d8;
  --pd_radius: 10px;

  color: var(--pd_ink);
  font-size: 15px;
  line-height: 1.4;
}

.process_drawer *,
.process_drawer *:before,
.process_drawer *:after { box-sizing: border-box; }

/* ---- header: the step dots, and the + when a step adds something ---- */

.pd_steps
{
  display: flex;
  gap: 6px;
  flex: none;
  margin-left: 10px;
}
.pd_step
{
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,0.35);
}
.pd_step_now { background: #ffffff; }

.pd_header_plus
{
  flex: none;
  margin-left: 12px;
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.7);
  background: transparent;
  color: #ffffff;
  font-size: 16px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: none;
  transition: transform 0.15s, background 0.15s;
}
.pd_header_plus:hover, .pd_header_plus:focus { background: rgba(255,255,255,0.15); color: #ffffff; outline: none; }
.pd_header_plus.pd_open { transform: rotate(45deg); background: rgba(255,255,255,0.2); }

/* ---- body ---- */

.pd_body { padding: 18px 14px 28px; }

.pd_foot .pd_errors
{
  margin: 0 0 10px;
  border-radius: 6px;
  padding: 9px 12px;
  font-size: 14px;
}

.pd_question
{
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.3px;
  line-height: 1.2;
  margin: 0 2px 6px;
}
.pd_hint
{
  color: var(--pd_muted);
  font-size: 14px;
  margin: 0 2px 16px;
}
.pd_label
{
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--pd_faint);
  margin: 18px 2px 8px;
}
.pd_empty
{
  color: var(--pd_muted);
  font-size: 14px;
  padding: 18px 4px;
  text-align: center;
}
.pd_unnamed { color: var(--pd_faint); font-style: italic; }

/* something for one width only */
.pd_phone_only { display: none; }
@media (max-width: 767px)
{
  .pd_wide_only { display: none; }
  .pd_phone_only { display: block; }
}

/* ---- the cards: one column, the whole card is the tap target ---- */

.pd_cards
{
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pd_card
{
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 62px;
  padding: 10px 12px;
  text-align: left;
  background: #ffffff;
  border: 1.5px solid var(--pd_line);
  border-radius: var(--pd_radius);
  color: var(--pd_ink);
  font: inherit;
  cursor: pointer;
  outline: none;
  -webkit-tap-highlight-color: transparent;
  transition: border-color 0.12s, background 0.12s, box-shadow 0.12s;
}
.pd_card:hover { border-color: var(--pd_brand_edge); }
.pd_card:active { background: #f4fafa; }
.pd_card[disabled]
{
  opacity: 0.45;
  cursor: default;
}

.pd_card_icon
{
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--pd_brand_wash);
  color: var(--pd_brand);
  font-size: 18px;
}
.pd_avatar
{
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.3px;
}

.pd_card_text
{
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.pd_card_name
{
  font-size: 16px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pd_card_sub
{
  font-size: 13px;
  color: var(--pd_muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pd_card_sub:empty { display: none; }

/* the check: an empty ring until picked */
.pd_card_check
{
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid var(--pd_line);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: transparent;
  font-size: 15px;
  transition: border-color 0.12s, background 0.12s, color 0.12s;
}
.pd_card.pd_on
{
  border-color: var(--pd_brand);
  background: var(--pd_brand_wash);
  box-shadow: 0 0 0 1px var(--pd_brand) inset;
}
.pd_card.pd_on .pd_card_check
{
  border-color: var(--pd_brand);
  background: var(--pd_brand);
  color: #ffffff;
}

/* ---- chips: a row of short choices, one lit ---- */

.pd_chips
{
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.pd_chip
{
  padding: 9px 14px;
  border-radius: 20px;
  border: 1.5px solid var(--pd_line);
  background: #ffffff;
  color: var(--pd_ink);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  outline: none;
  -webkit-tap-highlight-color: transparent;
  transition: border-color 0.12s, background 0.12s;
}
.pd_chip:hover { border-color: var(--pd_brand_edge); }
.pd_chip.pd_on
{
  border-color: var(--pd_brand);
  background: var(--pd_brand);
  color: #ffffff;
}

/* ---- a form box: white, one border, the inputs inside it ---- */

.pd_form
{
  background: #ffffff;
  border: 1.5px solid var(--pd_line);
  border-radius: var(--pd_radius);
  overflow: hidden;
  margin-bottom: 12px;
}
.pd_form:focus-within { border-color: var(--pd_brand); }
.pd_form .form-control
{
  border: none;
  border-radius: 0;
  box-shadow: none;
  font-size: 16px;   /* 16px stops ios zooming the page on focus */
  color: var(--pd_ink);
  padding: 12px 14px;
  height: 46px;
}
.pd_form .form-control:focus { box-shadow: none; background: #fbfdfd; }
.pd_form .form-control + .form-control { border-top: 1px solid var(--pd_line); }

/* ---- a text link-button ---- */

.pd_link
{
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 12px 2px 0;
  padding: 4px 0;
  border: none;
  background: transparent;
  color: var(--pd_brand);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}
.pd_link:hover { color: var(--pd_brand_deep); text-decoration: underline; }
.pd_link.hide_me { display: none; }

/* ---- a list of results / recap rows with a pill on the right ---- */

.pd_results
{
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.pd_result
{
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 62px;
  padding: 10px 12px;
  background: #ffffff;
  border: 1.5px solid var(--pd_line);
  border-radius: var(--pd_radius);
}
.pd_result_invalid { border-style: dashed; }
.pd_result_invalid .pd_card_icon { background: #f4f4f4; color: var(--pd_faint); }
.pd_result_already .pd_card_icon { background: #eef1f3; color: var(--pd_muted); }

.pd_pill
{
  flex: none;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
/* on a phone the pill drops under the name rather than squeezing the line beside it */
@media (max-width: 480px)
{
  .pd_result { flex-wrap: wrap; row-gap: 6px; }
  .pd_result .pd_card_text { flex: 1 1 60%; }
  .pd_result .pd_pill { margin-left: 52px; }
}
.pd_pill_added    { background: #e3f6ec; color: #1f7a45; }
.pd_pill_restored { background: var(--pd_brand_wash); color: var(--pd_brand_deep); }
.pd_pill_already  { background: #eef1f3; color: var(--pd_muted); }
.pd_pill_invalid  { background: #fdecec; color: #b42323; }

/* ---- footer: Back on the left, Next / Add / Done filling the rest ---- */

.pd_foot
{
  flex: none;
  background: #ffffff;
  border-top: 1px solid var(--pd_line);
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
}
.pd_foot_row
{
  display: flex;
  gap: 8px;
}
.pd_foot .btn
{
  height: 46px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 700;
  padding: 0 16px;
  box-shadow: none;
}
.pd_next
{
  flex: 1;
  background: var(--pd_brand);
  border: 1px solid var(--pd_brand);
  color: #ffffff !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.pd_next:hover, .pd_next:focus { background: var(--pd_brand_deep); border-color: var(--pd_brand_deep); color: #ffffff; }
.pd_next[disabled] { opacity: 0.4; }
.pd_back
{
  flex: none;
  background: #ffffff;
  border: 1px solid var(--pd_line);
  color: var(--pd_ink);
}
.pd_busy { opacity: 0.6; }
