:root {
  --bg: #07111f;
  --bg-2: #0d1d2d;
  --panel: rgba(15, 27, 42, 0.9);
  --panel-strong: #112235;
  --primary: #4fd1c5;
  --primary-2: #5b8cff;
  --danger: #ff5a5f;
  --warning: #f7b955;
  --safe: #2ec27e;
  --text: #edf6ff;
  --muted: #9cb7d1;
  --line: rgba(255, 255, 255, 0.08);
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Inter', sans-serif;
  background: radial-gradient(circle at top left, rgba(91, 140, 255, 0.2), transparent 30%),
    linear-gradient(135deg, var(--bg) 0%, var(--bg-2) 100%);
  color: var(--text);
}

button, input, select {
  font: inherit;
}

.app-shell {
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px 20px 40px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 28px;
}

.brand-wrap {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(79, 209, 197, 0.2), rgba(91, 140, 255, 0.2));
  border: 1px solid var(--line);
  font-size: 26px;
}

.brand-name {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.06em;
}

.brand-tag {
  color: var(--muted);
  font-size: 0.82rem;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(46, 194, 126, 0.16);
  border: 1px solid rgba(46, 194, 126, 0.28);
  color: #d9fce8;
  font-weight: 600;
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--safe);
  box-shadow: 0 0 14px rgba(46, 194, 126, 0.8);
}

.hero {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
  align-items: center;
  padding: 12px 0 26px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--primary);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-weight: 700;
}

.hero-copy h1 {
  margin: 0;
  font-size: clamp(2.3rem, 5vw, 4rem);
  line-height: 1.04;
  letter-spacing: -0.06em;
}

.hero-subtitle {
  max-width: 650px;
  margin-top: 16px;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.7;
}

.hero-stat-card {
  padding: 24px 18px;
  border-radius: 24px;
  background: linear-gradient(135deg, rgba(79, 209, 197, 0.12), rgba(91, 140, 255, 0.12));
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.stat-label {
  color: var(--muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.stat-value {
  font-size: clamp(2.2rem, 4vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.06em;
  margin: 14px 0 8px;
}

.stat-meta {
  color: var(--muted);
}

.content-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 24px;
}

.panel {
  background: rgba(17, 34, 53, 0.86);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.form-panel,
.result-panel,
.history-panel {
  padding: 22px;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.panel-header h2 {
  margin: 0;
  font-size: 1.5rem;
}

.analysis-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: var(--muted);
  font-weight: 500;
}

input, select {
  border: 1px solid rgba(255, 255, 255, 0.09);
  background: rgba(255, 255, 255, 0.02);
  color: var(--text);
  border-radius: 14px;
  min-height: 48px;
  padding: 0 14px;
  transition: border 0.2s ease, box-shadow 0.2s ease;
}

input:focus, select:focus {
  outline: none;
  border-color: rgba(79, 209, 197, 0.8);
  box-shadow: 0 0 0 4px rgba(79, 209, 197, 0.12);
}

.primary-btn {
  min-height: 50px;
  padding: 0 18px;
  border: none;
  border-radius: 14px;
  font-weight: 700;
  color: #06151d;
  background: linear-gradient(135deg, var(--primary), #82e5d6);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 12px 30px rgba(79, 209, 197, 0.28);
}

.primary-btn:hover {
  transform: translateY(-1px);
}

.result-state {
  min-height: 520px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: 18px;
}

.empty-state {
  color: var(--muted);
  justify-content: center;
  align-items: center;
  text-align: center;
}

.empty-icon {
  font-size: 3rem;
}

.result-card {
  width: 100%;
}

.risk-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.risk-title {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.risk-score {
  font-size: 3rem;
  font-weight: 800;
  letter-spacing: -0.08em;
  margin: 0;
}

.risk-details {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 10px;
  margin-bottom: 16px;
}

.risk-badge {
  display: inline-flex;
  padding: 9px 14px;
  border-radius: 999px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.risk-low {
  background: rgba(46, 194, 126, 0.14);
  color: #d9fce8;
  border: 1px solid rgba(46, 194, 126, 0.3);
}

.risk-medium {
  background: rgba(247, 185, 85, 0.12);
  color: #fde8b4;
  border: 1px solid rgba(247, 185, 85, 0.27);
}

.risk-high {
  background: rgba(255, 90, 95, 0.14);
  color: #ffd2d4;
  border: 1px solid rgba(255, 90, 95, 0.25);
}

.risk-meter {
  width: 100%;
  height: 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.risk-meter-bar {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--safe), var(--warning), var(--danger));
  transition: width 0.35s ease;
}

.section-label {
  margin-top: 18px;
  color: var(--muted);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.reason-list,
.recommendation-box,
.status-box {
  margin-top: 12px;
}

.reason-list ul {
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
  line-height: 1.8;
}

.recommendation-box {
  padding: 16px 18px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  color: var(--text);
  line-height: 1.6;
}

.status-box {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.action-btn {
  min-height: 52px;
  padding: 0 20px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
  color: var(--text);
  cursor: pointer;
  font-weight: 700;
}

.action-btn.primary {
  background: linear-gradient(135deg, var(--safe), #5fe0a0);
  border: none;
  color: #06151d;
}

.action-btn.warning {
  background: linear-gradient(135deg, var(--warning), #ffd178);
  border: none;
  color: #1d1000;
}

.action-btn.blocked {
  background: rgba(255, 90, 95, 0.12);
  border-color: rgba(255, 90, 95, 0.24);
  color: #ffd2d4;
}

.metrics {
  margin-top: 28px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.metric-card {
  padding: 20px 18px;
  background: rgba(17, 34, 53, 0.7);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
}

.metric-card span {
  display: block;
  color: var(--muted);
  margin-bottom: 12px;
}

.metric-card strong {
  font-size: 2rem;
  letter-spacing: -0.05em;
}

.metric-card.safe strong { color: var(--safe); }
.metric-card.flagged strong { color: var(--warning); }
.metric-card.blocked strong { color: var(--danger); }

.history-panel {
  margin-top: 28px;
}

.history-header {
  margin-bottom: 10px;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  padding: 14px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

th {
  color: var(--muted);
  font-weight: 700;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

td {
  color: var(--text);
}

.empty-row {
  text-align: center;
  color: var(--muted);
  padding: 24px;
}

.status-tag {
  display: inline-flex;
  padding: 7px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.status-tag.safe {
  background: rgba(46, 194, 126, 0.12);
  color: #d9fce8;
}

.status-tag.verification {
  background: rgba(247, 185, 85, 0.12);
  color: #fde8b4;
}

.status-tag.blocked {
  background: rgba(255, 90, 95, 0.12);
  color: #ffd2d4;
}

.modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(4, 8, 13, 0.7);
  backdrop-filter: blur(4px);
}

.modal.hidden {
  display: none;
}

.modal-card {
  position: relative;
  width: min(480px, calc(100vw - 30px));
  padding: 28px 22px 22px;
  border-radius: 22px;
  background: #0f1d2b;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.modal-card h3 {
  margin: 0 0 8px;
}

.modal-card p {
  color: var(--muted);
  line-height: 1.6;
  margin: 0 0 16px;
}

.modal-card label {
  margin-bottom: 14px;
}

.close-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  cursor: pointer;
}

@media (max-width: 920px) {
  .hero,
  .content-grid,
  .metrics {
    grid-template-columns: 1fr;
  }

  .result-state {
    min-height: 320px;
  }
}

@media (max-width: 620px) {
  .app-shell {
    padding-left: 14px;
    padding-right: 14px;
  }

  .topbar,
  .brand-wrap {
    align-items: flex-start;
    flex-direction: column;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .brand-name {
    font-size: 1.5rem;
  }
}
