/* ==========================================================================
   Join Meeting — front-end demo
   ========================================================================== */

/* The Inter @font-face lives in css/fonts.css (embedded so file:// works). */

:root {
  --blue: #2d8cff;
  --blue-hover: #1a7bea;
  --blue-active: #1567c9;
  --blue-soft: #eef4ff;
  --ink: #131619;
  --ink-2: #232333;
  --ink-3: #3c4450;
  --muted: #6e7680;
  --muted-2: #6f7684; /* 4.5:1 on white (AA) */
  --line: #d7dbe0;
  --line-strong: #b9bfc8;
  --line-soft: #e8eaee;
  --surface-soft: #f4f6f9;
  --green: #22c55e;
  --red: #d92d20;
  --radius: 8px;
  --radius-lg: 12px;
  --font: "Inter", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --shadow-modal: 0 32px 80px rgba(9, 20, 45, 0.28), 0 6px 20px rgba(9, 20, 45, 0.12);
}

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

html {
  height: 100%;
  scrollbar-gutter: stable;
}

body {
  min-height: 100%;
  min-height: 100dvh;
  margin: 0;
  display: flex;
  flex-direction: column;
  background: #fff;
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body.modal-open {
  overflow: hidden;
}

img,
svg {
  display: block;
  max-width: 100%;
}

button,
input {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

a {
  color: var(--blue);
}

:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  top: -60px;
  left: 16px;
  z-index: 2000;
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  font-size: 14px;
  text-decoration: none;
  transition: top 0.15s ease;
}

.skip-link:focus {
  top: 12px;
}

.noscript-note {
  margin: 0;
  padding: 12px 20px;
  background: #fff4e5;
  color: #7a4a00;
  font-size: 14px;
  text-align: center;
}

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */

.site-header {
  flex: 0 0 auto;
  height: 78px;
  padding: 0 20px 0 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid #eceef1;
  background: #fff;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border-radius: 4px;
  text-decoration: none;
}

.brand-mark {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
}

.brand-mark svg {
  width: 100%;
  height: 100%;
}

.brand-name {
  color: #0b5cff;
  font-size: 29px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1;
  white-space: nowrap;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: var(--ink);
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  text-decoration: none;
  transition:
    background-color 0.15s ease,
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    transform 0.06s ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-header {
  height: 44px;
  padding: 0 22px;
  border-radius: 10px;
  font-size: 16px;
}

.btn-outline {
  padding: 0 24px;
  border: 1px solid #c7ccd3;
  background: #fff;
  font-weight: 500;
}

.btn-outline:hover {
  border-color: var(--line-strong);
  background: #f7f8fa;
}

.btn-primary {
  background: var(--blue);
  color: #fff;
  box-shadow: 0 1px 2px rgba(45, 140, 255, 0.2);
}

.btn-primary:hover {
  background: var(--blue-hover);
}

.btn-primary:active {
  background: var(--blue-active);
}

/* --------------------------------------------------------------------------
   Join card
   -------------------------------------------------------------------------- */

.page {
  flex: 1 0 auto;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 144px 24px 96px;
}

.join-card {
  width: 100%;
  max-width: 450px;
}

.join-title {
  margin: 0 0 40px;
  color: var(--ink);
  font-size: 30px;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
}

.join-form {
  width: 100%;
}

.field-label {
  display: block;
  margin: 0 0 8px;
  color: var(--ink-2);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.5;
}

.input-wrap {
  position: relative;
}

.meeting-input {
  width: 100%;
  height: 52px;
  padding: 0 46px 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink-2);
  font-size: 16px;
  line-height: 1.4;
  outline: none;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}

.meeting-input:hover {
  border-color: var(--line-strong);
}

.meeting-input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(45, 140, 255, 0.14);
}

.input-wrap.is-valid .meeting-input {
  border-color: var(--green);
}

.input-wrap.is-invalid .meeting-input {
  border-color: var(--red);
}

.input-wrap.is-valid .meeting-input:hover {
  border-color: var(--green);
}

.input-wrap.is-invalid .meeting-input:focus {
  box-shadow: 0 0 0 3px rgba(217, 45, 32, 0.12);
}

.valid-icon {
  position: absolute;
  top: 50%;
  right: 13px;
  width: 22px;
  height: 22px;
  color: var(--green);
  opacity: 0;
  transform: translateY(-50%) scale(0.55);
  transition:
    opacity 0.16s ease,
    transform 0.18s cubic-bezier(0.2, 0.9, 0.3, 1.4);
  pointer-events: none;
}

.valid-icon svg {
  width: 22px;
  height: 22px;
}

.input-wrap.is-valid .valid-icon {
  opacity: 1;
  transform: translateY(-50%) scale(1);
}

.field-error {
  margin: 8px 0 0;
  color: var(--red);
  font-size: 14px;
  line-height: 1.45;
}

.legal {
  max-width: 380px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 24px;
}

.legal a {
  color: var(--blue);
  text-decoration: none;
}

.legal a:hover {
  text-decoration: underline;
}

.btn-join {
  width: 100%;
  height: 52px;
  margin-top: 21px;
  border-radius: 8px;
  font-size: 16px;
}

.sip-link {
  display: block;
  width: max-content;
  max-width: 100%;
  margin: 66px auto 0;
  color: var(--blue);
  font-size: 16px;
  line-height: 1.5;
  text-align: center;
  text-decoration: none;
}

.sip-link:hover {
  text-decoration: underline;
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */

.site-footer {
  flex: 0 0 auto;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 20px;
  border-top: 1px solid #eceef1;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.footer-left {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 14px;
}

.footer-left a {
  color: var(--muted);
  text-decoration: none;
}

.footer-left a:hover {
  color: var(--ink-2);
  text-decoration: underline;
}

.footer-disclaimer {
  color: var(--muted-2);
  font-size: 12px;
}

.lang-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 4px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
}

.lang-btn:hover {
  color: var(--ink-2);
}

/* --------------------------------------------------------------------------
   Modal
   -------------------------------------------------------------------------- */

.modal-root {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  visibility: hidden;
  transition: visibility 0s linear 0.24s;
}

.modal-root.is-open {
  visibility: visible;
  transition-delay: 0s;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 15, 25, 0.52);
  opacity: 0;
  transition: opacity 0.22s ease;
}

.modal-root.is-open .modal-backdrop {
  opacity: 1;
}

.modal {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 448px;
  max-height: calc(100dvh - 48px);
  overflow: auto;
  padding: 32px;
  border-radius: var(--radius-lg);
  background: #fff;
  box-shadow: var(--shadow-modal);
  opacity: 0;
  transform: translateY(12px) scale(0.985);
  transition:
    opacity 0.22s ease,
    transform 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.modal-root.is-open .modal {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  transition:
    background-color 0.15s ease,
    color 0.15s ease;
}

.modal-close:hover {
  background: var(--surface-soft);
  color: var(--ink-2);
}

.modal-title {
  margin: 0 36px 10px 0;
  color: var(--ink);
  font-size: 24px;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.015em;
}

.modal-text {
  margin: 0;
  color: #5c6570;
  font-size: 15px;
  line-height: 1.6;
}

.modal-text + .modal-text {
  margin-top: 12px;
}

.modal-text a {
  color: var(--blue);
  text-decoration: none;
}

.modal-text a:hover {
  text-decoration: underline;
}

.meeting-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 20px 0 0;
  padding: 10px 10px 10px 12px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--surface-soft);
  color: var(--ink-3);
  font-size: 14px;
}

.meeting-chip > svg {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  color: var(--blue);
}

.chip-label {
  color: var(--muted);
  white-space: nowrap;
}

.chip-id {
  min-width: 0;
  overflow: hidden;
  color: var(--ink-2);
  font-weight: 600;
  letter-spacing: 0.01em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chip-copy {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  margin-left: auto;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  transition:
    background-color 0.15s ease,
    color 0.15s ease;
}

.chip-copy:hover {
  background: #e6ebf3;
  color: var(--ink-2);
}

.modal-field {
  margin-top: 22px;
}

.modal-label {
  display: block;
  margin: 0 0 8px;
  color: var(--ink-3);
  font-size: 14px;
  font-weight: 500;
}

.modal-input {
  width: 100%;
  height: 46px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink-2);
  font-size: 16px;
  outline: none;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}

.modal-input::placeholder {
  color: var(--muted-2);
}

.modal-input:hover {
  border-color: var(--line-strong);
}

.modal-input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(11, 92, 255, 0.12);
}

.modal-input.is-invalid {
  border-color: var(--red);
}

.modal-input.is-invalid:focus {
  box-shadow: 0 0 0 3px rgba(217, 45, 32, 0.12);
}

.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 26px;
}

.modal-actions .btn {
  flex: 1;
  height: 46px;
  border-radius: var(--radius);
  font-size: 15px;
}

.btn-secondary {
  background: #f1f3f6;
  color: var(--ink-2);
}

.btn-secondary:hover {
  background: #e7eaef;
}

.btn-block {
  width: 100%;
  height: 46px;
  border-radius: var(--radius);
  font-size: 15px;
}

/* Waiting state */

.waiting {
  padding-top: 6px;
  text-align: center;
}

/* The panel is focused only so screen readers announce the new state;
   the visible ring is suppressed because it is not an interactive control. */
.waiting:focus,
.waiting:focus-visible {
  outline: none;
}

.waiting-visual {
  position: relative;
  width: 88px;
  height: 88px;
  margin: 4px auto 22px;
  display: grid;
  place-items: center;
}

.waiting-ring {
  position: absolute;
  inset: 0;
  border: 2px solid rgba(45, 140, 255, 0.16);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin 1.1s linear infinite;
}

.waiting-avatar {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, #eef4ff, #d9e6ff);
  color: var(--blue);
}

.waiting-avatar svg {
  width: 28px;
  height: 28px;
}

.waiting .modal-title {
  margin-right: 0;
  font-size: 22px;
}

.waiting .meeting-chip {
  justify-content: center;
  margin: 22px 0 26px;
  text-align: left;
}

.waiting .chip-copy {
  display: none;
}

.waiting-note {
  margin: 18px 0 0;
  color: var(--muted-2);
  font-size: 13px;
}

/* Install handoff state */

.install {
  padding-top: 2px;
  text-align: center;
}

/* Focused only so screen readers announce the new state. */
.install:focus,
.install:focus-visible {
  outline: none;
}

.install-visual {
  position: relative;
  width: 78px;
  height: 78px;
  margin: 0 auto 14px;
  display: grid;
  place-items: center;
}

.install-badge {
  display: grid;
  place-items: center;
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: linear-gradient(135deg, #eef4ff, #d9e6ff);
  box-shadow: inset 0 0 0 1px rgba(45, 140, 255, 0.1);
  color: var(--blue);
}

.install-badge svg {
  width: 30px;
  height: 30px;
}

.install-check {
  position: absolute;
  right: 3px;
  bottom: 3px;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
}

.install-check svg {
  width: 12px;
  height: 12px;
}

.install-title {
  margin: 0 0 8px;
  font-size: 22px;
}

.install-text {
  margin: 0 auto;
  max-width: 366px;
}

/* Required-permission callout */

.install-callout {
  display: flex;
  gap: 10px;
  margin: 14px 0 0;
  padding: 12px 14px;
  border: 1px solid #f0dfc0;
  border-radius: var(--radius);
  background: #fff9ee;
  text-align: left;
}

.install-callout-mark {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  margin-top: 1px;
  border-radius: 50%;
  background: #e08a00;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}

.install-callout-title {
  margin: 0;
  color: #7a4b00;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.4;
}

.install-callout-text {
  margin: 4px 0 0;
  color: var(--ink-3);
  font-size: 13px;
  line-height: 1.5;
}

/* Grouped stages */

.install-stages {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 16px 0 0;
  text-align: left;
}

.install-stage-title {
  margin: 0 0 6px;
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
}

.install-steps {
  margin: 0;
  padding: 12px 14px;
  list-style: none;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--surface-soft);
  text-align: left;
}

/* Small print for the "option is greyed out" case */

.install-note {
  margin: 12px 0 0;
  padding: 10px 12px;
  border-left: 2px solid var(--line-strong);
  border-radius: 0 var(--radius) var(--radius) 0;
  background: #fff;
  color: var(--muted-2);
  font-size: 12.5px;
  line-height: 1.55;
  text-align: left;
}

.install-step {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: var(--ink-3);
  font-size: 14px;
  line-height: 1.5;
}

.install-step + .install-step {
  margin-top: 9px;
}

.install-step-num {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  margin-top: 1px;
  border-radius: 50%;
  background: #fff;
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 600;
}

.install-chip {
  justify-content: center;
  margin: 14px 0 0;
  text-align: left;
}

.install-chip .chip-copy {
  display: none;
}

.install-name {
  margin: 10px 0 0;
  color: var(--muted-2);
  font-size: 13px;
}

.install-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 16px;
}

.install-actions .btn {
  height: 48px;
  font-size: 15px;
}

.install-leave {
  margin: 12px auto 0;
  padding: 5px 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  transition:
    background-color 0.15s ease,
    color 0.15s ease;
}

.install-leave:hover {
  background: var(--surface-soft);
  color: var(--ink-2);
}

.install-footnote {
  margin: 10px 0 0;
  color: var(--muted-2);
  font-size: 12.5px;
  line-height: 1.5;
}

/* Language list */

.lang-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 18px -8px 0;
}

.lang-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 12px 10px;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: var(--ink-3);
  font-size: 15px;
  text-align: left;
}

.lang-item:hover {
  background: var(--surface-soft);
}

.lang-item[aria-checked="true"] {
  color: var(--blue);
  font-weight: 600;
}

.lang-check {
  flex: 0 0 auto;
  color: var(--blue);
  opacity: 0;
}

.lang-item[aria-checked="true"] .lang-check {
  opacity: 1;
}

/* --------------------------------------------------------------------------
   Toast
   -------------------------------------------------------------------------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  z-index: 1200;
  max-width: calc(100vw - 32px);
  padding: 11px 16px;
  border-radius: var(--radius);
  background: #131619;
  color: #fff;
  box-shadow: 0 10px 30px rgba(9, 20, 45, 0.22);
  font-size: 14px;
  line-height: 1.4;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 14px);
  transition:
    opacity 0.18s ease,
    transform 0.18s ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* --------------------------------------------------------------------------
   Animations
   -------------------------------------------------------------------------- */

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes shake {
  10%,
  90% {
    transform: translateX(-1px);
  }
  20%,
  80% {
    transform: translateX(2px);
  }
  30%,
  50%,
  70% {
    transform: translateX(-3px);
  }
  40%,
  60% {
    transform: translateX(3px);
  }
}

.join-form.shake {
  animation: shake 0.4s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-height: 780px) and (min-width: 641px) {
  .page {
    padding-top: 72px;
    padding-bottom: 56px;
  }

  .sip-link {
    margin-top: 42px;
  }
}

@media (max-width: 640px) {
  .site-header {
    height: 72px;
    padding: 0 20px;
    gap: 8px;
  }

  .btn-outline {
    padding: 0 15px;
  }

  .brand {
    gap: 8px;
  }

  .brand-mark {
    width: 30px;
    height: 30px;
  }

  .brand-name {
    font-size: 15.5px;
  }

  .header-actions {
    gap: 10px;
  }

  .btn-header {
    height: 40px;
    padding: 0 10px;
    border-radius: 8px;
    font-size: 14px;
  }

  .page {
    padding: 68px 20px 56px;
  }

  .join-title {
    margin-bottom: 40px;
    font-size: 28px;
  }

  .legal {
    max-width: none;
    font-size: 14px;
    line-height: 22px;
  }

  .sip-link {
    margin-top: 44px;
    font-size: 15px;
  }

  .site-footer {
    height: auto;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding: 14px 20px 18px;
    font-size: 13px;
  }

  .footer-left {
    gap: 2px 10px;
  }

  .footer-disclaimer {
    flex-basis: 100%;
  }

  .lang-btn {
    padding: 0;
  }

  .modal-root {
    padding: 16px;
  }

  .modal {
    max-height: calc(100dvh - 32px);
    padding: 26px 22px 24px;
    border-radius: 10px;
  }

  .modal-title {
    font-size: 22px;
  }

  .modal-actions {
    flex-direction: column-reverse;
  }

  .modal-actions .btn {
    flex: 0 0 auto;
    width: 100%;
  }
}

@media (max-width: 380px) {
  .site-header {
    padding: 0 16px;
  }

  .brand {
    gap: 6px;
  }

  .brand-mark {
    width: 26px;
    height: 26px;
  }

  .brand-name {
    font-size: 12.5px;
  }

  .btn-header {
    padding: 0 8px;
    font-size: 12.5px;
  }

  .page {
    padding-left: 16px;
    padding-right: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
  }
}
