:root {
  --green-strong: #0e9f4f;
  --green: #3fb968;
  --orange: #f0932b;
  --red: #e05252;
  --ink: #1a2233;
  --muted: #5c6675;
  --bg: #f5f7fa;
  --card: #ffffff;
  --border: #e2e8f0;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --radius: 10px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Inter", sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

main { max-width: 760px; margin: 0 auto; padding: 24px 20px; }

h1, h2, h3 { line-height: 1.25; }

/* ---------- Flat icons ---------- */
.icon-inline {
  width: 1em; height: 1em;
  vertical-align: -0.125em;
  fill: currentColor;
}
.icon-muted { fill: var(--muted); }

.step-icon {
  width: 52px; height: 52px;
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 14px;
}
.step-icon svg { width: 26px; height: 26px; }
.icon-blue  { background: #dbe7fd; } .icon-blue svg  { fill: var(--primary); }
.icon-green { background: #d9f2e3; } .icon-green svg { fill: var(--green-strong); }
.icon-red   { background: #fbe0e0; } .icon-red svg   { fill: var(--red); }

.logo-mark { margin-bottom: 16px; }
.logo-mark svg { border-radius: var(--radius); }

/* ---------- Hero ---------- */
.hero { text-align: center; padding: 48px 0 40px; }
.hero h1 { font-size: 1rem; font-weight: 600; color: var(--primary); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 16px; }
.hero-headline { font-size: clamp(2rem, 6vw, 3rem); font-weight: 800; line-height: 1.15; margin-bottom: 14px; }
.hero-sub { font-size: 1.1rem; color: var(--muted); max-width: 520px; margin: 0 auto 32px; }

.check-form { display: flex; flex-direction: column; gap: 12px; max-width: 520px; margin: 0 auto; }
#url-input {
  padding: 15px 18px; font-size: 1.05rem;
  border: 2px solid var(--border);
  border-radius: var(--radius); outline: none; width: 100%;
  background: var(--card);
}
#url-input:focus { border-color: var(--primary); }

/* ---------- Flat buttons: no shadows, no transforms ---------- */
.btn {
  border: none; border-radius: var(--radius); font-size: 1rem; font-weight: 700;
  padding: 14px 24px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-lg { padding: 15px 28px; font-size: 1.1rem; }
.btn-ghost { background: var(--card); color: var(--ink); border: 2px solid var(--border); }
.btn-ghost:hover { border-color: var(--primary); color: var(--primary); }
.btn-secondary { background: #dbe7fd; color: var(--primary); }
.btn-secondary:hover { background: #c9dbfb; }

.trust-line { margin-top: 14px; font-size: 0.9rem; color: var(--muted); }
.trust-line .icon-inline { fill: var(--green-strong); }
.input-error { color: var(--red); margin-top: 10px; font-weight: 600; }

/* ---------- Flat cards: border instead of shadow ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

.how-it-works, .edu, .faq { padding: 40px 0; }
.how-it-works h2, .edu h2, .faq h2 { text-align: center; margin-bottom: 28px; font-size: 1.6rem; }
.steps { display: grid; gap: 14px; }
.step { text-align: center; }
.step h3 { margin-bottom: 6px; font-size: 1.05rem; }
.step p { color: var(--muted); font-size: 0.95rem; }

.edu-grid { display: grid; gap: 14px; }
.edu-item { text-align: center; }
.edu-item h3 { margin-bottom: 8px; font-size: 1.05rem; }
.edu-item p { color: var(--muted); font-size: 0.95rem; }

.faq details { margin-bottom: 10px; padding: 18px 22px; }
.faq summary { font-weight: 700; cursor: pointer; }
.faq details p { margin-top: 10px; color: var(--muted); }
.faq details[open] { border-color: var(--primary); }

/* ---------- Loading ---------- */
.loading-wrap { text-align: center; padding: 120px 0; }
.spinner {
  width: 56px; height: 56px; border: 5px solid var(--border); border-top-color: var(--primary);
  border-radius: 50%; margin: 0 auto 24px; animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-message { font-size: 1.15rem; font-weight: 600; min-height: 1.6em; }
.progress-track { height: 8px; background: var(--border); border-radius: 4px; max-width: 320px; margin: 24px auto 0; overflow: hidden; }
.progress-bar { height: 100%; width: 0%; background: var(--primary); transition: width 0.8s ease; }

/* ---------- Results ---------- */
.result-hero { text-align: center; padding: 32px 0 24px; }
.result-site { font-weight: 700; color: var(--muted); font-size: 1.05rem; margin-bottom: 20px; }

.grade-circle { position: relative; width: 180px; height: 180px; margin: 0 auto 20px; }
.gauge { width: 100%; height: 100%; transform: rotate(-90deg); }
.gauge-track { fill: none; stroke: var(--border); stroke-width: 10; }
.gauge-fill {
  fill: none; stroke-width: 10; stroke-linecap: butt;   /* flat line ends */
  stroke-dasharray: 326.7; stroke-dashoffset: 326.7;
  transition: stroke-dashoffset 1.2s ease, stroke 0.3s;
}
.grade-inner {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
}
.grade-letter { font-size: 4rem; font-weight: 800; line-height: 1; }
.grade-label { font-size: 0.85rem; font-weight: 800; letter-spacing: 0.15em; color: var(--muted); }

.score-line { color: var(--muted); margin-bottom: 20px; }
.result-hero h2 { font-size: 1.5rem; margin-bottom: 10px; }
.result-text { color: var(--muted); max-width: 520px; margin: 0 auto 12px; }
.result-status { font-weight: 700; }

/* ---------- Overview ---------- */
.overview { padding: 24px 0; }
.overview h3, .recs h3 { font-size: 1.3rem; margin-bottom: 16px; }
.overview-grid { display: grid; gap: 10px; }
.metric { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; }
.metric-name { font-weight: 600; display: inline-flex; align-items: center; gap: 8px; }
.metric-value { font-weight: 800; padding: 4px 14px; border-radius: 6px; font-size: 0.9rem; }
.tone-green { background: #d9f2e3; color: var(--green-strong); }
.tone-orange { background: #fbecd7; color: #b06a10; }
.tone-red { background: #fbe0e0; color: var(--red); }

/* ---------- Recommendations: flat with accent bar ---------- */
.recs { padding: 12px 0 24px; }
.rec-card { margin-bottom: 10px; border-left: 4px solid var(--orange); }
.rec-problem { font-weight: 800; font-size: 1.05rem; margin-bottom: 6px; }
.rec-why { color: var(--muted); font-size: 0.95rem; margin-bottom: 8px; }
.rec-action { font-size: 0.95rem; }
.rec-action strong { color: var(--primary); }

/* ---------- Conversion: flat solid block ---------- */
.convert { text-align: center; margin: 24px 0; padding: 32px 24px; background: #eef3fd; border-color: #c9dbfb; }
.convert h3 { font-size: 1.35rem; margin-bottom: 10px; }
.convert p { color: var(--muted); margin-bottom: 20px; max-width: 480px; margin-left: auto; margin-right: auto; }
.convert .btn { margin: 6px; }

/* ---------- Email / Actions ---------- */
.email-report { margin-bottom: 24px; text-align: center; }
.email-report h3 { margin-bottom: 14px; font-size: 1.15rem; }
.email-form { display: flex; flex-direction: column; gap: 10px; max-width: 420px; margin: 0 auto; }
#email-input { padding: 13px 16px; border: 2px solid var(--border); border-radius: var(--radius); font-size: 1rem; outline: none; }
#email-input:focus { border-color: var(--primary); }
#email-status { margin-top: 12px; font-weight: 600; color: var(--green-strong); }

.actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; padding-bottom: 24px; }

.tech-details { max-width: 560px; margin: 0 auto 40px; color: var(--muted); font-size: 0.9rem; }
.tech-details summary { cursor: pointer; text-align: center; font-weight: 600; }
.tech-details table { width: 100%; margin-top: 14px; border-collapse: collapse; }
.tech-details td { padding: 8px 4px; border-bottom: 1px solid var(--border); }

/* ---------- Error ---------- */
.error-wrap { text-align: center; margin: 80px auto; max-width: 460px; padding: 40px 28px; }
.error-wrap h2 { margin-bottom: 10px; }
.error-wrap p { color: var(--muted); margin-bottom: 24px; }

.site-footer { text-align: center; padding: 32px 20px; color: var(--muted); font-size: 0.9rem; border-top: 1px solid var(--border); margin-top: 24px; }

/* ---------- Desktop ---------- */
@media (min-width: 640px) {
  .check-form { flex-direction: row; }
  #url-input { flex: 1; }
  .steps { grid-template-columns: repeat(3, 1fr); }
  .edu-grid { grid-template-columns: repeat(2, 1fr); }
  .email-form { flex-direction: row; }
  #email-input { flex: 1; }
}
