@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&display=swap');

:root {
  --green: #009964;
  --green-dark: #007c52;
  --green-soft: rgba(0, 153, 100, 0.12);
  --green-line: rgba(0, 153, 100, 0.24);

  --text: #111111;
  --muted: #707070;
  --muted-light: #969696;
  --line: #e7e7e3;
  --bg: #f7f7f5;
  --surface: #ffffff;

  --shadow: 0 26px 70px rgba(0, 0, 0, 0.09);
  --radius-card: 28px;
  --radius-input: 15px;
  --radius-button: 16px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  padding: 28px;
  font-family: "Manrope", Tahoma, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 86% 8%, rgba(0, 153, 100, 0.075), transparent 28%),
    linear-gradient(180deg, #ffffff 0%, var(--bg) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(0, 0, 0, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 0, 0, 0.025) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.16), transparent 58%);
}

.page {
  width: 100%;
  max-width: 560px;
}

.card {
  position: relative;
  width: 100%;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid rgba(0, 0, 0, 0.045);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow);
  padding: 30px;
}

/* Верхний правый декоративный “оконный” элемент */
.card::before {
  content: "";
  position: absolute;
  top: -42px;
  right: -48px;
  width: 168px;
  height: 148px;
  border: 1.5px solid var(--green-line);
  border-radius: 0 0 0 34px;
  transform: rotate(8deg);
  pointer-events: none;
}

/* Нижняя левая декоративная дуга — более явная, без ощущения дефекта */
.card::after {
  content: none;
}

.brand-header,
form,
h1,
.lead {
  position: relative;
  z-index: 1;
}

.brand-header {
  margin-bottom: 24px;
}

.brand-topline {
  width: 76px;
  height: 4px;
  margin-bottom: 24px;
  border-radius: 999px;
  background: var(--green);
}

.brand-logo {
  display: block;
  width: auto;
  max-width: 180px;
  max-height: 44px;
}

.brand-fallback {
  display: none;
  font-size: 30px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.035em;
}

h1 {
  margin: 0 0 10px;
  max-width: 440px;
  font-size: 31px;
  line-height: 1.12;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.lead {
  margin: 0 0 24px;
  max-width: 460px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.55;
}

label {
  display: block;
  margin: 16px 0 8px;
  font-size: 14px;
  line-height: 1.25;
  font-weight: 700;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-input);
  padding: 15px 16px;
  font: inherit;
  font-size: 15px;
  color: var(--text);
  background: #ffffff;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    background-color 0.2s ease;
}

input::placeholder,
textarea::placeholder {
  color: #a1a1a1;
}

input:hover,
textarea:hover
select:hover {
  border-color: #d8d8d2;
}

input:focus,
textarea:focus
select:focus {
  outline: none;
  border-color: rgba(0, 153, 100, 0.55);
  box-shadow: 0 0 0 4px rgba(0, 153, 100, 0.12);
}

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

select {
  appearance: none;
  cursor: pointer;
  background-image:
    linear-gradient(45deg, transparent 50%, #707070 50%),
    linear-gradient(135deg, #707070 50%, transparent 50%);
  background-position:
    calc(100% - 22px) 50%,
    calc(100% - 16px) 50%;
  background-size:
    6px 6px,
    6px 6px;
  background-repeat: no-repeat;
  padding-right: 44px;
}

button {
  width: 100%;
  margin-top: 18px;
  border: 0;
  border-radius: var(--radius-button);
  padding: 16px 18px;
  font: inherit;
  font-size: 15px;
  font-weight: 800;
  color: #ffffff;
  background: #111111;
  cursor: pointer;
  box-shadow: 0 14px 26px rgba(0, 0, 0, 0.13);
  transition:
    transform 0.15s ease,
    background-color 0.2s ease,
    box-shadow 0.2s ease;
}

button:hover {
  background: var(--green-dark);
  transform: translateY(-1px);
  box-shadow: 0 18px 32px rgba(0, 0, 0, 0.15);
}

button:active {
  transform: translateY(0);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.12);
}

button:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
}

.privacy-note {
  margin-top: 14px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.privacy-note a {
  color: var(--green);
  text-decoration: none;
  border-bottom: 1px solid rgba(0, 153, 100, 0.35);
  transition:
    color 0.2s ease,
    border-bottom-color 0.2s ease;
}

.privacy-note a:hover {
  color: var(--green-dark);
  border-bottom-color: rgba(0, 153, 100, 0.7);
}

.message {
  display: none;
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.45;
}

.message.ok {
  display: block;
  color: #07563b;
  background: rgba(0, 153, 100, 0.08);
  border: 1px solid rgba(0, 153, 100, 0.18);
}

.message.error {
  display: block;
  color: #8f1d1d;
  background: rgba(160, 0, 0, 0.06);
  border: 1px solid rgba(160, 0, 0, 0.14);
}

.small {
  margin-top: 14px;
  color: var(--muted-light);
  font-size: 13px;
  line-height: 1.45;
}

@media (max-width: 640px) {
  body {
    min-height: 100dvh;
    padding: 14px;
    align-items: flex-start;
  }

  .page {
    max-width: none;
  }

  .card {
    padding: 22px 18px;
    border-radius: 22px;
  }

  .card::before {
    top: -48px;
    right: -62px;
    width: 150px;
    height: 134px;
    opacity: 0.85;
  }

  .card::after {
    left: -42px;
    bottom: -40px;
    width: 150px;
    height: 112px;
    opacity: 0.75;
  }

  .brand-header {
    margin-bottom: 22px;
  }

  .brand-topline {
    width: 72px;
    margin-bottom: 22px;
  }

  .brand-logo {
    max-width: 150px;
    max-height: 38px;
  }

  h1 {
    font-size: 26px;
    letter-spacing: -0.035em;
  }

  .lead {
    font-size: 14px;
  }

  input,
  textarea {
    padding: 14px;
  }

  textarea {
    min-height: 140px;
  }
}
.success-screen {
  display: none;
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 28px 0 8px;
}

.success-screen.visible {
  display: block;
}

.success-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 18px;
  border-radius: 50%;
  background: rgba(0, 153, 100, 0.1);
  color: var(--green);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  font-weight: 800;
}

.success-screen h2 {
  margin: 0 0 10px;
  font-size: 26px;
  line-height: 1.15;
  letter-spacing: -0.035em;
}

.success-screen p {
  margin: 0 auto 22px;
  max-width: 360px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.55;
}

.secondary-button {
  background: #ffffff;
  color: #111111;
  border: 1px solid var(--line);
  box-shadow: none;
}

.secondary-button:hover {
  background: #f7f7f5;
  color: #111111;
  box-shadow: none;
}
.poll-fieldset {
  border: 0;
  margin: 0 0 18px;
  padding: 0;
}

.poll-fieldset legend {
  display: block;
  margin: 0 0 12px;
  font-size: 14px;
  line-height: 1.45;
  font-weight: 700;
}

.radio-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.radio-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-input);
  cursor: pointer;
  background: #ffffff;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    background-color 0.2s ease;
}

.radio-card:hover {
  border-color: rgba(0, 153, 100, 0.35);
  background: rgba(0, 153, 100, 0.03);
}

.radio-card input {
  width: auto;
  accent-color: var(--green);
}

.radio-card span {
  font-size: 15px;
  font-weight: 700;
}

.radio-card:has(input:checked) {
  border-color: rgba(0, 153, 100, 0.55);
  background: rgba(0, 153, 100, 0.08);
  box-shadow: 0 0 0 4px rgba(0, 153, 100, 0.08);
}

.field-hint {
  margin-top: 7px;
  color: var(--muted-light);
  font-size: 12px;
  line-height: 1.4;
}

@media (max-width: 420px) {
  .radio-group {
    grid-template-columns: 1fr;
  }
}
.poll-fieldset {
  border: 0;
  margin: 0 0 18px;
  padding: 0;
}

.poll-fieldset legend {
  display: block;
  margin: 0 0 12px;
  font-size: 14px;
  line-height: 1.5;
  font-weight: 700;
}

.radio-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.radio-card {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-input);
  cursor: pointer;
  background: #ffffff;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    background-color 0.2s ease;
}

.radio-card:hover {
  border-color: rgba(0, 153, 100, 0.35);
  background: rgba(0, 153, 100, 0.03);
}

.radio-card input {
  width: auto;
  accent-color: var(--green);
}

.radio-card span {
  font-size: 15px;
  font-weight: 700;
}

.radio-card:has(input:checked) {
  border-color: rgba(0, 153, 100, 0.55);
  background: rgba(0, 153, 100, 0.08);
  box-shadow: 0 0 0 4px rgba(0, 153, 100, 0.08);
}

.field-hint {
  margin-top: 7px;
  color: var(--muted-light);
  font-size: 12px;
  line-height: 1.4;
}

/* RESULTS PAGE */

.results-page {
  max-width: 1040px;
}

.results-card {
  padding-bottom: 34px;
}

.results-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 18px;
}

.refresh-button {
  width: auto;
  min-width: 140px;
  margin-top: 0;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.metric-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #ffffff;
  padding: 18px;
}

.metric-label {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
  margin-bottom: 8px;
}

.metric-value {
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.metric-value-small {
  font-size: 18px;
  line-height: 1.35;
}

.results-section {
  margin-top: 28px;
}

.results-section h2 {
  margin: 0 0 14px;
  font-size: 22px;
  line-height: 1.2;
  letter-spacing: -0.03em;
}

.bar-chart {
  display: grid;
  gap: 14px;
}

.bar-row {
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr) 90px;
  gap: 12px;
  align-items: center;
}

.bar-label {
  font-weight: 800;
  font-size: 14px;
}

.bar-track {
  position: relative;
  height: 18px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.07);
  overflow: hidden;
}

.bar-fill {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  min-width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, #009964 0%, #18b67a 100%);
  transition: width 0.4s ease;
}

.bar-fill-dark {
  background: linear-gradient(90deg, #111111 0%, #454545 100%);
}

.bar-meta {
  font-size: 14px;
  text-align: right;
  font-weight: 700;
}

.cloud-card {
  position: relative;
  min-height: 320px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: #ffffff;
  padding: 14px;
  overflow: hidden;
}

.word-cloud {
  position: relative;
  width: 100%;
  min-height: 290px;
}

.word-cloud-item {
  position: absolute;
  white-space: nowrap;
  line-height: 1;
  user-select: none;
}

.cloud-empty {
  color: var(--muted);
  font-size: 14px;
}

.word-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.word-pill {
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(0, 153, 100, 0.08);
  border: 1px solid rgba(0, 153, 100, 0.16);
  color: #07563b;
  font-size: 13px;
  line-height: 1.3;
  font-weight: 700;
}

@media (max-width: 900px) {
  .results-page {
    max-width: 100%;
  }

  .results-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .refresh-button {
    width: 100%;
  }
}

@media (max-width: 640px) {
  .radio-group {
    grid-template-columns: 1fr;
  }

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

  .bar-row {
    grid-template-columns: 56px 1fr;
  }

  .bar-meta {
    grid-column: 2;
    text-align: left;
  }

  .results-section h2 {
    font-size: 18px;
  }

  .cloud-card {
    min-height: 280px;
  }

  .word-cloud {
    min-height: 250px;
  }
}
