/* ===== Variables ===== */
:root {
  --c-primary:       #2563eb;
  --c-primary-dark:  #1d4ed8;
  --c-success:       #16a34a;
  --c-warning:       #d97706;
  --c-danger:        #dc2626;
  --c-bg:            #f1f5f9;
  --c-card:          #ffffff;
  --c-text:          #1e293b;
  --c-muted:         #64748b;
  --c-border:        #e2e8f0;
  --radius:          12px;
  --shadow:          0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.05);
  --shadow-lg:       0 8px 30px rgba(0,0,0,.12);
}

/* ===== Reset ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
img { display: block; max-width: 100%; }

/* ===== Base ===== */
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Hiragino Kaku Gothic ProN', 'Hiragino Sans', Meiryo, sans-serif;
  background: var(--c-bg);
  color: var(--c-text);
  line-height: 1.7;
  font-size: 16px;
}

.container {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 16px;
}

.hidden { display: none !important; }

/* ===== Header ===== */
.site-header {
  background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 100%);
  color: #fff;
  text-align: center;
  padding: 56px 16px 80px;
}
.site-header__eyebrow {
  font-size: .8rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  opacity: .75;
  margin-bottom: 8px;
}
.site-header__title {
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 800;
  letter-spacing: -.01em;
  margin-bottom: 12px;
}
.site-header__sub {
  font-size: 1rem;
  opacity: .85;
  max-width: 480px;
  margin: 0 auto;
}

/* ===== Checker form ===== */
.checker-section {
  margin-top: -40px;
  margin-bottom: 24px;
}
.checker-form {
  background: var(--c-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 28px 24px 20px;
}
.input-group {
  display: flex;
  gap: 10px;
}
.url-input {
  flex: 1;
  min-width: 0;
  padding: 13px 16px;
  font-size: 1rem;
  border: 2px solid var(--c-border);
  border-radius: 8px;
  outline: none;
  transition: border-color .2s;
  background: #fff;
}
.url-input:focus { border-color: var(--c-primary); }
.url-input::placeholder { color: #a0aec0; }
.input-hint {
  font-size: .8rem;
  color: var(--c-muted);
  margin-top: 8px;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 13px 22px;
  font-size: 1rem;
  font-weight: 700;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
  transition: background .15s, transform .1s, box-shadow .15s;
  white-space: nowrap;
}
.btn--primary {
  background: var(--c-primary);
  color: #fff;
}
.btn--primary:hover:not(:disabled) { background: var(--c-primary-dark); }
.btn--primary:active:not(:disabled) { transform: scale(.97); }
.btn--primary:disabled { opacity: .6; cursor: not-allowed; }

.error-msg {
  margin-top: 12px;
  padding: 10px 14px;
  background: #fef2f2;
  border-left: 3px solid var(--c-danger);
  border-radius: 6px;
  color: var(--c-danger);
  font-size: .9rem;
}

/* ===== Loading ===== */
.loading {
  text-align: center;
  padding: 56px 16px;
  color: var(--c-muted);
}
.loading__spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--c-border);
  border-top-color: var(--c-primary);
  border-radius: 50%;
  animation: spin .8s linear infinite;
  margin: 0 auto 16px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading__text { font-size: .95rem; line-height: 1.8; }

/* ===== Score card ===== */
.score-card {
  background: var(--c-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px 28px;
  display: flex;
  align-items: center;
  gap: 32px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.score-ring-wrap {
  position: relative;
  width: 120px;
  height: 120px;
  flex-shrink: 0;
}
.score-svg {
  width: 120px;
  height: 120px;
}
.score-svg__bg {
  fill: none;
  stroke: var(--c-border);
  stroke-width: 8;
}
.score-svg__fill {
  fill: none;
  stroke: var(--c-success);
  stroke-width: 8;
  stroke-linecap: round;
  stroke-dasharray: 282.74;
  stroke-dashoffset: 282.74;
  transition: stroke-dashoffset 1.2s cubic-bezier(.4,0,.2,1), stroke .4s ease;
}
.score-ring__label {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.score-num {
  font-size: 2.2rem;
  font-weight: 800;
  transition: color .4s;
}
.score-unit {
  font-size: .75rem;
  color: var(--c-muted);
  margin-top: 2px;
}
.score-meta { flex: 1; min-width: 0; }
.score-url {
  font-size: .82rem;
  color: var(--c-muted);
  word-break: break-all;
  margin-bottom: 6px;
}
.score-grade {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 6px;
}
.score-desc { font-size: .88rem; color: var(--c-muted); }

/* ===== Summary bar ===== */
.summary-bar {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}
.summary-item {
  background: var(--c-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 12px;
  text-align: center;
}
.summary-num {
  display: block;
  font-size: 2rem;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 4px;
}
.summary-item--danger  .summary-num { color: var(--c-danger); }
.summary-item--warning .summary-num { color: var(--c-warning); }
.summary-item--ok      .summary-num { color: var(--c-success); }
.summary-label { font-size: .82rem; color: var(--c-muted); }

/* ===== Check cards ===== */
.checks-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 40px;
}
.check-card {
  background: var(--c-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 20px;
  border-left: 4px solid transparent;
}
.check-card--ok      { border-left-color: var(--c-success); }
.check-card--warning { border-left-color: var(--c-warning); }
.check-card--danger  { border-left-color: var(--c-danger);  }

.check-card__header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.check-card__icon { font-size: 1rem; flex-shrink: 0; }
.check-card__title { font-weight: 700; font-size: .93rem; flex: 1; }
.check-card__badge {
  font-size: .72rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 100px;
  white-space: nowrap;
  flex-shrink: 0;
}
.check-card__badge--ok      { background: #dcfce7; color: #166534; }
.check-card__badge--warning { background: #fef9c3; color: #854d0e; }
.check-card__badge--danger  { background: #fee2e2; color: #991b1b; }

.check-card__message {
  font-size: .9rem;
  color: var(--c-text);
  line-height: 1.6;
}
.check-card__detail {
  font-size: .78rem;
  color: var(--c-muted);
  margin-top: 5px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  word-break: break-all;
}

/* ===== CTA ===== */
.cta-section {
  background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 100%);
  border-radius: var(--radius);
  padding: 4px;
  margin-bottom: 48px;
}
.cta-inner {
  text-align: center;
  padding: 40px 28px;
  color: #fff;
}
.cta-title {
  font-size: clamp(1.2rem, 3vw, 1.6rem);
  font-weight: 800;
  margin-bottom: 12px;
}
.cta-body {
  font-size: .97rem;
  opacity: .9;
  margin-bottom: 24px;
  line-height: 1.8;
}
.btn--cta {
  background: #fff;
  color: var(--c-primary);
  font-size: 1.05rem;
  padding: 14px 36px;
  border-radius: 100px;
  box-shadow: 0 4px 14px rgba(0,0,0,.15);
}
.btn--cta:hover {
  background: #eff6ff;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,.2);
}

/* ===== Header logo link ===== */
.site-header__logo {
  display: inline-block;
  color: rgba(255,255,255,.7);
  font-size: .78rem;
  text-decoration: none;
  margin-bottom: 16px;
  letter-spacing: .02em;
}
.site-header__logo:hover { color: #fff; }

/* ===== Contact form (inside CTA) ===== */
.contact-form {
  margin-top: 24px;
  text-align: left;
}
.cf-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}
.cf-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.cf-group label {
  font-size: .8rem;
  font-weight: 700;
  color: rgba(255,255,255,.85);
}
.cf-required {
  font-size: .7rem;
  background: rgba(255,255,255,.25);
  color: #fff;
  padding: 1px 6px;
  border-radius: 4px;
  margin-left: 4px;
}
.cf-group input,
.cf-group textarea {
  padding: 10px 14px;
  border: 1.5px solid rgba(255,255,255,.3);
  border-radius: 8px;
  background: rgba(255,255,255,.12);
  color: #fff;
  font-size: .93rem;
  outline: none;
  transition: border-color .2s;
  resize: vertical;
  font-family: inherit;
}
.cf-group input::placeholder,
.cf-group textarea::placeholder { color: rgba(255,255,255,.4); }
.cf-group input:focus,
.cf-group textarea:focus { border-color: rgba(255,255,255,.8); }
.cf-group textarea { margin-bottom: 12px; }
.cf-error {
  margin-bottom: 10px;
  padding: 8px 12px;
  background: rgba(220,38,38,.25);
  border: 1px solid rgba(220,38,38,.5);
  border-radius: 6px;
  color: #fecaca;
  font-size: .85rem;
}
.cf-note {
  margin-top: 10px;
  font-size: .75rem;
  color: rgba(255,255,255,.55);
  text-align: center;
}

/* ===== Thanks state ===== */
.contact-thanks {
  text-align: center;
  padding: 16px 0 8px;
}
.thanks-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(255,255,255,.2);
  color: #fff;
  font-size: 1.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}
.thanks-title {
  font-size: 1.2rem;
  font-weight: 800;
  color: #fff;
  margin: 0 0 10px;
}
.thanks-body {
  font-size: .9rem;
  color: rgba(255,255,255,.85);
  line-height: 1.8;
  margin: 0;
}

/* ===== Footer ===== */
.site-footer {
  text-align: center;
  padding: 24px 16px;
  color: var(--c-muted);
  font-size: .82rem;
  border-top: 1px solid var(--c-border);
}
.site-footer a {
  color: var(--c-muted);
  text-decoration: none;
}
.site-footer a:hover { color: var(--c-primary); }

/* ===== Responsive ===== */
@media (max-width: 540px) {
  .site-header { padding: 40px 16px 72px; }
  .input-group { flex-direction: column; }
  .btn--primary { width: 100%; }
  .score-card { flex-direction: column; align-items: center; text-align: center; gap: 20px; }
  .score-url { word-break: break-all; }
  .summary-bar { gap: 8px; }
  .summary-num { font-size: 1.6rem; }
  .cta-inner { padding: 32px 20px; }
  .cf-row { grid-template-columns: 1fr; }
  .btn--cta { width: 100%; }
}
