@font-face {
  font-family: 'Tubatay TT';
  src: url('/fonts/TubatayTT-Light.ttf') format('truetype');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Tubatay TT';
  src: url('/fonts/TubatayTT-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Tubatay TT';
  src: url('/fonts/TubatayTT-Bold.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Tubatay TT';
  src: url('/fonts/TubatayTT-Black.ttf') format('truetype');
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --green: #3E7554;
  --green-light: #99CFAB;
  --terracotta: #D66C56;
  --terracotta-light: #F2C8B3;
  --blue: #CAE4EB;
  --blue-light: #8ECDDE;
  --yellow-light: #F8EAA6;
  --white: #FFFFFF;
  --bg: #F7F9F8;
  --text: #2A2A2A;
  --text-secondary: #6B7B73;
  --error: #D66C56;
  --radius: 20px;
  --radius-sm: 12px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: 'Tubatay TT', 'Nunito', sans-serif;
  font-weight: 400;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

.pattern-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  opacity: 0.05;
  background-image:
    radial-gradient(ellipse 140px 100px at 10% 15%, var(--green) 0%, transparent 70%),
    radial-gradient(ellipse 120px 120px at 90% 10%, var(--terracotta) 0%, transparent 70%),
    radial-gradient(ellipse 160px 100px at 75% 80%, var(--green) 0%, transparent 70%),
    radial-gradient(ellipse 100px 140px at 20% 85%, var(--terracotta) 0%, transparent 70%);
  pointer-events: none;
}

.app {
  position: relative;
  z-index: 1;
  max-width: 480px;
  margin: 0 auto;
  padding: 0 24px 48px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Header ── */

.header {
  text-align: center;
  padding: 40px 0 24px;
}

.header__title {
  font-family: 'Tubatay TT', 'Nunito', sans-serif;
  font-weight: 900;
  font-size: 26px;
  letter-spacing: 4px;
  color: var(--green);
  text-transform: uppercase;
  line-height: 1.2;
}

.header__subtitle {
  font-family: 'Tubatay TT', 'Nunito', sans-serif;
  font-weight: 300;
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 6px;
  letter-spacing: 2px;
  text-transform: uppercase;
}

/* ── Main ── */

.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding-top: 4px;
}

.card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 32px 24px 36px;
  box-shadow: 0 4px 24px rgba(62, 117, 84, 0.07);
}

.card__title {
  font-family: 'Tubatay TT', 'Nunito', sans-serif;
  font-weight: 700;
  font-size: 20px;
  color: var(--green);
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 10px;
}

.card__desc {
  font-family: 'Nunito', 'Tubatay TT', sans-serif;
  font-weight: 400;
  font-size: 14px;
  color: var(--text-secondary);
  text-align: center;
  line-height: 1.6;
  margin-bottom: 32px;
}

/* ── Form fields ── */

.form-group {
  position: relative;
  margin-bottom: 24px;
}

.form-group input[type="text"],
.form-group input[type="tel"] {
  width: 100%;
  height: 56px;
  padding: 24px 16px 8px;
  font-family: 'Nunito', 'Tubatay TT', sans-serif;
  font-size: 16px;
  font-weight: 400;
  color: var(--text);
  background: var(--bg);
  border: 2px solid transparent;
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color 0.2s, background 0.2s;
}

.form-group input[type="text"]:focus,
.form-group input[type="tel"]:focus {
  border-color: var(--green);
  background: var(--white);
}

.form-group input[type="text"] + label,
.form-group input[type="tel"] + label {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-family: 'Nunito', 'Tubatay TT', sans-serif;
  font-size: 15px;
  color: var(--text-secondary);
  pointer-events: none;
  transition: all 0.2s ease;
  line-height: 1;
}

.form-group input[type="text"]:focus + label,
.form-group input[type="tel"]:focus + label,
.form-group input[type="text"]:not(:placeholder-shown) + label,
.form-group input[type="tel"]:not(:placeholder-shown) + label {
  top: 16px;
  transform: translateY(0);
  font-size: 11px;
  color: var(--green);
  font-weight: 600;
}

.form-error {
  display: block;
  font-family: 'Nunito', sans-serif;
  font-size: 12px;
  color: var(--error);
  min-height: 0;
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition: max-height 0.25s, opacity 0.25s, margin 0.25s;
}

.form-error.visible {
  max-height: 40px;
  opacity: 1;
  margin-top: 8px;
}

/* ── Checkbox ── */

.form-group--checkbox {
  margin-top: 36px;
  margin-bottom: 48px;
}

.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  padding: 8px 0;
  position: relative;
  z-index: 1;
}

.checkbox-label input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.checkbox-custom {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border: 2px solid var(--green-light);
  border-radius: 6px;
  position: relative;
  transition: all 0.2s;
  margin-top: 0;
}

.checkbox-label input[type="checkbox"]:checked + .checkbox-custom {
  background: var(--green);
  border-color: var(--green);
}

.checkbox-label input[type="checkbox"]:checked + .checkbox-custom::after {
  content: '';
  position: absolute;
  left: 7px;
  top: 3px;
  width: 6px;
  height: 11px;
  border: solid var(--white);
  border-width: 0 2.5px 2.5px 0;
  transform: rotate(45deg);
}

.checkbox-text {
  font-family: 'Nunito', sans-serif;
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.checkbox-text .link {
  color: var(--green);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ── Button ── */

.btn-submit {
  width: 100%;
  height: 54px;
  margin-top: 8px;
  padding: 0 16px;
  background: var(--green);
  color: var(--white);
  font-family: 'Tubatay TT', 'Nunito', sans-serif;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 1px;
  text-transform: uppercase;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.2s, transform 0.1s, opacity 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  -webkit-appearance: none;
}

.btn-submit:active {
  transform: scale(0.98);
}

.btn-submit:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  background: #8BAF9B;
}

.btn-submit:hover:not(:disabled) {
  background: #356848;
}

.btn-loader svg {
  display: block;
}

/* ── Messages ── */

.form-message {
  text-align: center;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  font-family: 'Nunito', sans-serif;
  font-size: 15px;
  font-weight: 700;
  margin: 0 0 14px;
  line-height: 1.5;
  border: 2px solid transparent;
}

.form-message--error {
  background: #FCE9E4;
  color: #BF4E37;
  border-color: #F2C8B3;
  box-shadow: 0 6px 18px rgba(214, 108, 86, 0.18);
}

.form-message--success {
  background: #EDF7F0;
  color: var(--green);
}

/* ── Success screen ── */

.success-view {
  flex: 1;
  align-items: center;
  justify-content: center;
  padding: 60px 0;
  display: none;
}

.success-view.visible {
  display: flex;
}

.success-card {
  text-align: center;
  padding: 48px 24px;
}

.success-icon {
  margin-bottom: 28px;
  animation: scaleIn 0.4s ease-out;
}

.success-icon svg {
  width: 80px;
  height: 80px;
}

.success-title {
  font-family: 'Tubatay TT', 'Nunito', sans-serif;
  font-weight: 900;
  font-size: 22px;
  color: var(--green);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 16px;
  animation: fadeInUp 0.4s ease-out 0.15s both;
}

.success-text {
  font-family: 'Tubatay TT', 'Nunito', sans-serif;
  font-weight: 400;
  font-size: 16px;
  color: var(--text);
  line-height: 1.6;
  margin-bottom: 20px;
  animation: fadeInUp 0.4s ease-out 0.3s both;
}

.success-hint {
  font-family: 'Nunito', sans-serif;
  font-size: 13px;
  color: var(--text-secondary);
  animation: fadeInUp 0.4s ease-out 0.45s both;
}

@keyframes scaleIn {
  from { transform: scale(0.5); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

@keyframes fadeInUp {
  from { transform: translateY(12px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

@media (max-width: 360px) {
  .header__title {
    font-size: 22px;
  }

  .card {
    padding: 28px 20px 32px;
  }

  .card__title {
    font-size: 18px;
  }
}

/* ── Survey mini app ── */

.survey-app .survey-card {
  padding: 28px 20px 32px;
}

.survey-step__title {
  font-family: 'Tubatay TT', 'Nunito', sans-serif;
  font-weight: 700;
  font-size: 17px;
  color: var(--green);
  line-height: 1.35;
  margin-bottom: 14px;
  text-align: left;
}

.survey-step__text {
  font-family: 'Nunito', 'Tubatay TT', sans-serif;
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 14px;
}

.survey-step__accent {
  font-family: 'Nunito', sans-serif;
  font-size: 14px;
  color: var(--text);
  line-height: 1.55;
  padding: 14px 16px;
  background: var(--yellow-light);
  border-radius: var(--radius-sm);
  margin-bottom: 24px;
}

.survey-step__accent strong {
  color: var(--green);
  font-weight: 700;
}

.survey-step[data-step="intro"] .survey-btn-start {
  min-height: 68px;
  font-size: 17px;
  letter-spacing: 1.5px;
  padding: 18px 28px;
  border-radius: var(--radius);
  width: 100%;
}

.survey-step__hint {
  font-family: 'Nunito', sans-serif;
  font-size: 13px;
  color: var(--text-secondary);
  font-style: italic;
  margin: -6px 0 16px;
}

.survey-progress {
  padding: 0 24px 8px;
  max-width: 480px;
  margin: 0 auto;
}

.survey-progress__track {
  height: 6px;
  background: rgba(62, 117, 84, 0.12);
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 8px;
}

.survey-progress__fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--green), var(--green-light));
  border-radius: 6px;
  transition: width 0.35s ease;
}

.survey-progress__label {
  font-family: 'Nunito', sans-serif;
  font-size: 12px;
  color: var(--text-secondary);
  display: block;
  text-align: center;
}

.survey-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}

.survey-chip {
  font-family: 'Nunito', 'Tubatay TT', sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  background: var(--bg);
  border: 2px solid transparent;
  border-radius: 999px;
  padding: 10px 16px;
  cursor: pointer;
  text-align: left;
  line-height: 1.35;
  transition: border-color 0.2s, background 0.2s, color 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.survey-chip:active {
  transform: scale(0.98);
}

.survey-chip--selected {
  border-color: var(--green);
  background: rgba(62, 117, 84, 0.08);
  color: var(--green);
  font-weight: 600;
}

.survey-other {
  margin-bottom: 16px;
}

.survey-other__label {
  font-family: 'Nunito', sans-serif;
  font-size: 13px;
  color: var(--text-secondary);
  display: block;
  margin-bottom: 8px;
}

.survey-other__input {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  font-family: 'Nunito', sans-serif;
  font-size: 15px;
  border: 2px solid var(--green-light);
  border-radius: var(--radius-sm);
  background: var(--white);
  outline: none;
}

.survey-other__input:focus {
  border-color: var(--green);
}

.survey-step-error {
  margin-bottom: 12px;
}

.survey-nav {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}

.survey-nav--single {
  flex-direction: column;
}

.survey-nav--single .btn-submit {
  width: 100%;
}

.survey-nav__back,
.survey-nav__next {
  flex: 1;
  margin-top: 0;
}

.survey-nav__back--full {
  flex: none;
  width: 100%;
}

.btn-submit--secondary {
  background: var(--white);
  color: var(--green);
  border: 2px solid var(--green);
}

.btn-submit--secondary:hover:not(:disabled) {
  background: rgba(62, 117, 84, 0.06);
}

.btn-submit--secondary:disabled {
  opacity: 0.45;
  background: var(--white);
  color: #8BAF9B;
  border-color: #C5D9CC;
}

.btn-submit--outline {
  background: var(--white);
  color: var(--terracotta);
  border: 2px solid var(--terracotta-light);
}

.btn-submit--outline:hover:not(:disabled) {
  background: rgba(214, 108, 86, 0.06);
}

.survey-visit-btns {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 8px;
}

/* До выбора — обе без заливки; заливка только у .survey-visit-btn--selected */
.survey-visit-btns .survey-visit-btn {
  background: var(--white);
  border: 2px solid var(--green-light);
  color: var(--green);
  box-shadow: none;
}

.survey-visit-btns .survey-visit-btn[data-visit="no"] {
  border-color: var(--terracotta-light);
  color: var(--terracotta);
}

.survey-visit-btns .survey-visit-btn:hover:not(:disabled) {
  background: rgba(62, 117, 84, 0.06);
}

.survey-visit-btns .survey-visit-btn[data-visit="no"]:hover:not(:disabled) {
  background: rgba(214, 108, 86, 0.06);
}

.survey-visit-btns .survey-visit-btn.survey-visit-btn--selected[data-visit="yes"] {
  background: var(--green);
  border-color: var(--green);
  color: var(--white);
  box-shadow: 0 0 0 3px rgba(62, 117, 84, 0.28);
}

.survey-visit-btns .survey-visit-btn.survey-visit-btn--selected[data-visit="yes"]:hover:not(:disabled) {
  background: #356848;
  border-color: #356848;
}

.survey-visit-btns .survey-visit-btn.survey-visit-btn--selected[data-visit="no"] {
  background: var(--terracotta);
  border-color: var(--terracotta);
  color: var(--white);
  box-shadow: 0 0 0 3px rgba(214, 108, 86, 0.28);
}

.survey-visit-btns .survey-visit-btn.survey-visit-btn--selected[data-visit="no"]:hover:not(:disabled) {
  background: #c55e4a;
  border-color: #c55e4a;
}

.survey-textarea {
  width: 100%;
  min-height: 120px;
  padding: 14px 16px;
  font-family: 'Nunito', 'Tubatay TT', sans-serif;
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  border: 2px solid var(--green-light);
  border-radius: var(--radius-sm);
  background: var(--bg);
  resize: vertical;
  outline: none;
}

.survey-textarea:focus {
  border-color: var(--green);
  background: var(--white);
}

.survey-charcount {
  font-family: 'Nunito', sans-serif;
  font-size: 12px;
  color: var(--text-secondary);
  display: block;
  text-align: right;
  margin-top: 6px;
}

.survey-consent-note {
  font-family: 'Nunito', sans-serif;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.55;
  margin: 8px 0 20px;
}

.survey-consent-note .link {
  color: var(--green);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.survey-already {
  min-height: 100vh;
  padding-bottom: 48px;
}

.success-text--bonus {
  color: var(--green);
  font-weight: 600;
  margin-bottom: 12px;
}
