:root {
  --bg: #f3f7f6;
  --bg-accent: #d6ece6;
  --panel: #ffffff;
  --text: #1f2933;
  --muted: #617182;
  --brand: #0b6e6e;
  --brand-dark: #084f4f;
  --ok: #18794e;
  --warn: #b76e00;
  --bad: #b42318;
  --border: #d8e3e1;
  --shadow: 0 18px 48px rgba(19, 37, 45, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Manrope", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 8% 8%, var(--bg-accent), transparent 40%),
    radial-gradient(circle at 90% 88%, #cde7df, transparent 35%),
    var(--bg);
}

.page-shell {
  width: min(1380px, 94vw);
  margin: 56px auto;
}

.hero-card,
.result-head {
  background: linear-gradient(145deg, #ffffff 0%, #f8fcfb 100%);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 34px;
  box-shadow: var(--shadow);
}

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

h1 {
  margin: 10px 0 12px;
  font-size: clamp(1.8rem, 3vw, 2.5rem);
}

.hero-text {
  margin: 0 0 24px;
  color: var(--muted);
  line-height: 1.55;
}

.label {
  display: inline-block;
  margin-bottom: 8px;
  font-weight: 600;
}

.input-row {
  display: flex;
  gap: 10px;
}

input[type="url"] {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 13px 14px;
  font: inherit;
  outline: none;
}

input[type="url"]:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(11, 110, 110, 0.14);
}

button,
.secondary-btn {
  border: 0;
  border-radius: 12px;
  padding: 12px 18px;
  background: linear-gradient(145deg, var(--brand), var(--brand-dark));
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease;
  text-decoration: none;
  display: inline-block;
}

button:hover,
.secondary-btn:hover {
  transform: translateY(-1px);
}

button:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.error-card {
  margin-top: 18px;
  border: 1px solid #ffd8d3;
  background: #fff7f5;
  border-radius: 14px;
  padding: 16px;
}

.error-card h2 {
  margin: 0 0 6px;
  color: var(--bad);
  font-size: 1rem;
}

.error-card p {
  margin: 0;
  color: #8a1d14;
}

.cards-grid {
  margin-top: 20px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px;
}

.metric-card {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px;
  background: var(--panel);
  box-shadow: 0 8px 18px rgba(24, 39, 43, 0.07);
}

.metric-card h2 {
  margin: 0;
  font-size: 0.92rem;
  color: var(--muted);
  font-weight: 700;
}

.metric-card p {
  margin: 10px 0 0;
  font-size: 1.35rem;
  font-weight: 800;
}

.metric-card.ok {
  border-color: #b6e7cb;
  background: #f1fff7;
}

.metric-card.warn {
  border-color: #f3d9ad;
  background: #fffaf2;
}

.metric-card.bad {
  border-color: #f4b8b2;
  background: #fff5f4;
}

.detail-block {
  margin-top: 14px;
  display: grid;
  gap: 14px;
}

.result-panel {
  margin-top: 18px;
  background: linear-gradient(145deg, #ffffff 0%, #f8fcfb 100%);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 24px;
  box-shadow: var(--shadow);
}

.result-head-inline {
  display: block;
}

.result-head-inline h2 {
  margin: 10px 0 10px;
}

.seo-chip {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  min-height: 146px;
}

.seo-chip.good {
  border-color: #b6e7cb;
  background: #f1fff7;
}

.seo-chip.warn {
  border-color: #f3d9ad;
  background: #fffaf2;
}

.seo-chip.bad {
  border-color: #f4b8b2;
  background: #fff5f4;
}

.seo-title {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 700;
}

.seo-score-value {
  margin: 8px 0 4px;
  font-size: 1.2rem;
  font-weight: 800;
}

.badge {
  margin-top: 10px;
  display: inline-block;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 0.78rem;
  font-weight: 700;
}

.badge-neutral {
  background: #ebf1f0;
  color: #4b5b6a;
}

.badge-ok {
  background: #dbf7e8;
  color: #0f693f;
}

.badge-warn {
  background: #fff0d6;
  color: #9a5d00;
}

.badge-bad {
  background: #ffe0dd;
  color: #9c2519;
}

.actions-row {
  margin-top: 16px;
  display: flex;
  gap: 10px;
}

.secondary-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.is-hidden {
  display: none;
}

.full-width p {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.55;
}

.secondary-btn {
  margin-top: 22px;
}

#loading-overlay {
  position: fixed;
  inset: 0;
  display: none;
  place-items: center;
  background: rgba(10, 21, 26, 0.52);
  color: #fff;
  z-index: 999;
  text-align: center;
}

body.is-loading #loading-overlay {
  display: grid;
}

.loader {
  width: 46px;
  height: 46px;
  border: 4px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  margin: 0 auto 10px;
  animation: spin 0.9s linear infinite;
}

.reveal {
  opacity: 0;
  transform: translateY(14px);
  animation: reveal 0.6s ease forwards;
}

.delay-1 {
  animation-delay: 0.1s;
}

.delay-2 {
  animation-delay: 0.2s;
}

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

@keyframes reveal {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 740px) {
  .page-shell {
    margin: 28px auto;
  }

  .hero-card,
  .result-head {
    padding: 22px;
  }

  .input-row {
    flex-direction: column;
  }

  button {
    width: 100%;
  }

  .result-head-inline {
    display: block;
  }

  .actions-row {
    flex-direction: column;
  }
}
