/* Device notification / number-match screen.
   Dark surface like the reference page, independent of the panel theme. */

body.number-mode {
  overflow: hidden;
}

.nm-screen {
  position: fixed;
  inset: 0;
  z-index: 12;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 18px;
  padding: 32px 24px 20px;
  overflow: auto;
  background: #1b1c1d;
  color: #e8eaed;
}

.nm-screen[hidden] {
  display: none;
}

.nm-card {
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: 40px 48px 36px;
  background: #202124;
  border-radius: 28px;
}

.nm-logo {
  line-height: 0;
}

.nm-logo img {
  display: block;
  width: 36px;
  height: 36px;
}

.nm-cols {
  display: grid;
  grid-template-columns: minmax(280px, 400px) minmax(0, 1fr);
  column-gap: 64px;
  margin-top: 30px;
}

.nm-left h1 {
  margin: 0 0 18px;
  color: #e8eaed;
  font-size: 32px;
  line-height: 40px;
  font-weight: 400;
}

.nm-copy {
  margin: 0;
  max-width: 400px;
  color: #bdc1c6;
  font-size: 14px;
  line-height: 20px;
}

.nm-copy a,
.nm-device a,
.nm-try,
.nm-resend {
  color: #8ab4f8;
}

.nm-screen a {
  text-decoration: none;
}

.nm-screen a:hover {
  text-decoration: underline;
}

.nm-devices {
  margin-top: 28px;
}

.nm-device {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 14px;
  border: 1px solid #5f6368;
  border-radius: 12px;
  background: transparent;
  color: #e8eaed;
  font: inherit;
  font-size: 14px;
  text-align: left;
  cursor: default;
}

.nm-device.is-selected {
  border-color: #8ab4f8;
  background: rgba(138, 180, 248, 0.08);
}

.nm-device-icon {
  display: inline-flex;
  color: #bdc1c6;
}

.nm-device.is-selected .nm-device-icon {
  color: #8ab4f8;
}

.nm-device-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nm-device-check {
  display: inline-flex;
  color: #8ab4f8;
}

.nm-device-note {
  margin: 10px 0 0;
  color: #9aa0a6;
  font-size: 12px;
  line-height: 17px;
}

.nm-resend {
  margin-top: 36px;
  padding: 0;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}

.nm-resend:hover {
  text-decoration: underline;
}

.nm-toast {
  margin: 10px 0 0;
  color: #81c995;
  font-size: 12px;
}

.nm-right {
  display: flex;
  flex-direction: column;
  min-height: 360px;
  min-width: 0;
}

.nm-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px 8px;
  margin-bottom: 18px;
}

.nm-num {
  padding: 4px 0;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: #e8eaed;
  font: inherit;
  font-size: 64px;
  line-height: 1.15;
  font-weight: 300;
  text-align: center;
  cursor: pointer;
  transition: background 120ms ease, color 120ms ease;
}

.nm-num:hover {
  background: rgba(255, 255, 255, 0.08);
}

.nm-num:focus-visible {
  outline: 2px solid #8ab4f8;
  outline-offset: 2px;
}

.nm-num.is-wrong {
  color: #f28b82;
  animation: nm-shake 320ms ease;
}

.nm-num.is-matched {
  color: #81c995;
}

@keyframes nm-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

.nm-error {
  margin: 0 0 14px;
  color: #f28b82;
  font-size: 13px;
  line-height: 18px;
}

.nm-right-title {
  margin: 0 0 10px;
  color: #e8eaed;
  font-size: 22px;
  line-height: 28px;
  font-weight: 400;
}

.nm-right-copy {
  margin: 0;
  max-width: 500px;
  color: #bdc1c6;
  font-size: 14px;
  line-height: 20px;
}

.nm-right-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: auto;
  padding-top: 36px;
}

.nm-try {
  padding: 0;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}

.nm-try:hover {
  text-decoration: underline;
}

.nm-footer {
  width: min(1120px, 100%);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  color: #9aa0a6;
  font-size: 12px;
}

.nm-lang {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.nm-lang::after {
  content: "";
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid currentColor;
}

.nm-footer-links {
  display: flex;
  gap: 28px;
}

.nm-footer a {
  color: #9aa0a6;
}

@media (max-width: 860px) {
  .nm-screen {
    justify-content: flex-start;
    padding: 16px 12px;
  }

  .nm-card {
    padding: 28px 22px;
    border-radius: 22px;
  }

  .nm-cols {
    grid-template-columns: minmax(0, 1fr);
    row-gap: 32px;
    margin-top: 22px;
  }

  .nm-right {
    min-height: 0;
  }

  .nm-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .nm-num {
    font-size: 44px;
  }

  .nm-right-actions {
    padding-top: 28px;
  }

  .nm-footer {
    flex-wrap: wrap;
    justify-content: center;
  }
}
