:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #17211b;
  background: #f4f6ef;
  font-synthesis: none;
}

* { box-sizing: border-box; }

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 85% 12%, rgba(151, 190, 141, 0.3), transparent 32rem),
    #f4f6ef;
}

button, input { font: inherit; }

.page-shell {
  width: min(1040px, calc(100% - 40px));
  margin: 0 auto;
  padding: clamp(64px, 10vw, 120px) 0;
}

.intro { max-width: 760px; }

.eyebrow {
  margin: 0 0 14px;
  color: #39734b;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1 {
  max-width: 720px;
  margin: 0;
  font-size: clamp(2.75rem, 7vw, 5.5rem);
  line-height: 0.98;
  letter-spacing: -0.055em;
}

.lede {
  max-width: 650px;
  margin: 28px 0 0;
  color: #526158;
  font-size: clamp(1rem, 2vw, 1.2rem);
  line-height: 1.65;
}

.audit-form { margin-top: 44px; }
.audit-form label { display: block; margin-bottom: 10px; font-weight: 750; }
.input-row { display: flex; gap: 10px; }

input {
  flex: 1;
  min-width: 0;
  padding: 17px 18px;
  border: 1px solid #c7cec3;
  border-radius: 12px;
  outline: none;
  color: #17211b;
  background: rgba(255, 255, 255, 0.84);
  box-shadow: 0 1px 2px rgba(23, 33, 27, 0.04);
  transition: border-color 160ms, box-shadow 160ms;
}

input:focus {
  border-color: #39734b;
  box-shadow: 0 0 0 4px rgba(57, 115, 75, 0.14);
}

button {
  border: 0;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 750;
}

#submit-button {
  min-width: 132px;
  padding: 0 22px;
  color: white;
  background: #1d4b2b;
  transition: transform 160ms, background 160ms;
}

#submit-button:hover:not(:disabled) { background: #28623a; transform: translateY(-1px); }
#submit-button:disabled { cursor: wait; opacity: 0.75; }

.spinner {
  display: none;
  width: 18px;
  height: 18px;
  margin: auto;
  border: 2px solid rgba(255, 255, 255, 0.45);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

#submit-button.loading .button-label { display: none; }
#submit-button.loading .spinner { display: block; }
@keyframes spin { to { transform: rotate(360deg); } }

.hint { margin: 10px 0 0; color: #738078; font-size: 0.86rem; }

.result-panel {
  margin-top: 64px;
  overflow: hidden;
  border: 1px solid #d6dcd2;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 20px 60px rgba(29, 75, 43, 0.08);
}

.result-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 24px 26px;
  border-bottom: 1px solid #e1e5de;
}

.result-heading .eyebrow { margin-bottom: 5px; }
h2 { margin: 0; font-size: 1.25rem; }
.result-url {
  max-width: 680px;
  margin: 6px 0 0;
  overflow: hidden;
  color: #6b776f;
  font-size: 0.9rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.copy-button {
  padding: 9px 13px;
  color: #255b36;
  background: #e4eee3;
}
.copy-button:hover { background: #d9e8d8; }

.status-message { display: none; margin: 0; padding: 16px 26px; font-weight: 650; }
.status-message.error { display: block; color: #8b2929; background: #fff0ee; }
.status-message.success { display: block; color: #2e6a40; background: #edf7ec; }

.report-content { padding: 26px; }

.score-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 24px;
  padding: 24px;
  border: 1px solid #dfe5dc;
  border-radius: 16px;
  background: linear-gradient(135deg, #f7faf4, #edf5e9);
}

.score-ring {
  display: grid;
  width: 108px;
  height: 108px;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(#39734b var(--score, 0%), #dce5d9 0);
  position: relative;
}
.score-ring::before {
  position: absolute;
  width: 82px;
  height: 82px;
  border-radius: inherit;
  background: #f8faf6;
  content: "";
}
.score-ring div { z-index: 1; text-align: center; }
.score-ring strong { display: block; font-size: 1.8rem; line-height: 1; }
.score-ring span { color: #68746c; font-size: 0.72rem; }
.score-label { margin: 0 0 5px; color: #39734b; font-size: 0.74rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }
.score-copy h3 { margin: 0; font-size: 1.4rem; }
.score-copy > p:last-child { max-width: 510px; margin: 7px 0 0; color: #657169; line-height: 1.5; }
.score-stats { display: flex; gap: 22px; padding-left: 24px; border-left: 1px solid #d7dfd4; }
.score-stats div { min-width: 80px; }
.score-stats strong { display: block; font-size: 1.55rem; }
.score-stats span { display: block; color: #6a766e; font-size: 0.78rem; line-height: 1.25; }

.check-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin-top: 18px; }
.check-card { padding: 20px; border: 1px solid #e0e5dd; border-radius: 14px; background: #fff; }
.check-card-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.check-card-title { display: flex; align-items: center; gap: 10px; }
.check-icon { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 10px; color: #326542; background: #eaf3e7; font-size: 1rem; }
.check-card h3 { margin: 0; font-size: 1rem; }
.badge { padding: 5px 9px; border-radius: 999px; font-size: 0.7rem; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; }
.badge.pass { color: #23603a; background: #e3f3e5; }
.badge.warn { color: #8a5b12; background: #fff0ce; }
.badge.fail { color: #973a35; background: #fbe5e2; }
.check-summary { margin: 15px 0 0; color: #34443a; font-weight: 700; }
.check-detail { margin: 6px 0 0; color: #718078; font-size: 0.86rem; line-height: 1.5; }
.agent-list { display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0 0; padding: 0; list-style: none; }
.agent-list li { padding: 4px 8px; border-radius: 6px; color: #59665e; background: #f1f4ef; font-size: 0.72rem; }

.technical-details { margin-top: 18px; border: 1px solid #dfe4dc; border-radius: 12px; overflow: hidden; }
.technical-details summary { padding: 15px 18px; cursor: pointer; color: #334238; font-weight: 750; }
.technical-details summary span { float: right; color: #7b867f; font-size: 0.78rem; font-weight: 500; }

pre {
  max-height: 580px;
  margin: 0;
  overflow: auto;
  padding: 26px;
  color: #d9e8da;
  background: #17211b;
  font: 0.88rem/1.65 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

@media (max-width: 620px) {
  .page-shell { width: min(100% - 28px, 960px); padding-top: 48px; }
  .input-row { flex-direction: column; }
  #submit-button { min-height: 54px; }
  .result-panel { margin-top: 40px; }
  .result-heading, pre, .report-content { padding: 20px; }
  .score-card { grid-template-columns: auto 1fr; gap: 16px; padding: 18px; }
  .score-ring { width: 88px; height: 88px; }
  .score-ring::before { width: 66px; height: 66px; }
  .score-ring strong { font-size: 1.45rem; }
  .score-stats { grid-column: 1 / -1; justify-content: space-around; padding: 16px 0 0; border-top: 1px solid #d7dfd4; border-left: 0; }
  .check-grid { grid-template-columns: 1fr; }
  .technical-details summary span { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
