:root {
  --primary-color: #3D5A6C;
  --secondary-color: #2A3F4E;
  --accent-color: #C98A2E;
  --light-color: #EEF3F6;
  --dark-color: #111E27;
  --gradient-primary: linear-gradient(135deg, #3D5A6C 0%, #2A3F4E 100%);
  --hover-color: #4E7189;
  --background-color: #F6F9FB;
  --text-color: #1C2D38;
  --text-color-secondary: #526878;
  --border-color: rgba(61, 90, 108, 0.18);
  --divider-color: rgba(42, 63, 78, 0.12);
  --shadow-color: rgba(17, 30, 39, 0.1);
  --highlight-color: #C98A2E;
  --main-font: 'Montserrat', sans-serif;
  --alt-font: 'Inter', sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; width: 100%; }

body {
  font-family: var(--alt-font);
  color: var(--text-color);
  background-color: var(--background-color);
  line-height: 1.75;
  margin: 0; padding: 0;
  width: 100%; min-width: 320px;
}

img { max-width: 100%; height: auto; }

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

h1, h2, h3 {
  font-family: var(--main-font);
  font-weight: 700;
  color: var(--primary-color);
  margin: 0 0 1rem 0;
}

h1 { font-size: clamp(1.8rem, 5vw, 3rem); line-height: 1.2; }
h2 { font-size: clamp(1.4rem, 4vw, 2.3rem); line-height: 1.3; }
h3 { font-size: clamp(1rem, 3vw, 1.25rem); line-height: 1.4; }

p {
  margin: 0 0 1rem 0;
  font-size: clamp(0.97rem, 2vw, 1.07rem);
  line-height: 1.8;
}

/* Header */
header {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  padding: 1.1rem 0;
  position: relative;
  z-index: 1000;
  box-shadow: 0 3px 18px rgba(17, 30, 39, 0.24);
}

header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo img { height: 3rem; width: auto; }

.navigation ul {
  display: flex;
  list-style: none;
  margin: 0; padding: 0;
  gap: 2rem;
}

.navigation a {
  text-decoration: none;
  color: var(--light-color);
  font-weight: 500;
  font-size: 0.93rem;
  letter-spacing: 0.02em;
  transition: opacity 0.3s ease;
}

.navigation a:hover { opacity: 0.7; }

/* Hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  cursor: pointer;
  padding: 9px;
  background: rgba(255,255,255,0.12);
  border-radius: 6px;
}

.hamburger .line {
  width: 24px; height: 2px;
  background: var(--light-color);
  margin: 3px 0;
  border-radius: 1px;
  transition: 0.3s;
}

#menu-toggle { display: none; }

#menu-toggle:checked ~ .mobile-nav {
  max-height: 420px;
  opacity: 1;
}

.mobile-nav {
  position: absolute;
  top: 100%; left: 0; right: 0;
  background: var(--secondary-color);
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: all 0.35s ease;
  z-index: 1000;
}

.mobile-nav ul { padding: 1.5rem 2rem; margin: 0; list-style: none; }
.mobile-nav li { margin: 0.8rem 0; }

.mobile-nav a {
  display: block;
  padding: 0.8rem 1rem;
  color: var(--light-color);
  text-decoration: none;
  font-size: 1rem;
  font-weight: 500;
  border-radius: 6px;
  transition: background 0.3s;
}

.mobile-nav a:hover { background: rgba(255,255,255,0.1); }

/* Pattern */
.pattern-bg {
  position: relative;
  overflow: hidden;
}

.pattern-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(61, 90, 108, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(61, 90, 108, 0.04) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
}

/* Feature cards — flip-style front/back effect via border-top accent */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.8rem;
}

.feature-card {
  background: #ffffff;
  border-radius: 14px;
  padding: 2.2rem 1.8rem;
  box-shadow: 0 4px 20px var(--shadow-color);
  border: 1px solid var(--border-color);
  transition: all 0.35s ease;
  position: relative;
  overflow: hidden;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.feature-card::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 4px;
  background: var(--gradient-primary);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.35s ease;
}

.feature-card:hover::after { transform: scaleX(1); }

.feature-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 16px 40px rgba(61, 90, 108, 0.2);
}

.feature-icon {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  border: 2px solid var(--border-color);
  background: var(--light-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  margin: 0 auto 1.5rem auto;
  transition: all 0.35s ease;
}

.feature-card:hover .feature-icon {
  background: var(--gradient-primary);
  border-color: transparent;
  transform: scale(1.12);
}

.feature-card h3 { margin-bottom: 0.7rem; }
.feature-card p { margin: 0; font-size: 0.95rem; color: var(--text-color); }

/* Random block — порівняльні картки з прогрес-баром */
.compare-card {
  background: #ffffff;
  border-radius: 14px;
  padding: 2rem;
  box-shadow: 0 4px 20px var(--shadow-color);
  border: 1px solid var(--border-color);
}

.compare-card h3 {
  font-size: 1.1rem;
  margin-bottom: 1.4rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.bar-row {
  margin-bottom: 1rem;
}

.bar-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.3rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-color);
}

.bar-track {
  background: var(--light-color);
  border-radius: 100px;
  height: 10px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: 100px;
  transition: width 0.4s ease;
}

.bar-safe { background: linear-gradient(90deg, #3D5A6C, #4E7189); }
.bar-mid  { background: linear-gradient(90deg, #C98A2E, #e0a845); }
.bar-high { background: linear-gradient(90deg, #b84a4a, #d46060); }

.bar-value {
  font-size: 0.78rem;
  color: var(--text-color-secondary);
}

/* Testimonials */
.testimonials-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 2rem;
}

.testimonial {
  background: #ffffff;
  border-radius: 14px;
  padding: 2rem;
  box-shadow: 0 4px 20px var(--shadow-color);
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--accent-color);
  transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.testimonial:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 32px rgba(61, 90, 108, 0.18);
}

/* FAQ */
.faq-item {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 2rem;
  margin-bottom: 1rem;
  box-shadow: 0 2px 12px var(--shadow-color);
  transition: all 0.3s ease;
  display: flex;
  gap: 1.2rem;
  align-items: flex-start;
}

.faq-item:hover {
  box-shadow: 0 6px 24px rgba(61, 90, 108, 0.16);
  border-color: var(--primary-color);
}

.faq-num {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--gradient-primary);
  color: white;
  font-weight: 700;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--main-font);
  margin-top: 0.15rem;
}

.faq-body h3 {
  font-size: 1.05rem;
  margin-bottom: 0.6rem;
  color: var(--primary-color);
}

.faq-body p { margin: 0; color: var(--text-color); font-size: 0.97rem; }

/* Form */
input, textarea {
  transition: all 0.3s ease;
  font-family: var(--alt-font);
  border: 2px solid var(--border-color);
  border-radius: 8px;
  padding: 0.9rem 1.1rem;
  background: #ffffff;
  color: var(--text-color);
  font-size: 1rem;
  width: 100%;
}

input:focus, textarea:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(61, 90, 108, 0.14);
}

/* Buttons */
.btn, button[type="submit"] {
  transition: all 0.3s ease;
  background: var(--gradient-primary);
  color: white;
  border: none;
  padding: 1rem 2.2rem;
  border-radius: 8px;
  font-weight: 700;
  font-family: var(--alt-font);
  cursor: pointer;
  font-size: 1rem;
  text-decoration: none;
  display: inline-block;
  text-align: center;
  letter-spacing: 0.02em;
  box-shadow: 0 3px 14px rgba(61, 90, 108, 0.3);
}

.btn:hover, button[type="submit"]:hover {
  transform: translateY(-2px);
  box-shadow: 0 7px 22px rgba(61, 90, 108, 0.4);
  background: linear-gradient(135deg, #4E7189 0%, #3D5A6C 100%);
}

/* Contact */
.contact-wrapper {
  width: 80%;
  margin: 0 auto;
}

/* Footer */
footer {
  background-color: var(--dark-color);
  color: var(--light-color);
  padding: 3rem 0 1rem;
}

footer a {
  color: var(--light-color);
  text-decoration: none;
  transition: opacity 0.3s;
}

footer a:hover { opacity: 0.7; }

a:focus, button:focus, input:focus, textarea:focus {
  outline: 2px solid var(--highlight-color);
  outline-offset: 2px;
}

/* Responsive */
@media (max-width: 768px) {
  .hamburger { display: flex; }
  .navigation { display: none; }
  .mobile-nav { display: block; }
  .features-grid { grid-template-columns: 1fr; }
  .testimonials-grid { grid-template-columns: 1fr; }
  .contact-wrapper { width: 100%; }
  .grid-2col { grid-template-columns: 1fr !important; }
  .faq-item { flex-direction: column; }
}

@media (max-width: 480px) {
  .container { padding: 0 0.75rem; }
}