/* ── Reset & base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Segoe UI', system-ui, sans-serif;
  background: #0d1117;
  color: #c9d1d9;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ── Hero ── */
.hero {
  width: 100%;
  text-align: center;
  padding: 48px 24px 36px;
  background: linear-gradient(135deg, #0d1117 0%, #161b22 60%, #0d1117 100%);
  border-bottom: 1px solid #21262d;
}

.hero-icon { font-size: 56px; margin-bottom: 12px; }

.hero h1 {
  font-size: clamp(1.6rem, 4vw, 2.6rem);
  font-weight: 700;
  color: #58a6ff;
  letter-spacing: -0.5px;
}

.hero-subtitle {
  margin-top: 10px;
  font-size: 1rem;
  color: #8b949e;
  max-width: 600px;
  margin-inline: auto;
}

/* ── Info banner ── */
.info-banner {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: center;
  padding: 28px 24px;
  max-width: 1000px;
  width: 100%;
}

.info-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: #161b22;
  border: 1px solid #21262d;
  border-radius: 12px;
  padding: 18px 20px;
  flex: 1 1 260px;
  max-width: 320px;
  transition: border-color 0.2s;
}

.info-card:hover { border-color: #58a6ff; }

.info-icon { font-size: 28px; flex-shrink: 0; margin-top: 2px; }

.info-card strong {
  display: block;
  color: #e6edf3;
  font-size: 0.95rem;
  margin-bottom: 6px;
}

.info-card p {
  font-size: 0.85rem;
  color: #8b949e;
  line-height: 1.5;
}

.info-card em { color: #3fb950; font-style: normal; font-weight: 600; }

/* ── Main / form card ── */
main {
  width: 100%;
  max-width: 860px;
  padding: 0 24px 48px;
}

.form-card {
  background: #161b22;
  border: 1px solid #21262d;
  border-radius: 14px;
  padding: 32px 36px;
  margin-top: 8px;
}

.form-title {
  color: #e6edf3;
  font-size: 1.35rem;
  margin-bottom: 8px;
}

.form-desc {
  color: #8b949e;
  font-size: 0.9rem;
  margin-bottom: 28px;
  line-height: 1.6;
}

/* ── Fields grid ── */
.fields-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 20px;
  margin-bottom: 28px;
}

.field-group {
  background: #0d1117;
  border: 1px solid #21262d;
  border-radius: 10px;
  padding: 16px 18px;
  transition: border-color 0.2s;
}

.field-group:focus-within { border-color: #58a6ff; }

.field-group label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  color: #e6edf3;
  margin-bottom: 6px;
}

.badge {
  background: #21262d;
  color: #8b949e;
  font-size: 0.7rem;
  font-weight: 500;
  padding: 2px 7px;
  border-radius: 20px;
  border: 1px solid #30363d;
}

.field-desc {
  font-size: 0.78rem;
  color: #6e7681;
  line-height: 1.5;
  margin-bottom: 10px;
}

.field-group input {
  width: 100%;
  padding: 9px 12px;
  background: #161b22;
  color: #c9d1d9;
  border: 1px solid #30363d;
  border-radius: 8px;
  font-size: 0.92rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.field-group input:focus {
  outline: none;
  border-color: #58a6ff;
  box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.15);
}

.field-group input::placeholder { color: #484f58; }

/* ── Analyse button ── */
button#analyseBtn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 32px;
  background: #238636;
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  border: 1px solid #2ea043;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
  width: 100%;
  justify-content: center;
}

button#analyseBtn:hover:not(:disabled) {
  background: #2ea043;
  border-color: #3fb950;
}

button#analyseBtn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ── Result panel ── */
.result-panel {
  margin-top: 24px;
  background: #161b22;
  border: 1px solid #21262d;
  border-radius: 14px;
  padding: 28px 32px;
  text-align: center;
  animation: fadeIn 0.4s ease;
}

.result-panel.anomaly { border-color: #f85149; }
.result-panel.normal  { border-color: #3fb950; }

.result-icon { font-size: 48px; margin-bottom: 12px; }

.result-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.result-panel.anomaly .result-title { color: #f85149; }
.result-panel.normal  .result-title { color: #3fb950; }

.result-detail {
  font-size: 0.9rem;
  color: #8b949e;
  margin-bottom: 20px;
  line-height: 1.6;
}

.prob-bar-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.prob-label {
  font-size: 0.8rem;
  color: #6e7681;
  white-space: nowrap;
}

.prob-bar-track {
  flex: 1;
  background: #21262d;
  border-radius: 20px;
  height: 10px;
  overflow: hidden;
  min-width: 100px;
}

.prob-bar {
  height: 100%;
  border-radius: 20px;
  transition: width 0.6s ease;
}

.result-panel.normal  .prob-bar { background: #3fb950; }
.result-panel.anomaly .prob-bar { background: #f85149; }

.prob-value {
  font-size: 0.85rem;
  font-weight: 600;
  color: #c9d1d9;
  white-space: nowrap;
}

/* ── Error panel ── */
.error-panel {
  margin-top: 24px;
  background: #1c1010;
  border: 1px solid #6e2020;
  border-radius: 14px;
  padding: 20px 28px;
  display: flex;
  align-items: center;
  gap: 12px;
  animation: fadeIn 0.3s ease;
}

.error-icon { font-size: 24px; flex-shrink: 0; }

.error-panel p {
  font-size: 0.9rem;
  color: #f85149;
  line-height: 1.5;
}

/* ── Footer ── */
footer {
  width: 100%;
  text-align: center;
  padding: 20px 24px;
  border-top: 1px solid #21262d;
  color: #484f58;
  font-size: 0.78rem;
  margin-top: auto;
}

/* ── Utilities ── */
.hidden { display: none !important; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Responsive ── */
@media (max-width: 600px) {
  .form-card { padding: 20px 18px; }
  .fields-grid { grid-template-columns: 1fr; }
}
