@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&display=swap');

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

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: #f5f3ee;
  color: #1a1a2e;
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 16px 60px;
}

main {
  width: 100%;
  max-width: 540px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
}

.logo {
  font-size: 48px;
  line-height: 1;
  opacity: .7;
}

h1 {
  font-size: 2rem;
  font-weight: 600;
  letter-spacing: -.5px;
  color: #1a1a2e;
}

.subtitle {
  text-align: center;
  color: #555;
  line-height: 1.6;
  font-size: .95rem;
}

.error {
  background: #fff0f0;
  border: 1px solid #f5c6c6;
  color: #c0392b;
  padding: 12px 16px;
  border-radius: 8px;
  width: 100%;
  font-size: .9rem;
}

.form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

.form input[type="url"] {
  width: 100%;
  padding: 14px 16px;
  border: 1.5px solid #d0ccc4;
  border-radius: 10px;
  font-size: 1rem;
  background: #fff;
  transition: border-color .15s;
  outline: none;
}

.form input[type="url"]:focus {
  border-color: #9b1919;
}

.form button {
  padding: 14px;
  background: #9b1919;
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
}

.form button:hover { background: #7a1313; }

.how {
  width: 100%;
  background: #fff;
  border-radius: 12px;
  padding: 20px 22px;
  border: 1px solid #e0ddd7;
}

.how h3 { font-size: .9rem; color: #888; margin-bottom: 10px; text-transform: uppercase; letter-spacing: .5px; }
.how ol  { padding-left: 18px; line-height: 2; font-size: .93rem; color: #333; }
.how code { background: #f0ede8; padding: 1px 5px; border-radius: 4px; font-size: .88rem; }
.note    { margin-top: 12px; font-size: .82rem; color: #aaa; }

/* ── Result page ─────────────────────────── */

.status-box {
  width: 100%;
  background: #fff;
  border-radius: 14px;
  padding: 32px 24px;
  border: 1px solid #e0ddd7;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
}

.spinner {
  width: 40px; height: 40px;
  border: 3px solid #e0ddd7;
  border-top-color: #9b1919;
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.status-box p      { color: #555; line-height: 1.7; }
.status-box small  { color: #aaa; }

.status-box.done { border-color: #b7ddb0; }
.check { font-size: 40px; color: #2e8b57; }
.status-box.done h2 { font-size: 1.2rem; color: #1a1a2e; }

.meta { font-size: .88rem; color: #666; }

.buttons { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }

.btn {
  padding: 12px 24px;
  border-radius: 10px;
  font-size: .95rem;
  font-weight: 600;
  text-decoration: none;
  transition: background .15s;
}
.btn-primary   { background: #9b1919; color: #fff; }
.btn-primary:hover { background: #7a1313; }
.btn-secondary { background: #f0ede8; color: #333; border: 1px solid #d0ccc4; }
.btn-secondary:hover { background: #e5e0d8; }

.status-box.err { border-color: #f5c6c6; }
.status-box.err p { color: #c0392b; }

.back {
  font-size: .88rem;
  color: #999;
  text-decoration: none;
}
.back:hover { color: #555; }

/* ── Tabs ──────────────────────────────────────── */

.tabs {
  display: flex;
  gap: 4px;
  background: #ede9e2;
  border-radius: 10px;
  padding: 4px;
  width: 100%;
}

.tab {
  flex: 1;
  padding: 9px 0;
  border: none;
  background: transparent;
  border-radius: 7px;
  font-size: .93rem;
  font-weight: 500;
  color: #888;
  cursor: pointer;
  transition: background .15s, color .15s;
}

.tab.active {
  background: #fff;
  color: #1a1a2e;
  box-shadow: 0 1px 3px rgba(0,0,0,.1);
}

#tab-analyze {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 100%;
}

/* ── About ─────────────────────────────────────── */

.about-card {
  background: #fff;
  border-radius: 14px;
  border: 1px solid #e0ddd7;
  padding: 24px 26px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
}

.about-card h2 {
  font-size: 1.05rem;
  color: #9b1919;
  margin-top: 8px;
}

.about-card h2:first-child { margin-top: 0; }

.about-card p {
  font-size: .93rem;
  color: #444;
  line-height: 1.75;
}

.about-card ul {
  padding-left: 18px;
  font-size: .93rem;
  color: #444;
  line-height: 2;
}

.about-card .note {
  font-size: .82rem;
  color: #aaa;
}

/* ── Layers (About) ─────────────────────────── */

.layers {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.layer {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  border-radius: 9px;
  padding: 11px 14px;
  font-size: .92rem;
  line-height: 1.65;
  color: #333;
}

.layer-tag {
  flex-shrink: 0;
  font-size: .72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .4px;
  border-radius: 5px;
  padding: 3px 7px;
  margin-top: 2px;
  white-space: nowrap;
}

.layer-base  { background: #f0f7ed; }
.layer-base  .layer-tag  { background: #2e8b57; color: #fff; }

.layer-mid   { background: #f0f4fb; }
.layer-mid   .layer-tag  { background: #2355b0; color: #fff; }

.layer-pro   { background: #fdf4f0; }
.layer-pro   .layer-tag  { background: #9b4a19; color: #fff; }

.eight-demo {
  font-family: 'Courier New', monospace;
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 2px;
  color: #9b1919;
  background: #f5f3ee;
  border-radius: 8px;
  padding: 10px 16px;
  text-align: center;
}
