:root {
  --color-green: #4db373;
  --color-blue: #93bffe;
  --color-orange: #fb9154;
  --color-pink: #eea9e8;
  --color-black: #383632;
  --color-beige: #f4f0e5;
  --color-light-gray: #fafaf8;
  --color-white: #ffffff;

  --q-yellow: #f0c341;
  --q-red: var(--color-orange);
  --q-blue: var(--color-blue);
  --q-green: var(--color-green);

  --font-primary: 'Montserrat', sans-serif;
  --font-secondary: 'Inter', sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: var(--font-secondary);
  color: var(--color-black);
  background: var(--color-beige);
  padding: 22px 12px 40px;
}

.page {
  max-width: 1120px;
  margin: 0 auto;
}

.header {
  background: var(--color-beige);
  border: 3px solid var(--color-green);
  border-radius: 22px;
  padding: 18px 20px;
  box-shadow: 0 8px 18px rgba(77, 179, 115, 0.14);
  margin-bottom: 14px;
}

.back-link {
  display: inline-block;
  text-decoration: none;
  color: var(--color-black);
  font-weight: 600;
  margin-bottom: 10px;
}

.back-link:hover {
  color: var(--color-green);
  text-decoration: underline;
}

h1,
h2 {
  margin: 0;
  font-family: var(--font-primary);
  font-weight: 700;
  line-height: 1.1;
  text-transform: uppercase;
  letter-spacing: -0.02em;
}

h1 {
  font-size: clamp(2.2rem, 5vw, 4.2rem);
  color: var(--color-blue);
  line-height: 0.92;
}

h2 {
  font-size: clamp(1.6rem, 3.4vw, 2.9rem);
  color: var(--color-blue);
  line-height: 0.95;
}

.subtitle {
  margin: 10px 0 0;
  max-width: 760px;
  color: var(--color-black);
  opacity: 0.9;
}

.card {
  background: var(--color-beige);
  border: 3px solid var(--color-green);
  border-radius: 22px;
  box-shadow: 0 8px 18px rgba(77, 179, 115, 0.14);
  padding: 18px;
}

.card + .card {
  margin-top: 12px;
}

.card-main {
  display: grid;
  grid-template-columns: minmax(250px, 360px) 1fr;
  gap: 18px;
  align-items: center;
}

.muted {
  color: var(--color-black);
  opacity: 0.86;
  margin: 8px 0 14px;
}

.slider-block + .slider-block {
  margin-top: 12px;
}

.slider-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
  margin-bottom: 6px;
}

.slider-head output {
  font-family: var(--font-primary);
  font-weight: 700;
  color: var(--color-black);
}

input[type="range"] {
  width: 100%;
  accent-color: var(--color-green);
}

.legend-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.88rem;
  color: #646464;
  margin-top: 4px;
}

.quick-buttons {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 14px;
}

.state-chip {
  border: 2px solid rgba(77, 179, 115, 0.55);
  background: #f8f5ec;
  color: var(--color-black);
  border-radius: 12px;
  padding: 8px 10px;
  font: 600 0.9rem/1.2 var(--font-primary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.state-chip:hover {
  border-color: var(--color-green);
  transform: translateY(-1px);
}

.state-chip.active {
  border-color: var(--color-green);
  background: rgba(77, 179, 115, 0.16);
  color: #244f33;
}

.ghost-btn {
  margin-top: 10px;
  display: block;
  width: 100%;
  border: 2px solid var(--color-green);
  background: var(--color-green);
  color: var(--color-white);
  border-radius: 12px;
  padding: 10px 12px;
  font: 700 0.9rem/1 var(--font-primary);
  cursor: pointer;
}

.ghost-btn:hover {
  background: var(--color-orange);
  border-color: var(--color-orange);
  color: var(--color-white);
}

.compass-wrap {
  position: relative;
  padding: 72px 14px 74px;
}

.axis-title {
  position: absolute;
  font-family: var(--font-primary);
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--color-black);
  z-index: 2;
  pointer-events: none;
}

.axis-energy {
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  font-size: clamp(0.95rem, 2vw, 1.55rem);
}

.axis-satisfaction {
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  font-size: clamp(0.85rem, 1.7vw, 1.35rem);
}

.compass {
  position: relative;
  width: min(540px, 100%);
  aspect-ratio: 1;
  margin: 0 auto;
  border-radius: 50%;
  overflow: hidden;
  background: var(--color-white);
  border: 24px solid #ece6d9;
  outline: 3px solid var(--color-green);
  outline-offset: 14px;
}

.compass::before {
  content: "";
  position: absolute;
  inset: -44px;
  border-radius: 50%;
  border: 4px dashed rgba(30, 35, 45, 0.95);
}

.compass::after {
  content: "";
  position: absolute;
  inset: -12px;
  border: 8px solid rgba(255, 255, 255, 0.5);
  border-radius: 50%;
  pointer-events: none;
}

.quadrant {
  position: absolute;
  width: 50%;
  height: 50%;
  padding: 0;
  font: 700 clamp(0.74rem, 1.35vw, 1.1rem)/1.25 var(--font-primary);
  display: block;
}

.quadrant span {
  display: block;
  max-width: 210px;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.08);
}

.q1 {
  top: 0;
  right: 0;
  background: var(--q-yellow);
  color: var(--color-black);
}

.q2 {
  top: 0;
  left: 0;
  background: var(--q-red);
  color: var(--color-white);
}

.q3 {
  left: 0;
  bottom: 0;
  background: var(--q-blue);
  color: var(--color-white);
}

.q4 {
  right: 0;
  bottom: 0;
  background: var(--q-green);
  color: var(--color-white);
}

.q1 span {
  margin: 92px 0 0 18px;
}

.q2 span {
  margin: 92px 0 0 58px;
  width: 180px;
  text-align: right;
}

.q3 span {
  margin: 88px 0 0 54px;
  width: 176px;
  text-align: right;
}

.q4 span {
  margin: 88px 0 0 30px;
}

.needle {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 0;
  height: 0;
  transform-origin: center center;
  transition: transform 0.32s ease;
  z-index: 6;
}

.needle.is-center {
  opacity: 0;
}

.needle::before,
.needle::after {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.25));
}

.needle::before {
  bottom: 0;
  width: 0;
  height: 0;
  border-left: 11px solid transparent;
  border-right: 11px solid transparent;
  border-bottom: 168px solid var(--color-white);
}

.needle::after {
  top: 0;
  width: 0;
  height: 0;
  border-left: 9px solid transparent;
  border-right: 9px solid transparent;
  border-top: 120px solid rgba(255, 255, 255, 0.85);
}

.compass-center {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #8aa1c1;
  border: 6px solid #eff3f9;
  transform: translate(-50%, -50%);
  z-index: 7;
}

.card-result {
  border-color: var(--color-green);
}

.card-result h2 {
  color: var(--color-blue);
  margin-bottom: 6px;
}

.next-step-title {
  margin: 10px 0 8px;
  font: 700 1rem/1.25 var(--font-primary);
  color: var(--color-black);
  text-transform: none;
  letter-spacing: 0;
}

#resultActions {
  margin: 10px 0 0;
  padding-left: 18px;
}

#resultActions li {
  margin-bottom: 4px;
}

.card-note textarea {
  width: 100%;
  border: 2px solid rgba(77, 179, 115, 0.5);
  border-radius: 12px;
  padding: 10px 12px;
  font: 500 0.96rem/1.4 var(--font-secondary);
  color: var(--color-black);
  background: var(--color-white);
  resize: vertical;
}

.card-note textarea:focus {
  outline: 2px solid rgba(147, 191, 254, 0.48);
  border-color: var(--color-blue);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.cookie-banner {
  position: fixed;
  bottom: 20px;
  left: 20px;
  right: 20px;
  background: var(--color-white);
  border: 2px solid var(--color-green);
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(56, 54, 50, 0.2);
  z-index: 2000;
  transform: translateY(120%);
  transition: transform 0.3s ease;
}

.cookie-banner.show {
  transform: translateY(0);
}

.cookie-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
}

.cookie-content p {
  margin: 0;
  color: var(--color-black);
  font-size: 0.92rem;
}

.cookie-policy-link {
  color: var(--color-blue);
  font-weight: 600;
  text-decoration: underline;
}

.cookie-policy-link:hover {
  color: var(--color-green);
}

.cookie-btn {
  border: none;
  background: var(--color-green);
  color: var(--color-white);
  border-radius: 10px;
  padding: 10px 16px;
  font-family: var(--font-primary);
  font-weight: 600;
  cursor: pointer;
}

.cookie-btn:hover {
  background: #3f9c5f;
}

@media (max-width: 960px) {
  .card-main {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .left-col {
    order: 2;
  }

  .right-col {
    order: 1;
  }
}

@media (max-width: 620px) {
  body {
    padding: 12px 8px 20px;
  }

  .header,
  .card {
    border-radius: 16px;
    padding: 14px;
  }

  .compass-wrap {
    padding: 54px 8px 56px;
  }

  .compass {
    border-width: 14px;
    outline-offset: 10px;
  }

  .compass::before {
    inset: -30px;
  }

  .quadrant {
    font-size: 0.7rem;
    padding: 8px;
  }

  .axis-energy {
    top: 6px;
    left: 50%;
    transform: translateX(-50%);
  }

  .axis-satisfaction {
    left: 50%;
    bottom: 10px;
    transform: translateX(-50%);
  }

  .q1 span {
    margin: 58px 0 0 10px;
  }

  .q2 span {
    margin: 58px 0 0 32px;
    width: 140px;
    text-align: right;
  }

  .q3 span {
    margin: 56px 0 0 30px;
    width: 136px;
    text-align: right;
  }

  .q4 span {
    margin: 56px 0 0 16px;
  }

  .needle::before {
    border-left-width: 8px;
    border-right-width: 8px;
    border-bottom-width: 118px;
  }

  .needle::after {
    border-left-width: 7px;
    border-right-width: 7px;
    border-top-width: 82px;
  }

  .quick-buttons {
    grid-template-columns: 1fr;
  }

  .cookie-banner {
    left: 10px;
    right: 10px;
    bottom: 10px;
  }

  .cookie-content {
    flex-direction: column;
    align-items: stretch;
  }

  .cookie-btn {
    width: 100%;
  }
}
