/* ============================================================
   PublicInput -- Language access entry panel.

   Ported from the "Language access entry" prototype. Two deliberate departures:

   1. THE DESIGN TOKENS ARE DEFINED HERE, not taken from ~/css/publicinput-ds/tokens.css. That file
      is not in this repository and the server answers 500 for it, so every --pi-* reference would
      resolve to nothing and the panel would render unstyled -- the exact failure this stylesheet
      exists to fix. Defining them locally keeps the panel self-contained.

   2. Shipped from Content/ and <link>ed by the view, NOT imported from the module. webpack exports
      CSS imported under Scripts/Modules as a STRING with no injector (see the issuer rule in
      webpack.config.js), so `import "./x.css"` there applies nothing at all.

   Colours are picked for WCAG 2.1 AA against the surface each sits on, so nothing here relies on
   the large-text exemption. Everything is scoped under .pi-langaccess so nothing leaks out.
   ============================================================ */

.pi-langaccess {
  --pi-action: #0a5ca8;
  --pi-action-hover: #084a87;
  --pi-action-press: #063a6b;
  --pi-tint: #eaf4fd;
  --pi-tint-edge: #cfe3f5;
  --pi-ink: #102a43;
  --pi-ink-on-tint: #102a43;
  --pi-muted-on-tint: #495d70;
  --pi-live-dot: #0a7d78;
  --pi-gray-200: #dfe3e8;
  --pi-gray-300: #c3ccd5;
  --pi-gray-500: #6b7783;
  --pi-gray-700: #44505c;
  --pi-motion-fast: 120ms;
  --pi-motion-base: 180ms;

  container-type: inline-size;
  margin: 18px 0 16px;
}

.pi-langaccess *,
.pi-langaccess *::before,
.pi-langaccess *::after {
  box-sizing: border-box;
}

.pi-langaccess .invite {
  position: relative;
  background: radial-gradient(
    120% 140% at 100% 0%,
    #e9f6ff 0%,
    var(--pi-tint) 46%,
    var(--pi-tint) 100%
  );
  border: 1px solid var(--pi-tint-edge);
  border-radius: 14px;
  padding: 22px 24px 20px;
  color: var(--pi-ink-on-tint);
}

.pi-langaccess .invite-top {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-bottom: 4px;
}

.pi-langaccess .globe {
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: #fff;
  display: grid;
  place-items: center;
  color: var(--pi-action);
  box-shadow: 0 1px 0 rgba(16, 42, 67, 0.05),
    inset 0 0 0 1px var(--pi-tint-edge);
}

.pi-langaccess .globe svg {
  width: 26px;
  height: 26px;
}

.pi-langaccess .invite-titles {
  min-width: 0;
  flex: 1;
}

.pi-langaccess .invite h2 {
  font-weight: 700;
  font-size: 19px;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--pi-ink-on-tint);
  margin: 0;
}

.pi-langaccess .live-pill {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: #fff;
  border: 1px solid var(--pi-tint-edge);
  border-radius: 999px;
  padding: 6px 12px 6px 10px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--pi-ink-on-tint);
  white-space: nowrap;
  align-self: flex-start;
}

/* Decorative -- the pill's own text states the meeting state (WCAG 1.4.1). */
.pi-langaccess .live-pill .dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--pi-live-dot);
  animation: pi-la-pulse 2s ease-out infinite;
}

@keyframes pi-la-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(10, 125, 120, 0.45);
  }

  70% {
    box-shadow: 0 0 0 7px rgba(10, 125, 120, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(10, 125, 120, 0);
  }
}

.pi-langaccess .invite-sub {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
  margin: 13px 0 0;
  font-size: 14px;
  line-height: 1.45;
  color: var(--pi-muted-on-tint);
}

.pi-langaccess .modes {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.pi-langaccess .modetag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #fff;
  border: 1px solid var(--pi-tint-edge);
  border-radius: 8px;
  padding: 4px 9px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--pi-ink-on-tint);
}

.pi-langaccess .modetag svg {
  width: 15px;
  height: 15px;
  color: var(--pi-action);
}

.pi-langaccess .langs {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin: 16px 0 4px;
}

.pi-langaccess .langpill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  border: 1.5px solid var(--pi-action);
  border-radius: 10px;
  padding: 9px 14px;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  color: var(--pi-ink-on-tint);
  text-decoration: none;
  cursor: pointer;
  transition: background var(--pi-motion-fast), transform var(--pi-motion-fast),
    box-shadow var(--pi-motion-fast);
}

.pi-langaccess .langpill .auto {
  font-size: 15px;
}

.pi-langaccess .langpill .en {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--pi-muted-on-tint);
}

.pi-langaccess .langpill:hover {
  background: var(--pi-action);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px -8px rgba(10, 92, 168, 0.7);
  text-decoration: none;
}

.pi-langaccess .langpill:hover .en {
  color: rgba(255, 255, 255, 0.9);
}

.pi-langaccess .langpill.more {
  border-style: dashed;
  border-color: var(--pi-gray-300);
  color: var(--pi-action);
  font-weight: 700;
}

.pi-langaccess .langpill.more:hover {
  background: #fff;
  color: var(--pi-action);
  border-color: var(--pi-action);
  transform: none;
  box-shadow: none;
}

.pi-langaccess .invite-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin-top: 16px;
}

.pi-langaccess .btn-open {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  background: var(--pi-action);
  color: #fff;
  border: 0;
  border-radius: 10px;
  padding: 12px 20px;
  font-weight: 700;
  font-size: 15px;
  text-decoration: none;
  cursor: pointer;
  transition: background var(--pi-motion-fast), transform var(--pi-motion-fast);
}

.pi-langaccess .btn-open:hover {
  background: var(--pi-action-hover);
  color: #fff;
  text-decoration: none;
}

.pi-langaccess .btn-open:active {
  background: var(--pi-action-press);
  transform: translateY(1px);
}

.pi-langaccess .btn-open svg {
  width: 18px;
  height: 18px;
}

.pi-langaccess .phone-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: 0;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  color: var(--pi-action);
  cursor: pointer;
  padding: 8px 4px;
  text-decoration: none;
}

.pi-langaccess .phone-toggle:hover {
  text-decoration: underline;
}

.pi-langaccess .phone-toggle svg {
  width: 17px;
  height: 17px;
  transition: transform var(--pi-motion-base);
}

.pi-langaccess .phone-toggle[aria-expanded="true"] .chev {
  transform: rotate(180deg);
}

.pi-langaccess .phones {
  width: 100%;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--pi-tint-edge);
}

.pi-langaccess .phones .ph-h {
  font-weight: 700;
  font-size: 13px;
  color: var(--pi-ink-on-tint);
  margin: 0 0 4px;
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.pi-langaccess .phones .ph-h svg {
  width: 16px;
  height: 16px;
  color: var(--pi-action);
}

.pi-langaccess .phones .ph-h a {
  color: var(--pi-action);
}

.pi-langaccess .phones .ph-sub {
  font-size: 13px;
  color: var(--pi-muted-on-tint);
  margin: 0 0 12px;
}

.pi-langaccess .phone-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.pi-langaccess .phone-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: #fff;
  border: 1px solid var(--pi-tint-edge);
  border-radius: 9px;
  padding: 9px 13px;
}

.pi-langaccess .phone-item .nm {
  font-size: 14px;
  font-weight: 600;
  color: var(--pi-ink-on-tint);
}

.pi-langaccess .phone-item .nm small {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--pi-muted-on-tint);
}

.pi-langaccess .phone-item a {
  font-weight: 700;
  font-size: 14px;
  color: var(--pi-action);
  text-decoration: none;
  white-space: nowrap;
}

.pi-langaccess .phone-item a:hover {
  text-decoration: underline;
}

.pi-langaccess .phone-foot {
  margin: 12px 0 0;
  font-size: 12.5px;
  color: var(--pi-muted-on-tint);
}

/* -------- NOT STARTED -------- */
.pi-langaccess .invite.pending {
  background: #f4f8fb;
  border-color: var(--pi-gray-200);
}

.pi-langaccess .invite.pending .globe {
  color: var(--pi-gray-500);
  box-shadow: inset 0 0 0 1px var(--pi-gray-200);
}

.pi-langaccess .invite.pending h2 {
  color: var(--pi-ink);
}

.pi-langaccess .invite.pending .live-pill {
  color: var(--pi-gray-700);
  border-color: var(--pi-gray-200);
}

.pi-langaccess .invite.pending .live-pill .dot {
  background: var(--pi-gray-500);
  animation: none;
}

.pi-langaccess .invite.pending .modetag {
  border-color: var(--pi-gray-200);
  color: var(--pi-gray-700);
}

.pi-langaccess .invite.pending .modetag svg {
  color: var(--pi-gray-500);
}

/* -------- ENDED -------- */
.pi-langaccess .invite.ended {
  background: radial-gradient(
    120% 140% at 100% 0%,
    #f3eefb 0%,
    #ece6f6 60%,
    #ece6f6 100%
  );
  border-color: #d9ceec;
}

.pi-langaccess .invite.ended .globe {
  color: #59409b;
  box-shadow: inset 0 0 0 1px #d9ceec;
}

.pi-langaccess .invite.ended h2 {
  color: #33285a;
}

.pi-langaccess .invite.ended .live-pill {
  border-color: #d9ceec;
  color: #33285a;
}

.pi-langaccess .invite.ended .live-pill .dot {
  background: #59409b;
  animation: none;
}

.pi-langaccess .invite.ended .langpill {
  border-color: #5c429b;
  color: #33285a;
}

.pi-langaccess .invite.ended .langpill .en {
  color: #4a4068;
}

.pi-langaccess .invite.ended .langpill:hover {
  background: #5c429b;
  color: #fff;
}

.pi-langaccess .invite.ended .langpill:hover .en {
  color: rgba(255, 255, 255, 0.9);
}

.pi-langaccess .invite.ended .langpill.more {
  border-color: var(--pi-gray-300);
  color: #5c429b;
}

.pi-langaccess .invite.ended .modetag {
  border-color: #d9ceec;
  color: #33285a;
}

.pi-langaccess .invite.ended .modetag svg {
  color: #59409b;
}

.pi-langaccess .invite.ended .btn-open {
  background: #5c429b;
}

.pi-langaccess .invite.ended .btn-open:hover {
  background: #4b3581;
}

.pi-langaccess .invite.ended .phone-toggle {
  color: #5c429b;
}

.pi-langaccess .invite.ended .invite-sub {
  color: #453c63;
}

.pi-langaccess .invite.ended .phones {
  border-top-color: #d9ceec;
}

.pi-langaccess .invite.ended .phone-item {
  border-color: #d9ceec;
}

.pi-langaccess .invite.ended .phones .ph-h svg,
.pi-langaccess .invite.ended .phones .ph-h a,
.pi-langaccess .invite.ended .phone-item a {
  color: #5c429b;
}

.pi-langaccess .invite.ended .phone-item .nm small,
.pi-langaccess .invite.ended .phones .ph-sub,
.pi-langaccess .invite.ended .phone-foot {
  color: #453c63;
}

.pi-langaccess :focus-visible {
  outline: 3px solid var(--pi-action);
  outline-offset: 2px;
  border-radius: 4px;
}

.pi-langaccess .invite.ended :focus-visible {
  outline-color: #4b3581;
}

@container (max-width: 680px) {
  .pi-langaccess .invite {
    padding: 18px 16px 16px;
  }

  .pi-langaccess .invite-top {
    flex-wrap: wrap;
    align-items: flex-start;
  }

  .pi-langaccess .live-pill {
    order: -1;
    width: 100%;
    justify-content: flex-start;
  }

  .pi-langaccess .invite-titles {
    flex: 1 1 0;
    min-width: 0;
  }

  .pi-langaccess .invite h2 {
    font-size: 17px;
  }

  .pi-langaccess .invite-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .pi-langaccess .btn-open {
    justify-content: center;
  }

  .pi-langaccess .phone-toggle {
    justify-content: center;
  }

  .pi-langaccess .phone-grid {
    grid-template-columns: 1fr;
  }

  .pi-langaccess .langpill {
    flex: 1 1 auto;
    justify-content: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  .pi-langaccess * {
    animation: none !important;
  }

  .pi-langaccess .langpill,
  .pi-langaccess .btn-open,
  .pi-langaccess .phone-toggle svg {
    transition: none;
  }
}
