:root {
  --color-bg: #fefefd;
  --color-surface: #fefefd;
  --color-border: #d2d3d6;
  --color-divider: #d2d3d6;
  --color-text: #202133;
  --color-text-muted: #4d4d5c;
  --color-nav-bg: #fefefd;
  --color-nav-border: #d2d3d6;
  --color-card-number: #202133;
  --color-button-text: #202133;
  --color-button-text-disabled: #a6a6ad;
  --color-otp-separator: #a6a6ad;
  --color-destructive-message: #c60017;
  --color-countdown-bg: #8073e5;
  --color-countdown-text: #fefefd;
  --monavate-yellow-border: #d0ed02;
  --monavate-yellow: #dfff00;
}

:root[data-theme='dark'] {
  --color-bg: #202133;
  --color-surface: rgba(77, 77, 92, 0.25);
  --color-border: rgba(77, 77, 92, 0.5);
  --color-divider: rgba(77, 77, 92, 0.5);
  --color-text: #fefefd;
  --color-text-muted: #fdfcfb;
  --color-nav-bg: rgba(77, 77, 92, 0.25);
  --color-nav-border: rgba(77, 77, 92, 0.5);
  --color-otp-separator: #4d4d5c80;
  --color-destructive-message: #ff9da8;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Poppins', sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
  min-height: 100vh;
  overflow-x: hidden;
}

.nav {
  height: 73px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px 40px;
  border-bottom: 1px solid var(--color-nav-border);
  background: var(--color-nav-bg);
  position: relative;
}

.nav__logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 40px;
}

.nav__logo img {
  width: auto;
  height: auto;
  max-width: 140px;
  max-height: 40px;
}

.nav__logo-image--dark {
  display: none;
}

:root[data-theme='dark'] .nav__logo-image--light {
  display: none;
}

:root[data-theme='dark'] .nav__logo-image--dark {
  display: block;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) .nav__logo-image--light {
    display: none;
  }

  :root:not([data-theme='light']) .nav__logo-image--dark {
    display: block;
  }
}

main {
  width: 100%;
}

.screen {
  min-height: calc(100vh - 73px);
  padding: 40px 16px 96px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  position: relative;
}

.session-countdown {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  padding: 4px 12px;
  background: var(--color-countdown-bg);
  color: var(--color-countdown-text);
  font-size: 14px;
  line-height: 22px;
  font-weight: 400;
  text-align: center;
  white-space: nowrap;
}

/* Monospace digits prevent the countdown box from flickering in width as digits change */
.session-countdown__digits {
  font-family: ui-monospace, 'Menlo', 'Consolas', monospace;
}

.session-countdown::before {
  content: '';
  position: absolute;
  left: 50%;
  top: -1px;
  width: 100vw;
  height: 1px;
  background: var(--color-countdown-bg);
  transform: translateX(-50%);
}

.screen__title {
  margin: 0;
  font-size: 34px;
  line-height: 44px;
  font-weight: 600;
  text-align: center;
  color: var(--color-text);
}

.screen__lead {
  margin: 0;
  font-size: 14px;
  line-height: 22px;
  font-weight: 400;
  color: var(--color-text-muted);
  text-align: center;
  max-width: 480px;
}

.info-multiline {
  white-space: pre-line;
}

.content-panel {
  border: 1px solid var(--color-border);
  width: 400px;
  padding: 32px 40px;
  display: flex;
  flex-direction: column;
  gap: 32px;
  align-items: center;
  background: var(--color-surface);
}

.card-visual {
  position: relative;
  width: 297px;
  height: 190px;
  border-radius: 16px;
  overflow: hidden;
}

.card-visual img {
  display: block;
  width: 100%;
  height: 100%;
}

.card__logo {
  position: absolute;
  left: 20px;
  top: 20px;
  height: 16px;
}

.card__apple-pay {
  position: absolute;
  right: 16px;
  top: 16px;
  height: 24px;
}

.card__number {
  position: absolute;
  left: 20px;
  bottom: 20px;
  margin: 0;
  font-weight: 700;
  font-size: 18px;
  line-height: 28px;
  letter-spacing: 0.9px;
  text-transform: uppercase;
  color: var(--color-card-number);
}

.actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  width: 100%;
}

.actions__row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: center;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  border: none;
  padding: 0;
  background: transparent;
  cursor: pointer;
}

.badge img {
  display: block;
  height: 40px;
}

.divider {
  width: 264px;
  height: 1px;
  background: var(--color-divider);
}

.note {
  margin: 0;
  font-size: 12px;
  line-height: 20px;
  color: var(--color-text-muted);
  text-align: center;
}

.link-button {
  background: transparent;
  border: none;
  font-size: 14px;
  line-height: 22px;
  font-weight: 600;
  color: var(--color-text);
  cursor: pointer;
  padding: 4px 16px;
}

.instructions {
  width: 280px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: var(--color-text);
  font-size: 14px;
  line-height: 22px;
  text-align: left;
}

.instructions__title {
  margin: 0;
  font-weight: 600;
}

.instructions ol {
  margin: 0;
  padding-left: 20px;
  color: var(--color-text-muted);
}

.instructions li {
  margin-bottom: 4px;
}

.status-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
}

.status-block__icon {
  width: 48px;
  height: 48px;
}

.status-block__text {
  margin: 0;
  font-size: 14px;
  line-height: 22px;
  color: var(--color-text-muted);
  max-width: 320px;
}

.status-block__text--muted {
  font-size: 12px;
  line-height: 20px;
  color: var(--color-text-muted);
}

.status-block__text a {
  color: var(--color-text-muted);
  text-decoration: underline;
}

.mutted-note__text {
  margin: 0;
  font-size: 12px;
  line-height: 20px;
  color: var(--color-text);
  text-align: center;
  max-width: 233px;
}

.primary-button {
  width: 200px;
  height: 40px;
  border-radius: 0;
  border: 1px solid var(--monavate-yellow-border);
  background: var(--monavate-yellow);
  color: var(--color-button-text);
  font-size: 14px;
  font-weight: 600;
  line-height: 22px;
  cursor: pointer;
}

.cards-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: center;
}

.screen--centered {
  justify-content: flex-start;
  padding-top: 48px;
}

.otp-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-start;
}

.otp-input {
  display: flex;
  align-items: center;
  gap: 8px;
}

.otp-group {
  display: flex;
  align-items: center;
  gap: 0;
  border: 1px solid var(--color-border);
}

.otp-slot {
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 0;
  background: var(--color-surface);
  font-size: 14px;
  line-height: 22px;
  font-weight: 400;
  text-align: center;
  color: var(--color-text);
  padding: 0;
}

.otp-slot + .otp-slot {
  border-left: 1px solid var(--color-border);
}

.otp-slot:focus,
.otp-slot:focus-visible {
  outline: none;
}

.otp-group:focus-within {
  border-color: var(--color-text-muted);
}

.otp-group:focus-within .otp-slot + .otp-slot {
  border-left-color: var(--color-text-muted);
}

.otp-separator {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
}

.otp-separator::before {
  content: '';
  width: 12px;
  height: 2px;
  background: var(--color-otp-separator);
  border-radius: 1px;
}

.otp-error {
  margin: 0;
  font-size: 14px;
  line-height: 22px;
  color: var(--color-destructive-message);
}

.otp-button:disabled {
  color: var(--color-button-text-disabled);
}

@media (max-width: 540px) {
  .nav {
    padding: 16px 24px;
  }

  .screen {
    padding: 24px 16px 64px;
  }

  .content-panel {
    width: 100%;
    max-width: 360px;
    padding: 0;
    gap: 28px;
    border: none;
    background: transparent;
  }

  .screen__title {
    font-size: 28px;
    line-height: 36px;
  }

  .screen__lead {
    width: 100%;
    max-width: 350px;
  }
}
