:root {
  --bg: #f4efe6;
  --bg-accent: #efe4d3;
  --surface: rgba(255, 251, 245, 0.88);
  --surface-strong: #fffaf3;
  --ink: #1f2430;
  --muted: #5e645d;
  --line: rgba(31, 36, 48, 0.12);
  --brand: #214e5e;
  --brand-soft: #d7e8ea;
  --alert: #9d3d2d;
  --alert-soft: #f7ddd6;
  --safe: #365b43;
  --safe-soft: #dcebdd;
  --shadow: 0 18px 38px rgba(39, 31, 24, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: "Avenir Next", "Segoe UI", "Helvetica Neue", sans-serif;
  background:
    radial-gradient(
      circle at top left,
      rgba(33, 78, 94, 0.16),
      transparent 32%
    ),
    radial-gradient(
      circle at bottom right,
      rgba(157, 61, 45, 0.12),
      transparent 26%
    ),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-accent) 100%);
  min-height: 100vh;
}

code,
pre,
summary {
  font-family: "SFMono-Regular", "Menlo", "Consolas", monospace;
}

.shell {
  width: min(1180px, calc(100vw - 2rem));
  margin: 0 auto;
  padding: 2rem 0 4rem;
}

.login-shell {
  width: min(520px, calc(100vw - 2rem));
  min-height: 100vh;
  margin: 0 auto;
  display: grid;
  place-items: center;
  padding: 2rem 0;
}

.hero {
  padding: 1rem 0 1.5rem;
}

.eyebrow {
  margin: 0 0 0.35rem;
  color: var(--brand);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  font-family: "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  line-height: 1.08;
  margin: 0;
}

h1 {
  font-size: clamp(1.8rem, 4.2vw, 3.45rem);
  letter-spacing: -0.03em;
  max-width: 100%;
}

h2 {
  font-size: 1.5rem;
  margin-bottom: 0.4rem;
}

h3 {
  font-size: 1rem;
  margin: 1rem 0 0.45rem;
}

.intro,
.subtle,
p,
li {
  line-height: 1.55;
}

.intro {
  margin: 0.9rem 0 0;
  color: var(--muted);
  font-size: 1.03rem;
}

.intro-strong {
  color: var(--ink);
  font-size: 1.12rem;
}

.privacy-note {
  padding: 0.95rem 1rem;
  border: 1px solid rgba(54, 91, 67, 0.18);
  border-radius: 18px;
  background: rgba(220, 235, 221, 0.88);
  color: #2f5140;
}

.session-actions {
  margin-top: 0.9rem;
}

.session-actions a {
  color: var(--brand);
  font-weight: 800;
  text-decoration: none;
}

.session-actions a:hover {
  text-decoration: underline;
}

.instruction-box {
  margin-bottom: 1.1rem;
  padding: 1rem 1rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.48);
}

.instruction-box h3 {
  margin-top: 0;
  margin-bottom: 0.45rem;
}

.instruction-list {
  margin: 0 0 0;
  padding-left: 1.3rem;
  margin-bottom: 2rem;
}

.instruction-list li + li {
  margin-top: 0.45rem;
}

.card {
  background: var(--surface);
  backdrop-filter: blur(18px);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
  padding: 1.35rem;
}

.form-card {
  margin-bottom: 1.35rem;
}

.login-card {
  width: 100%;
}

.login-card h1 {
  white-space: normal;
}

.login-form {
  display: grid;
  gap: 1rem;
  margin-top: 1.35rem;
}

.login-error {
  margin-top: 1rem;
  padding: 0.85rem 1rem;
  border: 1px solid rgba(157, 61, 45, 0.22);
  border-radius: 16px;
  background: rgba(247, 221, 214, 0.68);
  color: var(--alert);
  font-weight: 700;
}

.card-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.pill,
.status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0.4rem 0.8rem;
  white-space: nowrap;
}

.pill {
  background: var(--brand-soft);
  color: var(--brand);
}

.status-badge {
  text-transform: capitalize;
}

.status-badge.benign {
  background: var(--safe-soft);
  color: var(--safe);
}

.status-badge.malicious {
  background: var(--alert-soft);
  color: var(--alert);
}

.status-badge.unknown {
  background: #ece9e2;
  color: #4d5558;
}

.upload-form {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(0, 0.85fr);
  gap: 1rem;
  align-items: end;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.field-wide {
  grid-column: 1 / 2;
}

.action-field {
  justify-content: flex-end;
}

.field span {
  font-size: 0.9rem;
  font-weight: 700;
}

.field small,
.subtle {
  color: var(--muted);
}

input[type="file"],
input[type="number"] {
  width: 100%;
  border: 1px solid rgba(31, 36, 48, 0.18);
  border-radius: 16px;
  padding: 0.9rem 1rem;
  background: var(--surface-strong);
  color: var(--ink);
  font: inherit;
}

button {
  border: 0;
  border-radius: 999px;
  padding: 0.95rem 1.35rem;
  font: inherit;
  font-weight: 800;
  color: #fff7f2;
  background: linear-gradient(135deg, #204b65 0%, #3e6b66 100%);
  cursor: pointer;
  transition:
    transform 120ms ease,
    box-shadow 120ms ease,
    opacity 120ms ease;
  box-shadow: 0 12px 24px rgba(32, 75, 101, 0.18);
}

button:hover {
  transform: translateY(-1px);
}

button:disabled {
  opacity: 0.72;
  cursor: wait;
  transform: none;
}

.error-card {
  border-color: rgba(157, 61, 45, 0.22);
  background: rgba(247, 221, 214, 0.65);
}

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

.preview-card,
.decision-card {
  min-height: 100%;
}

.preview-image {
  width: 100%;
  display: block;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: #f9f4ec;
  margin-bottom: 1rem;
}

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

.metric {
  padding: 0.9rem 1rem;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.48);
}

.metric-large {
  margin-bottom: 1rem;
}

.metric-label {
  display: block;
  color: var(--muted);
  font-size: 0.85rem;
  margin-bottom: 0.28rem;
}

.metric strong {
  font-size: 1.05rem;
}

.plain-list {
  margin: 0;
  padding-left: 1.2rem;
}

.plain-list li + li {
  margin-top: 0.35rem;
}

.mono-block {
  margin: 0.35rem 0 0;
  padding: 1rem;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(28, 33, 43, 0.93);
  color: #f3eee6;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

.json-block {
  margin-top: 0.7rem;
  white-space: pre;
  word-break: normal;
  line-height: 1.45;
  tab-size: 2;
}

details {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 0.9rem 1rem;
  background: rgba(255, 255, 255, 0.5);
}

details + details {
  margin-top: 0.8rem;
}

summary {
  cursor: pointer;
  font-weight: 700;
}

.details-card {
  grid-column: 1 / -1;
}

@media (max-width: 900px) {
  .upload-form,
  .results-grid,
  .meta-row {
    grid-template-columns: 1fr;
  }

  .field-wide {
    grid-column: auto;
  }
}

@media (min-width: 960px) {
  h1 {
    white-space: nowrap;
  }
}
