.learn-qr-card {
  position: relative;
}

.learn-qr-card:has(learn-qr-login:defined) {
  min-block-size: 360px;
  display: grid;
  align-items: center;
}

.learn-qr-card > .learn-qr-default,
.learn-qr-card > .learn-qr-panel {
  grid-area: 1 / 1;
  min-inline-size: 0;
}

.learn-qr-card[data-qr-open] > .learn-qr-default {
  visibility: hidden;
}

learn-qr-login {
  display: block;
}

.learn-qr-trigger,
.learn-qr-back,
.learn-qr-retry {
  appearance: none;
  cursor: pointer;
  font-family: inherit;
}

.learn-qr-trigger {
  display: flex;
  min-height: 56px;
  width: 100%;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 0;
  border-radius: 8px;
  background: #196747;
  color: #fff;
  padding: 12px;
  text-align: center;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.25;
}

.learn-qr-trigger:hover { background: #064e3b; }

.learn-qr-trigger:focus-visible,
.learn-qr-back:focus-visible,
.learn-qr-retry:focus-visible {
  outline: 2px solid #047857;
  outline-offset: 2px;
}

.learn-qr-mark,
.learn-qr-icon { flex: none; }
.learn-qr-mark { border-radius: 6px; }

.learn-qr-panel {
  display: flex;
  flex-direction: column;
  align-self: stretch;
  color: #0f172a;
  text-align: center;
}

.learn-qr-nav {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 40px;
}

.learn-qr-service {
  display: flex;
  min-inline-size: 0;
  align-items: center;
  gap: 8px;
  color: #0f172a;
  font-size: 14px;
  font-weight: 700;
  line-height: 18px;
  text-align: start;
}

.learn-qr-service-mark {
  display: grid;
  flex: none;
  place-items: center;
  inline-size: 28px;
  block-size: 28px;
  border-radius: 8px;
  background: #eff6ff;
  font-size: 16px;
  line-height: 1;
}

.learn-qr-service-mark[data-service="stock"] { background: #f1f5f9; }
.learn-qr-service-mark[data-service="acc"] { background: #2563eb; color: #fff; }
.learn-qr-service-mark[data-service="bb"] { background: #e7edff; }
.learn-qr-service-mark[data-service="vault"] { background: #102a43; color: #fff; }

.learn-qr-back,
.learn-qr-retry {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #334155;
  font-size: 14px;
  font-weight: 600;
}

.learn-qr-back {
  flex: none;
  min-height: 36px;
  padding: 0 8px;
}

.learn-qr-back:hover,
.learn-qr-retry:hover { background: #f1f5f9; }

.learn-qr-content {
  display: flex;
  flex: auto;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 0 4px 2px;
}

.learn-qr-panel h2,
.learn-qr-panel p { margin: 0; }

.learn-qr-panel h2 {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #0f172a;
  font-size: 16px;
  font-weight: 700;
  line-height: 22px;
}

.learn-qr-hint,
.learn-qr-status {
  color: #475569;
  font-size: 14px;
  line-height: 18px;
}

.learn-qr-status[data-state="pending"] {
  font-size: 12px;
  font-weight: 600;
  line-height: 16px;
}

.learn-qr-status[data-state="authenticated"] {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px;
  border: 1px solid #a7f3d0;
  border-radius: 12px;
  background: #ecfdf5;
  color: #064e3b;
  font-weight: 700;
}

.learn-qr-status[data-state="error"] { color: #be123c; }

.learn-qr-pending {
  display: grid;
  justify-items: center;
  gap: 6px;
  width: 100%;
}

.learn-qr-image {
  display: block;
  width: min(100%, 200px);
  height: auto;
  aspect-ratio: 1;
  border: 1px solid #d1fae5;
  border-radius: 12px;
  background: #fff;
}

.learn-qr-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 4px 8px;
  color: #475569;
  font-size: 12px;
  line-height: 16px;
}

.learn-qr-panel .learn-qr-code {
  box-sizing: border-box;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0 4px;
  max-inline-size: 100%;
  padding: 3px 8px;
  border-radius: 8px;
  background: #ecfdf5;
}

.learn-qr-code strong {
  color: #022c22;
  font-family: ui-monospace, monospace;
  font-size: 16px;
  font-weight: 700;
  line-height: 20px;
  white-space: nowrap;
}

.learn-qr-countdown { font-variant-numeric: tabular-nums; }

.learn-qr-retry {
  min-height: 40px;
  padding: 0 12px;
  border-color: #cbd5e1;
}

.learn-qr-panel [hidden] { display: none; }

@media (max-width: 420px) {
  .learn-qr-image { width: min(100%, 188px); }
}
