@font-face {
  font-family: "SignatureAPI Title";
  src: url("fonts/SignatureAPITitle-Medium.ttf") format("truetype");
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("fonts/Inter-Regular.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("fonts/Inter-Medium.ttf") format("truetype");
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("fonts/Inter-SemiBold.ttf") format("truetype");
  font-weight: 600;
  font-display: swap;
}

:root {
  --text: #18181b;
  --text-secondary: #3f3f46;
  --text-tertiary: #686870;
  --border: #e0e3e9;
  --background: #f9f9f9;
  --card: #ffffff;
  --hover: #f0f1f4;
  --accent: #2563eb;
  --success: #15803d;
  --success-soft: #dcfce7;
  --danger: #b91c1c;
  --danger-soft: #fee2e2;
  --warning: #b45309;
  --warning-soft: #fef3c7;
  --radius: 10px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
[hidden] { display: none !important; }

body {
  display: flex;
  font-family: "Inter", system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.45;
  color: var(--text-secondary);
  background: var(--background);
}

h1, h2 { font-family: "SignatureAPI Title", "Inter", system-ui, sans-serif; font-weight: 500; color: var(--text); }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.92em; }
a { color: var(--accent); }

aside {
  width: 30%;
  min-width: 260px;
  flex-shrink: 0;
  border-right: 1px solid var(--border);
  padding: 24px 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  overflow-y: auto;
}
aside h1 { font-size: 24px; line-height: 1.2; margin-bottom: 4px; }
aside h2, aside label {
  display: block;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-tertiary);
  margin-bottom: 6px;
}
aside section { display: flex; flex-direction: column; }
aside footer { margin-top: auto; font-size: 12px; color: var(--text-tertiary); }

input {
  width: 100%;
  padding: 9px 10px;
  font: inherit;
  font-size: 13px;
  color: var(--text);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 8px;
}

button {
  padding: 10px 14px;
  font: inherit;
  font-weight: 500;
  color: var(--text);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
}
button:hover { background: var(--hover); }
button.primary { color: #fff; background: var(--text); border-color: var(--text); font-weight: 600; }
button.primary:hover { background: #27272a; }
button:disabled { opacity: 0.6; cursor: default; }
input:focus-visible, button:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.error { margin-top: 8px; font-size: 13px; color: var(--danger); }
.hint { font-size: 13px; color: var(--text-tertiary); }

.events { min-height: 0; }
#events { list-style: none; display: flex; flex-direction: column; gap: 6px; }
#events li {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  font-size: 12px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow-wrap: anywhere;
}
#events li.rejected { color: var(--warning); background: var(--warning-soft); border-color: transparent; }
#events time { flex-shrink: 0; color: var(--text-tertiary); font-variant-numeric: tabular-nums; }

main { flex: 1; min-width: 0; display: flex; }
iframe { flex: 1; width: 100%; height: 100%; border: none; display: block; background: var(--card); }

.panel {
  margin: auto;
  padding: 24px;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
}
.panel h2 { font-size: 28px; line-height: 1.2; }
.panel p { font-size: 16px; }
.actions { display: flex; flex-direction: column; gap: 8px; width: 100%; margin-top: 12px; }

.document {
  width: 56px;
  height: 72px;
  padding: 11px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 5px;
  margin-bottom: 8px;
}
.document i { height: 4px; border-radius: 2px; background: var(--hover); }
.document i:last-child { width: 60%; background: var(--accent); opacity: 0.5; }

.badge {
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  font-size: 30px;
  font-weight: 600;
  border-radius: 50%;
  margin-bottom: 4px;
}
.badge.success { color: var(--success); background: var(--success-soft); }
.badge.neutral { color: var(--text-secondary); background: var(--hover); }
.badge.warning { color: var(--warning); background: var(--warning-soft); }
.badge.danger { color: var(--danger); background: var(--danger-soft); }
.badge.pending { border: 3px solid var(--hover); border-top-color: var(--text); animation: spin 0.8s linear infinite; width: 44px; height: 44px; margin: 14px 0 18px; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .badge.pending { animation-duration: 4s; } }

@media (max-width: 720px) {
  body { flex-direction: column; }
  aside { width: 100%; border-right: none; border-bottom: 1px solid var(--border); gap: 14px; padding: 16px; overflow-y: visible; }
  aside footer, .events { display: none; }
  main { min-height: 70vh; }
}
