/* ============================================================
   Simple Connect — web console

   Tokens are lifted verbatim from the Simple Phone design system
   (_ds/.../tokens/colors.css and typography.css). The brand font in that
   system is "Myanmar Text", which is a Microsoft system font and almost
   certainly not licensable for redistribution — the design system itself names
   Mulish as the metric-compatible fallback, so the stack below reaches for
   Mulish and then the platform UI font. See README for the licensing note.
   ============================================================ */

:root {
  /* Brand */
  --sp-blue: #3baced;
  --sp-blue-600: #2f9bdf;
  --sp-blue-700: #2487c7;
  --sp-blue-100: #d7eefb;
  --sp-blue-050: #eaf6fe;

  --sp-navy: #041b2b;
  --sp-purple: #7c5cff;

  /* Ink / neutrals */
  --sp-ink: #0d1b26;
  --sp-body: #44535d;
  --sp-muted: #6f7d87;
  --sp-faint: #9aa6ad;
  --sp-line: #e4e9ed;
  --sp-line-strong: #cfd7dd;
  --sp-white: #ffffff;
  --sp-cloud: #f4f8fb;
  --sp-cloud-2: #eef3f7;

  /* Status */
  --sp-success: #43a047;
  --sp-success-bg: #e8f5e9;
  --sp-warning: #f2a024;
  --sp-warning-bg: #fff3e0;
  --sp-danger: #e0413e;
  --sp-danger-bg: #fdecec;

  /* Type — body baseline is 18px, not 16. The brand premise is legibility. */
  --font-sans: "Mulish", "Segoe UI", system-ui, -apple-system, sans-serif;
  --text-h1: 44px;
  --text-h2: 32px;
  --text-h3: 24px;
  --text-lg: 20px;
  --text-base: 18px;
  --text-sm: 16px;
  --text-xs: 14px;

  --radius-card: 20px;
  --radius-pill: 999px;
  --shadow-card: 0 6px 20px rgba(4, 27, 43, 0.07);
  --shadow-lift: 0 8px 20px rgba(59, 172, 237, 0.32);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: 1.5;
  color: var(--sp-body);
  background: var(--sp-cloud);
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3 {
  color: var(--sp-navy);
  letter-spacing: -0.02em;
  margin: 0;
}
h1 {
  font-size: var(--text-h2);
  font-weight: 800;
}
h2 {
  font-size: var(--text-h3);
  font-weight: 800;
}
h3 {
  font-size: var(--text-lg);
  font-weight: 800;
}

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

/* ─────────────────────────── layout ─────────────────────────── */

.app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  background: var(--sp-white);
  border-bottom: 1px solid var(--sp-line);
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 14px;
  position: sticky;
  top: 0;
  z-index: 10;
}

.wordmark {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: var(--text-lg);
  color: var(--sp-navy);
}
.wordmark .accent {
  color: var(--sp-blue);
}
.wordmark svg {
  width: 30px;
  height: 30px;
  flex: none;
}

.topbar-spacer {
  flex: 1;
}

.who {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: var(--text-sm);
  color: var(--sp-muted);
}

.main {
  flex: 1;
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  padding: 28px 20px 96px;
}

.nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--sp-white);
  border-top: 1px solid var(--sp-line);
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
  z-index: 10;
}

.nav button {
  flex: 1;
  max-width: 180px;
  background: none;
  border: 0;
  font: inherit;
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--sp-faint);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 4px;
  border-radius: 12px;
  cursor: pointer;
}
.nav button .ico {
  font-size: 20px;
  line-height: 1;
}
.nav button.on {
  color: var(--sp-blue);
}
.nav button:disabled {
  color: var(--sp-line-strong);
  cursor: not-allowed;
}

/* ─────────────────────────── pieces ─────────────────────────── */

.card {
  background: var(--sp-white);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: 20px;
  margin-bottom: 16px;
}

.card.flush {
  padding: 6px 20px;
}

.row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 0;
  border-top: 1px solid var(--sp-cloud-2);
}
.row:first-child {
  border-top: 0;
}
.row .grow {
  flex: 1;
  min-width: 0;
}
.row .name {
  font-weight: 800;
  color: var(--sp-navy);
  font-size: var(--text-sm);
}
.row .sub {
  font-size: var(--text-xs);
  color: var(--sp-muted);
}

/* Quiet supporting text: the hint next to a label, or what happens next after
   a sign-in link is sent. */
.hint {
  font-size: var(--text-xs);
  color: var(--sp-muted);
  line-height: 1.5;
}

.avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-lg);
  font-weight: 800;
  flex: none;
}

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 56px;
  padding: 0 26px;
  border-radius: var(--radius-pill);
  border: 0;
  font: inherit;
  font-weight: 800;
  font-size: var(--text-base);
  cursor: pointer;
  text-decoration: none;
}
.pill.primary {
  background: var(--sp-blue);
  color: #fff;
  box-shadow: var(--shadow-lift);
}
.pill.primary:hover {
  background: var(--sp-blue-600);
}
.pill.purple {
  background: var(--sp-purple);
  color: #fff;
  box-shadow: 0 8px 20px rgba(124, 92, 255, 0.32);
}
.pill.ghost {
  background: var(--sp-white);
  color: var(--sp-navy);
  border: 1px solid var(--sp-line);
}
.pill.danger {
  background: var(--sp-danger);
  color: #fff;
}
.pill.wide {
  width: 100%;
}
.pill:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 800;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  background: var(--sp-blue-100);
  color: var(--sp-blue-700);
}
.badge.ok {
  background: var(--sp-success-bg);
  color: #1c7a45;
}
.badge.warn {
  background: var(--sp-warning-bg);
  color: #9a6410;
}
.badge.bad {
  background: var(--sp-danger-bg);
  color: #a32724;
}

.tiles {
  display: flex;
  gap: 12px;
  margin-top: 16px;
}
.tile {
  flex: 1;
  background: var(--sp-cloud);
  border-radius: 14px;
  padding: 14px;
}
.tile .big {
  font-size: var(--text-lg);
  font-weight: 800;
  color: var(--sp-navy);
  margin-top: 4px;
}
.tile .lbl {
  font-size: 13px;
  color: var(--sp-muted);
}

label {
  display: block;
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--sp-navy);
  margin-bottom: 6px;
}

input[type="text"],
input[type="email"],
select {
  width: 100%;
  font: inherit;
  padding: 14px 16px;
  border: 1px solid var(--sp-line-strong);
  border-radius: 14px;
  background: var(--sp-white);
  color: var(--sp-ink);
  margin-bottom: 16px;
}
input:focus,
select:focus {
  outline: 0;
  border-color: var(--sp-blue);
  box-shadow: 0 0 0 3px rgba(59, 172, 237, 0.45);
}

.code-input {
  font-size: 36px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.codebox {
  background: var(--sp-cloud);
  border: 2px dashed #a9d5f2;
  border-radius: 22px;
  padding: 26px;
  text-align: center;
  margin: 18px 0;
}
.codebox .eyebrow {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--sp-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.codebox .code {
  font-size: 46px;
  font-weight: 800;
  color: var(--sp-navy);
  letter-spacing: 0.14em;
  margin-top: 6px;
  font-variant-numeric: tabular-nums;
}

.muted {
  color: var(--sp-muted);
  font-size: var(--text-sm);
}
.lead {
  font-size: var(--text-base);
  line-height: 1.55;
  margin: 0 0 18px;
}

.notice {
  border-radius: 16px;
  padding: 14px 18px;
  margin-bottom: 16px;
  font-size: var(--text-sm);
  line-height: 1.45;
}
.notice.info {
  background: var(--sp-blue-050);
  border: 1.5px dashed #a9d5f2;
  color: #2b6d97;
}
.notice.bad {
  background: var(--sp-danger-bg);
  color: #a32724;
}
.notice.ok {
  background: var(--sp-success-bg);
  color: #1c7a45;
}

.empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--sp-muted);
}

.scopes {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 0;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.split {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

/* ─────────────────────── remote session ─────────────────────── */

.viewer {
  background: var(--sp-navy);
  border-radius: var(--radius-card);
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 420px;
}
.viewer canvas,
.viewer video {
  max-width: 100%;
  max-height: 70vh;
  display: block;
}
.viewer .placeholder {
  color: #8fb6cf;
  text-align: center;
  padding: 40px;
  font-size: var(--text-sm);
}
.viewer.controllable canvas,
.viewer.controllable video {
  cursor: crosshair;
}

.session-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.keys {
  display: flex;
  gap: 8px;
}
.keys button {
  font: inherit;
  font-size: var(--text-sm);
  font-weight: 700;
  padding: 10px 16px;
  border-radius: 12px;
  border: 1px solid var(--sp-line);
  background: var(--sp-white);
  color: var(--sp-navy);
  cursor: pointer;
}
.keys button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ───────────────────────── login ───────────────────────── */

.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: linear-gradient(180deg, var(--sp-blue-050) 0%, #ffffff 70%);
}
.login {
  width: 100%;
  max-width: 440px;
}
.login .card {
  padding: 28px;
}

.dev-note {
  font-size: 13px;
  color: var(--sp-faint);
  text-align: center;
  margin-top: 16px;
  line-height: 1.5;
}

@media (max-width: 560px) {
  :root {
    --text-h2: 26px;
  }
  .main {
    padding: 20px 14px 100px;
  }
  .tiles {
    flex-wrap: wrap;
  }
}
