/* Основные стили сайта. Ничего лишнего, просто и по делу. */

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  color: #2b2b2b;
  background: #fbfbfa;
  line-height: 1.6;
}

a {
  color: #1a5aa8;
}

header {
  background: #ffffff;
  border-bottom: 1px solid #e3e3e3;
  padding: 14px 0;
  position: sticky;
  top: 0;
  z-index: 10;
}

.wrap {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 18px;
}

.nav-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

.logo {
  font-size: 20px;
  font-weight: bold;
  text-decoration: none;
  color: #222;
}

nav ul {
  list-style: none;
  display: flex;
  gap: 18px;
  margin: 0;
  padding: 0;
  flex-wrap: wrap;
}

nav a {
  text-decoration: none;
  color: #444;
  font-size: 15px;
}

nav a:hover {
  color: #1a5aa8;
}

main {
  max-width: 900px;
  margin: 0 auto;
  padding: 30px 18px 60px;
}

h1 {
  font-size: 28px;
  margin-bottom: 10px;
}

.hero-img {
  width: 100%;
  height: auto;
  border-radius: 6px;
  margin: 14px 0 20px;
  display: block;
}

.byline {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 4px 0 22px;
  color: #666;
  font-size: 14px;
}

.byline img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  flex-shrink: 0;
}

.byline .author-name {
  color: #2b2b2b;
  font-weight: bold;
}

.author-box {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  background: #fff;
  border: 1px solid #e6e6e6;
  border-radius: 4px;
  padding: 18px;
  margin-top: 36px;
}

.author-box img {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  flex-shrink: 0;
}

.author-box p {
  margin: 4px 0 0;
  font-size: 14px;
  color: #555;
}

.traffic-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin: 16px 0;
}

.traffic-card {
  background: #fff;
  border: 1px solid #e6e6e6;
  border-radius: 4px;
  padding: 14px 16px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.traffic-card img {
  flex-shrink: 0;
  margin-top: 2px;
}

.traffic-card h4 {
  margin: 0 0 4px;
  font-size: 15px;
}

.traffic-card p {
  margin: 0;
  font-size: 14px;
  color: #555;
}

h2 {
  font-size: 22px;
  margin-top: 40px;
  border-bottom: 2px solid #eee;
  padding-bottom: 6px;
}

h3 {
  font-size: 18px;
  margin-bottom: 6px;
}

section {
  margin-bottom: 24px;
}

.intro-box {
  background: #fff;
  border: 1px solid #e6e6e6;
  border-left: 4px solid #1a5aa8;
  padding: 18px 20px;
  border-radius: 4px;
  margin-bottom: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

table.compare {
  width: 100%;
  border-collapse: collapse;
  margin: 14px 0;
}

table.compare th, table.compare td {
  border: 1px solid #ddd;
  padding: 8px 10px;
  text-align: left;
  font-size: 15px;
}

table.compare th {
  background: #f2f2f2;
}

.btn {
  display: inline-block;
  background: #1a5aa8;
  color: #fff;
  padding: 10px 22px;
  border: none;
  border-radius: 4px;
  font-size: 16px;
  cursor: pointer;
  text-decoration: none;
}

.btn:hover {
  background: #154a8a;
}

.btn.secondary {
  background: #888;
}

#quiz-form {
  margin-top: 20px;
}

.question-block {
  background: #fff;
  border: 1px solid #e6e6e6;
  padding: 16px 18px;
  border-radius: 4px;
  margin-bottom: 14px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  transition: box-shadow 0.15s ease;
}

.question-block:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.question-block p.q-title {
  font-weight: bold;
  margin: 0 0 10px 0;
}

.question-block label {
  display: block;
  padding: 6px 0;
  cursor: pointer;
  font-size: 15px;
}

.question-block input[type="radio"] {
  margin-right: 8px;
}

.quiz-controls {
  text-align: center;
  margin: 30px 0 10px;
}

footer {
  border-top: 1px solid #e3e3e3;
  background: #fff;
  padding: 24px 0;
  margin-top: 40px;
}

footer .wrap {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 14px;
  color: #666;
}

footer a {
  color: #666;
  margin-right: 14px;
  text-decoration: none;
}

footer a:hover {
  text-decoration: underline;
}

/* модальное окно с результатами */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.55);
  z-index: 100;
  padding: 20px;
  overflow-y: auto;
}

.modal-overlay.active {
  display: block;
}

.modal-box {
  background: #fff;
  max-width: 700px;
  margin: 40px auto;
  border-radius: 6px;
  padding: 24px 26px;
  position: relative;
}

.modal-box h2 {
  margin-top: 0;
  border: none;
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 18px;
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
  color: #666;
}

.score-line {
  font-size: 20px;
  margin-bottom: 16px;
}

.answer-review {
  border-top: 1px solid #eee;
  padding-top: 6px;
}

.review-item {
  padding: 10px 0;
  border-bottom: 1px dashed #e0e0e0;
  font-size: 14px;
}

.review-item.correct .marker {
  color: #1e7a1e;
}

.review-item.wrong .marker {
  color: #b32020;
}

.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #222;
  color: #eee;
  padding: 14px 18px;
  font-size: 14px;
  display: none;
  z-index: 200;
}

.cookie-banner.active {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.cookie-banner a {
  color: #9cc6ff;
}

.cookie-banner button {
  background: #1a5aa8;
  color: #fff;
  border: none;
  padding: 8px 18px;
  border-radius: 4px;
  cursor: pointer;
}

.legal-page main {
  max-width: 800px;
}

.legal-page h2 {
  border: none;
  margin-top: 30px;
}

.progress-text {
  text-align: center;
  color: #777;
  font-size: 14px;
  margin-top: -6px;
  margin-bottom: 16px;
}

@media (max-width: 600px) {
  nav ul {
    gap: 10px;
  }
  h1 {
    font-size: 22px;
  }
}
