/* Shared Phase 3 components (03-UI-SPEC "New Component Patterns"). Load after app.css (and after
   members.css or lifecycle.css when a page uses their .confirm-panel). Palette tokens only, light
   only, and the site-wide :focus-visible ring from app.css is never overridden. Every interactive
   control is at least 44px; state is always carried by words or shape as well as color. */

/* Reason panel: the .confirm-panel shell plus a required Reason field (D-38 overrides). The shell
   is declared in full so the panel looks the same whichever page stylesheet is loaded. */
.reason-panel {
  position: absolute;
  right: 0;
  top: calc(100% + var(--space-xs));
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  width: 340px;
  max-width: calc(100vw - var(--space-xl));
  margin: 0;
  padding: var(--space-md);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(10, 26, 34, 0.12);
}

.reason-panel p {
  margin: 0;
  font-size: 14px;
  line-height: 1.45;
  color: var(--ink);
}

.reason-panel label {
  font-size: 13px;
  line-height: 1.3;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.reason-panel textarea {
  width: 100%;
  min-height: 80px;
  font-family: "IBM Plex Sans", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  padding: var(--space-sm) var(--space-md);
  border: 1px solid var(--control);
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
  resize: vertical;
}

.reason-panel textarea:focus-visible {
  border-color: var(--accent);
}

.reason-panel .helper {
  color: var(--muted);
}

.reason-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

@media (max-width: 480px) {
  .reason-panel {
    position: static;
    width: auto;
    max-width: none;
    margin-top: var(--space-sm);
  }
}

/* Copy field: a read-only link and a Copy link button. */
.copy-field-wrap {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.copy-field-label {
  font-size: 13px;
  line-height: 1.3;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.copy-field {
  display: flex;
  gap: var(--space-sm);
  align-items: center;
}

.copy-field input {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 44px;
  font-family: "IBM Plex Sans", system-ui, sans-serif;
  font-size: 16px;
  padding: 0 var(--space-md);
  border: 1px solid var(--control);
  border-radius: 8px;
  background: var(--tint);
  color: var(--ink);
}

.copy-field input:focus-visible {
  border-color: var(--accent);
}

.copy-field .btn {
  flex: none;
}

.copy-field .btn svg {
  width: 18px;
  height: 18px;
  flex: none;
}

/* Chips: the waitlist, held and over-cap chips pair --warn with an icon and words; subtle chips
   ("Guest", "Managed by you") stay quiet. Base .chip, .chip-warn and .chip-subtle colors live in
   app.css; these rules size the icon and weight the text. */
.chip.chip-warn,
.chip.chip-subtle {
  font-weight: 500;
  line-height: 1.3;
}

.chip.chip-warn svg,
.chip.chip-subtle svg {
  width: 16px;
  height: 16px;
  flex: none;
}

/* DUPR rating with its verification state, inline (never a chip). The figure is always Plex Mono. */
.rating-figure {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.rating-verified,
.rating-unverified {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  font-size: 14px;
  line-height: 1.45;
}

.rating-verified {
  color: var(--accent);
  font-weight: 500;
}

.rating-verified svg {
  width: 16px;
  height: 16px;
  flex: none;
}

.rating-unverified {
  color: var(--muted);
}

/* Registration stepper: text and a check mark carry the state, no numbered circles. */
.stepper {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm) var(--space-lg);
  margin: 0 0 var(--space-lg);
  padding: 0;
  list-style: none;
  font-size: 14px;
  line-height: 1.45;
}

.stepper li {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
}

.stepper li[aria-current="step"] {
  font-weight: 600;
  color: var(--ink);
}

.stepper li.is-done {
  color: var(--muted);
}

.stepper li.is-done svg {
  width: 16px;
  height: 16px;
  flex: none;
  color: var(--accent);
}

.stepper li.is-upcoming {
  color: var(--subtle);
}

/* Combobox suggestion list (venue typeahead), metrics from .org-switcher-menu in console.css. */
.combobox {
  position: relative;
}

.combobox-list {
  position: absolute;
  top: calc(100% + var(--space-xs));
  left: 0;
  right: 0;
  z-index: 20;
  max-height: 320px;
  overflow-y: auto;
  margin: 0;
  padding: var(--space-xs) 0;
  list-style: none;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(10, 26, 34, 0.12);
}

.combobox-list [role="option"] {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 44px;
  padding: 0 var(--space-md);
  color: var(--ink);
  cursor: pointer;
}

.combobox-list [role="option"] .combobox-detail {
  font-size: 14px;
  line-height: 1.45;
  color: var(--muted);
}

.combobox-list [role="option"]:hover {
  background: var(--tint);
}

/* The highlighted row (aria-activedescendant) gets a left bar as well as the tint. */
.combobox-list [role="option"][aria-selected="true"] {
  background: var(--tint);
  box-shadow: inset 4px 0 0 var(--accent);
}

.combobox-list .combobox-add {
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: var(--space-sm);
  font-weight: 600;
  color: var(--accent);
}

.combobox-list .combobox-add svg {
  width: 18px;
  height: 18px;
  flex: none;
}

/* Row action menu: the more-vertical button and its menu (E-5). The shared copy for every console
   page that loads this file, the TV screens page among them. members.css keeps the same rules for
   members.html, which does not load this file; the rules are identical, so load order between the
   two files does not matter. The menu positions against its nearest positioned ancestor. */
.row-action-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--ink);
  cursor: pointer;
}

.row-action-button:hover {
  background: var(--tint);
}

.row-action-menu {
  position: absolute;
  right: 0;
  top: calc(100% + var(--space-xs));
  z-index: 10;
  display: flex;
  flex-direction: column;
  min-width: 180px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(10, 26, 34, 0.12);
  padding: var(--space-xs) 0;
}

.row-action-menu[hidden] {
  display: none;
}

.row-action-item {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0 var(--space-md);
  width: 100%;
  background: none;
  border: none;
  text-align: left;
  font-family: "IBM Plex Sans", system-ui, sans-serif;
  font-size: 15px;
  color: var(--ink);
  cursor: pointer;
}

.row-action-item:hover {
  background: var(--tint);
}

.row-action-danger {
  color: var(--error);
}

/* Switch (06-UI-SPEC "New Component Patterns", public/js/switch.js): one button holds the label, a
   44x24 track with a 20px thumb, and the word "On" or "Off" in 600 weight, so the whole row is a
   44px target and the state reads from the thumb's place, its check and the word as well as the
   track's color. Off: a paper track with a 2px --control border (3:1 on paper) and a --control
   thumb at the left. On: an accent track and a white thumb at the right holding an accent check.
   The site-wide :focus-visible ring from app.css applies unchanged. */
.switch-row {
  display: flex;
  align-items: center;
  min-height: 44px;
}

.switch {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  min-height: 44px;
  padding: 0;
  background: none;
  border: none;
  color: var(--ink);
  font-family: "IBM Plex Sans", system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.55;
  text-align: left;
  cursor: pointer;
}

.switch-label {
  margin-right: var(--space-xs);
}

.switch-track {
  position: relative;
  flex: none;
  box-sizing: border-box;
  width: 44px;
  height: 24px;
  border: 2px solid var(--control);
  border-radius: 12px;
  background: var(--paper);
  transition: background-color 150ms ease, border-color 150ms ease;
}

.switch-thumb {
  position: absolute;
  top: 0;
  left: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--control);
  color: var(--accent);
  transition: transform 150ms ease;
}

.switch-thumb svg {
  display: none;
  width: 14px;
  height: 14px;
  stroke-width: 3;
}

.switch[aria-checked="true"] .switch-track {
  background: var(--accent);
  border-color: var(--accent);
}

.switch[aria-checked="true"] .switch-thumb {
  transform: translateX(20px);
  background: var(--paper);
}

.switch[aria-checked="true"] .switch-thumb svg {
  display: block;
}

.switch-state {
  min-width: 2em;
  font-weight: 600;
}

.switch[aria-disabled="true"] {
  cursor: not-allowed;
}

@media (prefers-reduced-motion: reduce) {
  .switch-track,
  .switch-thumb {
    transition: none;
  }
}

/* The account page's Texts panel (public/js/account-texts.js, 06-UI-SPEC "Account page: texts"). */
.texts-panel {
  margin-top: var(--space-lg);
}

.texts-panel h3 {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-sm);
}

.texts-panel h3 svg {
  flex: none;
  width: 20px;
  height: 20px;
  color: var(--accent);
}

.texts-intro {
  margin: 0 0 var(--space-md);
}

.texts-phone {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-sm);
  margin: 0;
}

/* The masked number reads in IBM Plex Mono, like every number in a dense row (06-UI-SPEC). */
.texts-phone-number {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

/* "Change number" reads as a text link but reveals a field on this page, so it is a button with a
   44px target. */
.texts-change-number {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0;
  background: none;
  border: none;
  color: var(--accent);
  font-family: "IBM Plex Sans", system-ui, sans-serif;
  font-size: inherit;
  text-decoration: underline;
  cursor: pointer;
}

.texts-status {
  margin: 0;
  font-size: 14px;
  line-height: 1.45;
  color: var(--muted);
}

.texts-panel .error-message {
  margin: var(--space-xs) 0 0;
  font-size: 14px;
  line-height: 1.45;
  color: var(--error);
}

.texts-confirm {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-sm);
  margin-top: var(--space-md);
  padding: var(--space-md);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

.texts-confirm .field {
  width: 100%;
  margin-bottom: 0;
}

.texts-consent-row {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
}

.texts-consent-row input[type="checkbox"] {
  flex: none;
  width: 24px;
  height: 24px;
  margin: 10px 0 0;
  accent-color: var(--accent);
  cursor: pointer;
}

.texts-consent-field.has-error input[type="checkbox"] {
  outline: 2px solid var(--error);
  outline-offset: 2px;
}

/* The consent sentence is a disclosure, not a field caption: Body 16/1.5, sentence case, ink. */
.texts-consent-row label {
  display: block;
  min-height: 44px;
  padding: 10px 0;
  cursor: pointer;
  font-family: "IBM Plex Sans", system-ui, sans-serif;
  font-size: 16px;
  font-weight: 400;
  letter-spacing: normal;
  text-transform: none;
  line-height: 1.5;
  color: var(--ink);
}

.texts-stop {
  margin-top: var(--space-md);
}

.texts-stop svg {
  flex: none;
  width: 20px;
  height: 20px;
}

.texts-stop p {
  margin: 0;
}

.texts-managed-line {
  margin: var(--space-sm) 0 0;
  font-size: 14px;
  line-height: 1.45;
  color: var(--muted);
}

/* A player's name linked to their public profile (06-11, D-09): who's in, a partner on a profile
   line. Underlined at rest so the link never rests on color alone, and a 44px target. A name whose
   profile is not visible is a plain span (.name-plain) with no link, no hover and no icon. */
.name-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* The account page's "View my profile" link, with its user icon. */
.profile-view-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  min-height: 44px;
}

.profile-view-link svg {
  flex: none;
  width: 16px;
  height: 16px;
}

.profile-state {
  margin: var(--space-sm) 0 0;
  font-size: 14px;
  line-height: 1.45;
  color: var(--muted);
}
