:root {
  --color-text: #111827;
  --color-link: #4f46e5;
  --color-link-hover: #818cf8;
  --color-muted: #9ca3af;
  --color-muted-strong: #6b7280;
  --color-surface: #ffffff;
  --color-surface-muted: #e5e7eb;
  --color-ring: #d1d5db;
  --color-focus: #4f46e5;
  --color-primary: #4f46e5;
  --color-root-bg: #ffffff;
  --color-page-bg: #e5e7eb;
}

.dark {
  --color-text: #f3f4f6;
  --color-link: #818cf8;
  --color-link-hover: #a5b4fc;
  --color-muted: #d1d5db;
  --color-muted-strong: #d1d5db;
  --color-surface: #111827;
  --color-surface-muted: #1f2937;
  --color-ring: #6b7280;
  --color-focus: #818cf8;
  --color-root-bg: #030712;
  --color-page-bg: #111827;
}

/* Preflight-lite: core browser-normalization defaults */
*,
*::before,
*::after {
  box-sizing: border-box;
}

button,
input,
optgroup,
select,
textarea {
  font: inherit;
  color: inherit;
  letter-spacing: inherit;
}

img,
svg,
video,
canvas,
audio,
iframe,
embed,
object {
  display: block;
  max-width: 100%;
}

img,
video {
  height: auto;
}

table {
  border-collapse: collapse;
  border-color: inherit;
}

[hidden]:not([hidden="until-found"]) {
  display: none !important;
}

input::placeholder,
textarea::placeholder {
  opacity: 1;
  color: #9ca3af;
}

html {
  min-height: 100%;
  background-color: var(--color-root-bg);
  line-height: 1.5;
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100%;
  background-color: var(--color-page-bg);
  color: var(--color-text);
  font-family: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
}

.page-shell {
  display: flex;
  min-height: 100%;
  flex-direction: column;
  justify-content: center;
  padding: 3rem 1.5rem;
}

@media (min-width: 1024px) {
  .page-shell {
    padding-left: 2.25rem;
    padding-right: 2.25rem;
  }
}

.section-wrap {
  width: 100%;
  margin-bottom: 1rem;
}

@media (min-width: 640px) {
  .section-wrap {
    margin-left: auto;
    margin-right: auto;
    max-width: 24rem;
  }
}

@media (min-width: 768px) {
  .section-wrap {
    max-width: 28rem;
  }
}

@media (min-width: 1024px) {
  .section-wrap {
    max-width: 32rem;
  }
}

@media (min-width: 1280px) {
  .section-wrap {
    max-width: 36rem;
  }
}

.section-wrap h1 {
  margin-top: 0.75rem;
  text-align: left;
  font-size: 2.25rem;
  line-height: 2.25rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--color-text);
}

.section-wrap h2 {
  text-align: left;
  font-size: 1.5rem;
  line-height: 2.25rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--color-text);
}

.section-wrap h3 {
  text-align: left;
  font-size: 1.25rem;
  line-height: 2.25rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--color-text);
}

#specification-details,
#settings,
#industry-standard,
#other-options {
  margin-top: 2.5rem;
}

#optional {
  margin-top: 0.75rem;
}

#setup-verification {
  margin-top: 1.25rem;
}

#draft-link {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

p:not(.hint-text):not(#simulatedSignInMessage) {
  margin-top: 1.25rem;
  text-align: left;
  font-size: 1rem;
  color: var(--color-text);
}

#other-options-description {
  margin-top: 0.5rem;
  padding-bottom: 1em;
}

p:not(.hint-text):not(#simulatedSignInMessage) a {
  color: var(--color-link);
  line-height: 1.5rem;
  text-decoration: underline;
}

p:not(.hint-text):not(#simulatedSignInMessage) a:hover {
  color: var(--color-link-hover);
}

.section-wrap ul {
  margin-top: 0.5rem;
  padding-left: 1.5rem;
  color: var(--color-text);
}

.section-wrap li {
  margin-top: 0.25rem;
}

.section-wrap li::marker {
  color: var(--color-muted);
}

.link {
  color: var(--color-link);
  line-height: 1.5rem;
  font-weight: 600;
  text-decoration: none;
}

.link:hover {
  color: var(--color-link-hover);
}

.domain {
  font-weight: 600;
}

#uri_link_text {
  white-space: nowrap;
}

.field-group {
  margin-top: 1rem;
}

.field-control {
  margin-top: 0.5rem;
}

.action-group {
  margin-top: 1.5rem;
}

.form-label {
  display: block;
  font-size: 0.875rem;
  line-height: 1.5rem;
  font-weight: 500;
  color: var(--color-text);
}

.control-input,
.control-textarea {
  display: block;
  width: 100%;
  border: 0;
  border-radius: 0.375rem;
  padding: 0.375rem 0.75rem;
  color: var(--color-text);
  background-color: var(--color-surface);
  outline: none;
  box-shadow: inset 0 0 0 1px var(--color-ring), 0 1px 2px rgb(0 0 0 / 0.05);
}

.control-input::placeholder,
.control-textarea::placeholder {
  color: #9ca3af;
}

.control-input:focus,
.control-textarea:focus {
  box-shadow: inset 0 0 0 2px var(--color-focus), 0 1px 2px rgb(0 0 0 / 0.05);
}

@media (min-width: 640px) {
  .control-input,
  .control-textarea {
    font-size: 0.875rem;
    line-height: 1.5rem;
  }
}

.control-input-readonly,
.control-textarea-readonly {
  color: var(--color-muted-strong);
  background-color: var(--color-surface-muted);
}

.control-mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

.totp-wrap {
  margin-top: 1rem;
}

@media (min-width: 640px) {
  .totp-wrap {
    margin-left: auto;
    margin-right: auto;
    width: 100%;
    max-width: 24rem;
  }
}

.totp-label {
  display: block;
  font-size: 0.875rem;
  line-height: 1.5rem;
  font-weight: 500;
  color: var(--color-text);
}

.totp-label.is-valid {
  color: #16a34a;
}

.dark .totp-label.is-valid {
  color: #4ade80;
}

.totp-label.is-invalid {
  color: #dc2626;
}

.dark .totp-label.is-invalid {
  color: #f87171;
}

.totp-input {
  display: block;
  width: 100%;
  border: 0;
  border-radius: 0.375rem;
  padding: 0.375rem 0.75rem;
  color: var(--color-text);
  background-color: var(--color-surface);
  outline: none;
  box-shadow: inset 0 0 0 1px var(--color-ring), 0 1px 2px rgb(0 0 0 / 0.05);
}

.totp-input::placeholder {
  color: #9ca3af;
}

.totp-input:focus {
  box-shadow: inset 0 0 0 2px var(--color-focus), 0 1px 2px rgb(0 0 0 / 0.05);
}

.totp-input.is-valid {
  box-shadow: inset 0 0 0 1px #16a34a, 0 1px 2px rgb(0 0 0 / 0.05);
}

.totp-input.is-valid:focus {
  box-shadow: inset 0 0 0 2px #16a34a, 0 1px 2px rgb(0 0 0 / 0.05);
}

.totp-input.is-invalid {
  box-shadow: inset 0 0 0 1px #dc2626, 0 1px 2px rgb(0 0 0 / 0.05);
}

.totp-input.is-invalid:focus {
  box-shadow: inset 0 0 0 2px #dc2626, 0 1px 2px rgb(0 0 0 / 0.05);
}

@media (min-width: 640px) {
  .totp-input {
    font-size: 1.875rem;
    line-height: 1.5rem;
  }
}

.secret-card {
  display: block;
  width: 100%;
  border-radius: 0.375rem;
  padding-top: 0.375rem;
  padding-bottom: 0.375rem;
  color: var(--color-muted-strong);
  box-shadow: inset 0 0 0 1px var(--color-ring), 0 1px 2px rgb(0 0 0 / 0.05);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-weight: 600;
  background-color: var(--color-surface-muted);
}

.secret-card.is-open {
  background-color: #ffffff;
  color: #6b7280;
}

@media (min-width: 640px) {
  .secret-card {
    font-size: 0.875rem;
    line-height: 1.5rem;
  }
}

#secretText {
  font-weight: 600;
}

.primary-action {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 0.375rem;
  background-color: var(--color-primary);
  padding: 0.375rem 0.75rem;
  font-size: 0.875rem;
  line-height: 1.5rem;
  font-weight: 600;
  color: #ffffff;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.05);
}

.primary-action:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.primary-action:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

button {
  display: block;
  width: 100%;
}

@media (min-width: 640px) {
  button:not(.inline-action) {
    max-width: 24rem;
    margin-left: auto;
    margin-right: auto;
  }
}

.hint-text {
  margin-top: 0.5rem;
  margin-bottom: 1.5rem;
  margin-left: 1.5rem;
  margin-right: 1.5rem;
  text-align: center;
  font-size: 0.875rem;
  color: var(--color-muted);
}

.row-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.inline-action {
  border: 0;
  background: transparent;
  display: block;
  width: 100%;
  margin-top: 0.5rem;
  padding: 0;
  font-size: 0.875rem;
  line-height: 1.5rem;
  font-weight: 600;
  color: var(--color-link);
  text-align: right;
  cursor: pointer;
}

.inline-action:hover {
  color: var(--color-link-hover);
}

.row-between > .inline-action {
  display: inline-block;
  width: auto;
  margin-top: 0;
  text-align: right;
}

#simulatedSignInMessage {
  text-align: center;
  font-size: 1.125rem;
  line-height: 1.75rem;
  font-weight: 600;
  color: #16a34a;
}

.dark #simulatedSignInMessage {
  color: #4ade80;
}

.qr-stage {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 1em;
}

.qr-icon {
  display: block;
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
}

.qr-icon-svg {
  fill: #6b7280;
}

.dark .qr-icon-svg {
  fill: #9ca3af;
}

.qr-code {
  display: none;
}
