:root {
  --loanms-navy: #0a2540;
  --device-width: 390px;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: #0b1524;
}

body.loanms-body {
  min-height: 100vh;
}

#device-frame {
  min-height: 100vh;
}

#app {
  min-height: 100vh;
  background: #f8fafc;
}

.screen-root {
  min-height: 100vh;
  overflow-x: hidden;
}

.screen-root > main,
.screen-root > div {
  max-width: 100%;
}

.demo-controls {
  position: sticky;
  bottom: 0;
  z-index: 50;
  padding: 12px 16px 16px;
  background: #fffbeb;
  border-top: 1px dashed #d97706;
}

.demo-controls p {
  margin: 0 0 8px;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #92400e;
  font-weight: 600;
}

.demo-controls-row {
  display: flex;
  gap: 8px;
}

.demo-controls button {
  flex: 1;
  min-height: 48px;
  border-radius: 12px;
  border: 0;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.demo-success {
  background: #0a2540;
  color: #fff;
}

.demo-fail {
  background: #fff;
  color: #dc2626;
  border: 1.5px solid #dc2626 !important;
}

.doc-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(7, 26, 46, 0.4);
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.doc-modal-card {
  width: 100%;
  max-width: 420px;
  background: #fff;
  border-radius: 24px 24px 0 0;
  padding: 20px 16px 28px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 8px 24px -4px rgba(10, 37, 64, 0.08);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  z-index: 90;
  background: #0a2540;
  color: #fff;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 13px;
  max-width: 320px;
  text-align: center;
}

.loanms-focus :focus-visible {
  outline: 2px solid #3755c3;
  outline-offset: 2px;
}

@media (min-width: 768px) {
  body.loanms-body {
    background: #07101c;
    display: flex;
    justify-content: center;
    align-items: stretch;
    padding: 24px 0;
  }

  #device-frame {
    width: var(--device-width);
    min-height: calc(100vh - 48px);
    max-height: calc(100vh - 48px);
    border-radius: 28px;
    overflow: auto;
    background: #f8fafc;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.35);
    border: 1px solid #1e3a5f;
  }

  #app,
  .screen-root {
    min-height: calc(100vh - 48px);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
