:root {
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #eef2f6;
  color: #17212f;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
}

.shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(320px, 520px);
  align-items: start;
  justify-content: center;
  gap: 20px;
  padding: 24px;
}

.login-panel {
  width: 100%;
  background: #fff;
  border: 1px solid #d7dee8;
  border-radius: 8px;
  padding: 24px;
  box-shadow: 0 16px 40px rgba(25, 35, 50, 0.1);
}

.heading {
  margin-bottom: 22px;
}

.eyebrow {
  margin: 0 0 6px;
  color: #5f6f85;
  font-size: 13px;
}

h1 {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0;
}

h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0;
}

.field {
  display: grid;
  gap: 8px;
  margin: 12px 0;
  font-size: 14px;
  font-weight: 600;
}

.step-card {
  padding: 14px 0 16px;
  border-top: 1px solid #e7edf4;
}

.step-card:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.is-hidden {
  display: none;
}

.step-title {
  margin-bottom: 8px;
  color: #17212f;
  font-size: 15px;
  font-weight: 700;
}

input:not([type="checkbox"]),
textarea,
select {
  width: 100%;
  border: 1px solid #bac6d6;
  border-radius: 6px;
  padding: 12px 12px;
  font-size: 16px;
  font-family: inherit;
  color: #17212f;
  background: #fff;
}

input:not([type="checkbox"]):focus,
textarea:focus,
select:focus {
  outline: 3px solid rgba(20, 113, 187, 0.18);
  border-color: #1471bb;
}

textarea {
  min-height: 92px;
  line-height: 1.5;
  resize: vertical;
}

textarea[readonly] {
  color: #334155;
  background: #f8fafc;
}

.primary {
  width: 100%;
  min-height: 44px;
  border: 0;
  border-radius: 6px;
  background: #1471bb;
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
}

.secondary {
  width: 100%;
  min-height: 44px;
  border: 1px solid #bac6d6;
  border-radius: 6px;
  background: #fff;
  color: #17212f;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
}

.primary:disabled,
.secondary:disabled {
  cursor: wait;
}

.primary:disabled {
  background: #8fa3b9;
}

.secondary:disabled {
  color: #8fa3b9;
  background: #f4f7fa;
}

.step-status {
  min-height: 24px;
  margin-top: 12px;
  color: #5f6f85;
  font-size: 14px;
  line-height: 1.5;
}

.step-status.is-pending {
  color: #475569;
}

.step-status.is-success {
  color: #0f766e;
}

.step-status.is-error {
  color: #b42318;
}

.step-actions {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.launcher-login-panel {
  width: 100%;
  display: grid;
  gap: 10px;
  padding-bottom: 18px;
}

.launcher-login-title {
  font-size: 18px;
  font-weight: 700;
  color: #17212f;
}

.auth-level-panel {
  width: 100%;
  display: grid;
  gap: 10px;
  padding-top: 18px;
  border-top: 1px solid #d7dee8;
}

.auth-level-qr-panel {
  width: 100%;
  display: grid;
  gap: 10px;
  padding: 18px 0;
  border-top: 1px solid #d7dee8;
}

.auth-level-title {
  font-size: 18px;
  font-weight: 700;
  color: #17212f;
}

.auth-level-page {
  min-height: 100vh;
  overflow: hidden;
  background: #fff;
  color: #17212f;
}

.auth-level-shell,
.auth-level-step {
  width: 100vw;
  min-height: 100vh;
  display: grid;
}

.auth-level-shell {
  padding: 0;
  align-items: stretch;
}

.auth-level-step {
  grid-template-rows: minmax(0, 1fr);
  align-items: stretch;
}

.auth-level-live-area {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.auth-level-live-area.is-hidden {
  display: none;
}

.viewer-grid {
  display: grid;
  grid-template-columns: minmax(260px, 1fr);
  gap: 12px;
  align-items: stretch;
}

.auth-level-page .auth-level-live-area {
  width: 100%;
  min-height: 0;
  height: 100%;
  margin-top: 0;
  place-items: center;
}

.auth-level-page .viewer-grid {
  width: min(100vw, calc(100vh * 720 / 1280));
  max-width: none;
  gap: 0;
}

.auth-level-page .cloud-phone-frame {
  width: 100%;
  max-width: none;
  border: 0;
  border-radius: 0;
  background: #fff;
}

.cloud-phone-frame {
  position: relative;
  --cloud-phone-top-cover: 60px;
  --cloud-phone-bottom-cover: 40px;
  width: min(100%, 420px);
  aspect-ratio: var(--cloud-phone-aspect-ratio, 720 / 1280);
  margin: 0 auto;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid #d7dee8;
  border-radius: 6px;
  background: #f8fafc;
  color: #5f6f85;
  font-size: 14px;
}

.cloud-phone-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  object-fit: contain;
  z-index: 0;
}

.cloud-phone-frame::before,
.cloud-phone-frame::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  z-index: 1;
  pointer-events: auto;
  background: #f8fafc;
}

.cloud-phone-frame::before {
  top: 0;
  height: var(--cloud-phone-top-cover);
}

.cloud-phone-frame::after {
  bottom: 0;
  height: var(--cloud-phone-bottom-cover);
}

.cloud-phone-mask {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: #f8fafc;
  color: #334155;
  font-size: 20px;
  line-height: 1.5;
  font-weight: 700;
  text-align: center;
  pointer-events: auto;
}

.cloud-phone-mask.is-hidden {
  display: none;
}

.auth-level-sms-panel {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(96px, 128px);
  gap: 10px;
  align-items: end;
  padding: 14px 16px 18px;
  border-top: 1px solid #d7dee8;
  background: #fff;
  box-shadow: 0 -10px 28px rgba(25, 35, 50, 0.12);
}

.auth-level-sms-panel.is-hidden {
  display: none;
}

.auth-level-sms-panel .field {
  margin: 0;
}

.auth-level-sms-panel .primary {
  width: 100%;
}

.auth-level-sms-panel .step-status {
  grid-column: 1 / -1;
  margin-top: 0;
}

@media (max-width: 900px) {
  .shell {
    grid-template-columns: 1fr;
    min-height: 100vh;
    padding: 16px;
  }

  .viewer-grid {
    grid-template-columns: 1fr;
  }

}
