*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  width: 100%;
  overflow: hidden;
  background: #383921;
  font-family: 'Inter', sans-serif;
}

#app {
  height: 100dvh;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* ── Signing iframe wrapper ── */
#frame-wrapper {
  width: 100%;
  height: 100dvh;
  display: none; /* shown via JS */
}

#signing-frame {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

/* ── Error state ── */
#error-state {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 32px 24px;
  text-align: center;
  max-width: 360px;
}

#error-state .icon {
  width: 48px;
  height: 48px;
  opacity: 0.5;
}

#error-state h1 {
  color: #c8c9a0;
  font-family: 'Prata', serif;
  font-size: 1.15rem;
  font-weight: normal;
  letter-spacing: 0.02em;
}

#error-state p {
  color: #7a7b60;
  font-family: 'Inter', sans-serif;
  font-weight: 300;
  font-size: 0.9rem;
  line-height: 1.6;
}

/* ── Loading state ── */
#loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

#logo {
  width: 400px;
  max-width: 60vw;
  margin-bottom: 20px;
  /* opacity: 0.92; */
}

.spinner {
  width: 32px;
  height: 32px;
  border: 2px solid rgba(200, 201, 160, 0.15);
  border-top-color: #c8c9a0;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

#loading-state p {
  color: #7a7b60;
  font-family: 'Inter', sans-serif;
  font-weight: 300;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

#complete-state {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 32px 24px;
  text-align: center;
}

#complete-state h1 {
  color: #c8c9a0;
  font-family: 'Inter', sans-serif;
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

#complete-state p {
  color: #7a7b60;
  font-family: 'Inter', sans-serif;
  font-weight: 300;
  font-size: 0.9rem;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}