:root {
  --bg: #f4f7fb;
  --panel: #ffffff;
  --text: #1d2939;
  --muted: #475467;
  --accent: #0ea5e9;
  --border: #d0d5dd;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  color: var(--text);
  background: linear-gradient(180deg, #eef6ff 0%, #f8fbff 60%, #f4f7fb 100%);
}

.container {
  width: min(900px, 100%);
  margin: 0 auto;
  padding: 2rem 1rem 3rem;
}

h1 {
  margin-bottom: 0.4rem;
  text-align: center;
}

.hero-image-wrap {
  display: flex;
  justify-content: center;
  margin: 0.5rem 0 0.75rem;
}

.hero-image {
  width: min(640px, 100%);
  height: auto;
  border-radius: 14px;
  border: 1px solid var(--border);
  box-shadow: 0 8px 20px rgba(16, 24, 40, 0.08);
}

.subtitle {
  margin-top: 0;
  color: var(--muted);
  text-align: center;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem;
  box-shadow: 0 8px 20px rgba(16, 24, 40, 0.05);
  margin-top: 1rem;
}

.controls {
  display: flex;
  gap: 0.75rem;
  align-items: flex-end;
  flex-wrap: wrap;
}

.field-group {
  flex: 1 1 260px;
  min-width: 220px;
}

.controls label {
  display: block;
  margin-bottom: 0.4rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.controls input {
  height: 40px;
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0 0.75rem;
  font-size: 0.95rem;
}

button {
  height: 40px;
  border: 0;
  border-radius: 8px;
  padding: 0 1rem;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

#loadButton {
  flex: 0 0 auto;
}

.status {
  color: var(--muted);
  margin-bottom: 0.75rem;
}

.pay-now-wrap {
  display: flex;
  justify-content: flex-end;
  margin-top: 1.75rem;
}

.pay-now-wrap button {
  width: 100%;
  max-width: 100%;
}

.results {
  display: grid;
  gap: 0.75rem;
}

.card {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.75rem;
}

.doc-id {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 0.5rem;
}

.image-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.6rem;
}

.image-slot {
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: #f8fafc;
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.image-slot img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  display: block;
}

.image-missing {
  padding: 0.75rem;
  color: var(--muted);
  font-size: 0.85rem;
  text-align: center;
}

@media (max-width: 640px) {
  .controls {
    align-items: stretch;
  }

  .field-group {
    min-width: 0;
    width: 100%;
  }

  #loadButton,
  .pay-now-wrap button {
    width: 100%;
  }

  .image-grid {
    grid-template-columns: 1fr;
  }
}
