:root {
  --bg: #eef3f7;
  --panel: #ffffff;
  --panel-soft: #f7fafc;
  --text: #12202f;
  --muted: #607083;
  --line: #dbe5ee;
  --primary: #163a5f;
  --primary-2: #1f6f8b;
  --safe: #19a66a;
  --safe-bg: #e9f8f1;
  --warning: #d7a900;
  --warning-bg: #fff8da;
  --danger: #d63f3f;
  --danger-bg: #ffecec;
  --shadow: 0 18px 50px rgba(24, 46, 71, 0.10);
  --radius: 22px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(31, 111, 139, 0.18), transparent 32rem),
    linear-gradient(135deg, #eef3f7 0%, #f8fbfd 100%);
  color: var(--text);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
  border-radius: 14px;
  padding: 0.95rem 1.1rem;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  font-weight: 800;
  box-shadow: 0 10px 24px rgba(31, 111, 139, 0.22);
  transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}

button:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 30px rgba(31, 111, 139, 0.28);
}

button:disabled {
  opacity: 0.58;
  cursor: wait;
  transform: none;
}

button.secondary {
  background: #e9f0f6;
  color: var(--primary);
  box-shadow: none;
}

label {
  display: grid;
  gap: 0.45rem;
  color: var(--muted);
  font-weight: 700;
  font-size: 0.92rem;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.95rem 1rem;
  color: var(--text);
  background: #fff;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

textarea {
  resize: vertical;
  min-height: 170px;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary-2);
  box-shadow: 0 0 0 4px rgba(31, 111, 139, 0.12);
}

.app-shell {
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(219, 229, 238, 0.9);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.brand-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fff;
  box-shadow: var(--shadow);
}

.brand strong,
.brand span {
  display: block;
  line-height: 1.05;
}

.brand span:not(.brand-icon) {
  color: var(--muted);
  font-size: 0.82rem;
  margin-top: 0.22rem;
}

.nav-links {
  display: none;
}

.trust-box {
  display: none;
}

.main-content {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 1rem;
}

.hero {
  display: grid;
  gap: 1rem;
  align-items: center;
  padding: 1.3rem;
  margin-top: 1rem;
  border-radius: calc(var(--radius) + 6px);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(247, 250, 252, 0.86));
  box-shadow: var(--shadow);
  border: 1px solid rgba(255, 255, 255, 0.86);
}

.eyebrow {
  margin: 0 0 0.35rem;
  color: var(--primary-2);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0.85rem;
  font-size: clamp(2rem, 7vw, 4.7rem);
  line-height: 0.98;
  letter-spacing: -0.055em;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(1.3rem, 4vw, 2rem);
  letter-spacing: -0.03em;
}

h3 {
  margin-bottom: 0.65rem;
  font-size: 1rem;
}

.hero-text {
  margin-bottom: 0;
  color: var(--muted);
  max-width: 760px;
  font-size: 1.03rem;
  line-height: 1.7;
}

.hero-card {
  display: grid;
  gap: 0.35rem;
  padding: 1.2rem;
  border-radius: var(--radius);
  color: #fff;
  background:
    radial-gradient(circle at top right, rgba(255,255,255,0.28), transparent 12rem),
    linear-gradient(135deg, #0f2b46, #1f6f8b);
  box-shadow: var(--shadow);
}

.hero-card span,
.hero-card small {
  color: rgba(255,255,255,0.74);
}

.hero-card strong {
  font-size: 4rem;
  line-height: 1;
}

.stats-grid,
.tips-grid {
  display: grid;
  gap: 1rem;
  margin-top: 1rem;
}

.stat-card,
.tip-card,
.module-card {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(219, 229, 238, 0.82);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.stat-card,
.tip-card {
  padding: 1.1rem;
}

.stat-card span {
  display: block;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 800;
}

.stat-card strong {
  display: block;
  margin: 0.3rem 0;
  font-size: 1.7rem;
}

.stat-card p,
.tip-card p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.6;
}

.module-card {
  padding: 1.1rem;
  margin-top: 1rem;
}

.module-header {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  margin-bottom: 1.1rem;
}

.pill {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 0.45rem 0.75rem;
  color: var(--safe);
  background: var(--safe-bg);
  font-weight: 900;
  font-size: 0.8rem;
}

.pill.warning {
  color: #906b00;
  background: var(--warning-bg);
}

.pill.danger {
  color: var(--danger);
  background: var(--danger-bg);
}

.form-grid {
  display: grid;
  gap: 0.9rem;
}

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

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.85rem;
}

.result-card,
.highlight-box {
  margin-top: 1rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel-soft);
  line-height: 1.65;
  overflow-wrap: anywhere;
}

.result-card.safe,
.highlight-box.safe {
  border-color: rgba(25, 166, 106, 0.35);
  background: var(--safe-bg);
}

.result-card.warning,
.highlight-box.warning {
  border-color: rgba(215, 169, 0, 0.38);
  background: var(--warning-bg);
}

.result-card.danger,
.highlight-box.danger {
  border-color: rgba(214, 63, 63, 0.35);
  background: var(--danger-bg);
}

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

.result-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.5rem;
  font-weight: 900;
  color: var(--text);
}

.score-badge {
  display: inline-grid;
  place-items: center;
  min-width: 58px;
  height: 38px;
  border-radius: 999px;
  color: #fff;
  background: var(--primary);
  font-weight: 900;
}

.score-badge.safe { background: var(--safe); }
.score-badge.warning { background: var(--warning); color: #2d2400; }
.score-badge.danger { background: var(--danger); }

.meta-list {
  display: grid;
  gap: 0.45rem;
  padding: 0;
  margin: 0.75rem 0 0;
  list-style: none;
}

.meta-list li {
  padding: 0.65rem 0.75rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
}

.highlight {
  display: inline;
  padding: 0.1rem 0.25rem;
  border-radius: 7px;
  background: #ffd7d7;
  color: #7a1313;
  font-weight: 900;
}

.analysis-layout {
  display: grid;
  gap: 1rem;
  margin-top: 1rem;
}

.dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.dot.safe { background: var(--safe); }
.dot.warning { background: var(--warning); }
.dot.danger { background: var(--danger); }

.error-text {
  color: var(--danger);
  font-weight: 800;
}

@media (min-width: 760px) {
  .main-content {
    padding: 1.4rem;
  }

  .hero {
    grid-template-columns: 1fr 260px;
    padding: 2rem;
  }

  .stats-grid,
  .tips-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .module-card {
    padding: 1.45rem;
  }

  .module-header {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .form-grid {
    grid-template-columns: 1.4fr 0.9fr 0.5fr auto;
    align-items: end;
  }

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

  .analysis-layout {
    grid-template-columns: 1fr 1fr;
  }
}

@media (min-width: 1080px) {
  .app-shell {
    display: grid;
    grid-template-columns: 290px 1fr;
  }

  .sidebar {
    min-height: 100vh;
    align-items: stretch;
    justify-content: flex-start;
    flex-direction: column;
    padding: 1.4rem;
    border-right: 1px solid rgba(219, 229, 238, 0.9);
    border-bottom: 0;
  }

  .nav-links {
    display: grid;
    gap: 0.45rem;
    margin-top: 1rem;
  }

  .nav-links a {
    color: var(--muted);
    text-decoration: none;
    font-weight: 850;
    padding: 0.85rem 0.9rem;
    border-radius: 14px;
  }

  .nav-links a:hover,
  .nav-links a.active {
    color: var(--primary);
    background: #edf5f8;
  }

  .trust-box {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    margin-top: auto;
    padding: 0.95rem;
    border-radius: 18px;
    background: var(--panel-soft);
    color: var(--muted);
  }

  .trust-box p {
    margin-bottom: 0;
    line-height: 1.45;
    font-size: 0.9rem;
  }
}
