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

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

:root {
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --secondary: #8b5cf6;
  --accent: #ec4899;
  --success: #10b981;
  --warning: #f59e0b;
  --text-dark: #1f2937;
  --text-medium: #4b5563;
  --text-light: #525960;
  --bg-light: #f9fafb;
  --bg-white: #ffffff;
  --border: #e5e7eb;
  --border-light: #f3f4f6;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 9999px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica', 'Arial', sans-serif;
  background: var(--bg-white);
  color: var(--text-dark);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.app-container {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  background: var(--bg-white);
  min-height: 100vh;
}

.app-header {
  background: var(--bg-white);
  border-bottom: 1px solid var(--border-light);
  padding: 6px 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 6px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 4px;
}

.app-logo {
  width: 28px;
  height: 28px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

.app-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-dark);
}

.trust-badge {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 4px 8px;
  background: var(--bg-light);
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-medium);
}

.trust-stars { color: var(--warning); letter-spacing: -1px; }
.yandex-text { color: var(--text-light); font-weight: 500; }

.page-content { padding: 0 16px 100px; }

.hero { text-align: center; padding: 4px 0 14px; }

.hero-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-dark);
  line-height: 1.3;
  margin-bottom: 8px;
}

.highlight-text {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.12), rgba(139, 92, 246, 0.18));
  padding: 2px 8px;
  border-radius: 6px;
  color: var(--primary);
  display: inline-block;
}

.hero-subtitle {
  font-size: 12px;
  color: var(--text-light);
  max-width: 280px;
  margin: 0 auto;
}

.form-section { margin-bottom: 20px; }

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 8px;
}

.form-helper {
  font-size: 12px;
  color: var(--text-light);
  margin-top: -6px;
  margin-bottom: 8px;
}

.input-field {
  width: 100%;
  padding: 10px 12px;
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 15px;
  font-family: inherit;
  transition: all 0.2s;
  background: var(--bg-white);
}

.input-field:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.input-field.error { border-color: #ef4444; animation: shake 0.4s; }

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-5px); }
  40%, 80% { transform: translateX(5px); }
}

.choice-grid { display: flex; flex-wrap: nowrap; gap: 5px; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; -ms-overflow-style: none; }
.choice-grid::-webkit-scrollbar { display: none; }

.choice-pill {
  padding: 6px 10px;
  border: 2px solid var(--border);
  border-radius: var(--radius-full);
  background: var(--bg-white);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-medium);
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
  white-space: nowrap;
  flex-shrink: 0;
}

.choice-pill.active {
  border-color: var(--primary);
  background: var(--primary);
  color: white;
}

.choice-pill.more { border-style: dashed; color: var(--primary); }

.extra-choices {
  display: none;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.extra-choices.visible { display: flex; }

.smart-search-wrapper { margin-top: 10px; position: relative; }

.smart-search {
  border-color: var(--primary);
  background: rgba(99, 102, 241, 0.03);
}

.autocomplete-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--bg-white);
  border: 2px solid var(--primary);
  border-top: none;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  max-height: 200px;
  overflow-y: auto;
  z-index: 50;
}

.autocomplete-dropdown.visible { display: block; }

.autocomplete-item {
  padding: 10px 14px;
  cursor: pointer;
  font-size: 14px;
  border-bottom: 1px solid var(--border-light);
}

.autocomplete-item:hover { background: rgba(99, 102, 241, 0.08); }

.upcoming-section {
  margin-top: 10px;
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
}

.upcoming-header {
  display: flex;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--bg-light);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
}

.upcoming-list { display: none; border-top: 1px solid var(--border); }
.upcoming-list.visible { display: block; }

.upcoming-item {
  display: flex;
  justify-content: space-between;
  padding: 10px 14px;
  cursor: pointer;
  font-size: 13px;
  border-bottom: 1px solid var(--border-light);
}

.upcoming-item:hover { background: rgba(99, 102, 241, 0.05); }

.button-group {
  display: flex;
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.group-button {
  flex: 1;
  padding: 10px 8px;
  border: none;
  background: var(--bg-white);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-medium);
  cursor: pointer;
  font-family: inherit;
  border-right: 1px solid var(--border);
}

.group-button:last-child { border-right: none; }
.group-button.active { background: var(--primary); color: white; }
.group-button.error { border-color: #ef4444; }

/* Поля формы из API (tpl/field.php) */
select.input-field {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%234b5563' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  cursor: pointer;
}

.form-description { font-size: 11px; color: var(--text-light); margin-top: 8px; }

.field-error { display: none; font-size: 12px; color: #ef4444; margin-top: 6px; }
.field-error.visible { display: block; }

.ai-field.has-error .choice-pill:not(.active),
.ai-field.has-error .button-group,
.ai-field.has-error .expandable-section { border-color: #ef4444; }
.ai-field.has-error .choice-pill:not(.active) { color: #ef4444; }
.ai-field.has-error .choice-pill.active,
.ai-field.has-error .group-button.active { background: #ef4444; border-color: #ef4444; }

.form-unavailable {
  padding: 14px;
  border: 2px dashed var(--border);
  border-radius: var(--radius-md);
  font-size: 13px;
  color: var(--text-light);
  text-align: center;
}

.phone-wrapper {
  display: flex;
  align-items: center;
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.phone-wrapper:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.phone-prefix {
  padding: 10px 10px 10px 14px;
  background: var(--bg-light);
  font-size: 15px;
  font-weight: 600;
  border-right: 1px solid var(--border);
}

.phone-input { border: none; border-radius: 0; padding-left: 10px; }
.phone-input:focus { box-shadow: none; }

.consent-section {
  padding: 14px;
  background: var(--bg-light);
  border-radius: var(--radius-md);
  margin-bottom: 16px;
  border: 2px solid transparent;
}

.consent-section.error { border-color: #ef4444; animation: shake 0.4s; }

.consent-label { display: flex; gap: 10px; cursor: pointer; align-items: flex-start; }

.consent-checkbox {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--primary);
}

.consent-text { font-size: 11px; color: var(--text-light); line-height: 1.5; }
.consent-link { color: var(--primary); text-decoration: underline; }

.btn-primary {
  width: 100%;
  padding: 12px 18px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  box-shadow: var(--shadow-md);
}

.btn-primary:disabled { background: var(--border); cursor: not-allowed; }

.features-section { margin-top: 32px; }

.section-title {
  font-size: 18px;
  font-weight: 700;
  text-align: center;
  margin-bottom: 16px;
}

.features-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }

.feature-card {
  padding: 12px 8px;
  background: var(--bg-light);
  border-radius: var(--radius-md);
  text-align: center;
}

.feature-icon { font-size: 22px; margin-bottom: 6px; }
.feature-title { font-size: 12px; font-weight: 600; margin-bottom: 2px; }
.feature-text { font-size: 10px; color: var(--text-light); line-height: 1.3; }

.trust-section { display: grid; grid-template-columns: 1fr; gap: 10px; margin: 20px 0; }

.trust-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  background: var(--bg-light);
  border-radius: var(--radius-md);
}

.trust-card-white { background: var(--bg-white); border: 1px solid var(--border); }
.trust-card.success { background: linear-gradient(135deg, rgba(16, 185, 129, 0.08), rgba(16, 185, 129, 0.12)); }
.trust-icon { font-size: 22px; }
.trust-title { font-size: 13px; font-weight: 600; }
.trust-subtitle { font-size: 11px; color: var(--text-light); }

.example-section { margin-top: 24px; }
.example-header { text-align: center; margin-bottom: 12px; }

.example-badge {
  display: inline-block;
  padding: 6px 12px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(139, 92, 246, 0.15));
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 8px;
}

.example-title { font-size: 16px; font-weight: 700; }

.example-card {
  padding: 16px;
  border: 2px solid rgba(99, 102, 241, 0.2);
  border-radius: var(--radius-lg);
  position: relative;
}

.example-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
}

.example-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--primary);
  margin-bottom: 10px;
  font-weight: 600;
}

.example-text { font-size: 14px; line-height: 1.7; margin-bottom: 14px; }

.example-settings { display: flex; flex-wrap: nowrap; gap: 6px; margin-bottom: 12px; justify-content: center; }

.example-setting {
  padding: 3px 8px;
  background: rgba(99, 102, 241, 0.08);
  border-radius: var(--radius-full);
  font-size: 10px;
  color: var(--primary);
  font-weight: 500;
  white-space: nowrap;
}

.example-note {
  font-size: 11px;
  color: var(--text-light);
  text-align: center;
  padding: 8px 12px;
  background: var(--bg-light);
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  font-style: italic;
}

.example-footer {
  display: flex;
  justify-content: center;
  padding-top: 14px;
  border-top: 1px solid rgba(99, 102, 241, 0.1);
}

.example-cta-button {
  padding: 12px 28px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}

.reviews-section { margin-top: 24px; }
.reviews-header { font-size: 12px; color: var(--text-light); text-align: center; margin-bottom: 12px; }

.review-card {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 10px;
}

.review-header { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }

.review-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--bg-light);
}

.review-avatar img { width: 100%; height: 100%; object-fit: cover; }

.review-avatar-initials {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff;
  font-size: 15px;
  font-weight: 700;
}
.review-name { font-size: 13px; font-weight: 600; }
.review-location { font-size: 11px; color: var(--text-light); }
.review-rating { font-size: 11px; color: var(--warning); }
.review-quote { font-weight: 600; margin-bottom: 4px; }
.review-body { font-size: 13px; color: var(--text-medium); }

.faq-section { margin-top: 24px; }

.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 8px;
}

.faq-question {
  display: flex;
  justify-content: space-between;
  padding: 12px 14px;
  background: var(--bg-light);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
}

.faq-answer {
  display: none;
  padding: 12px 14px;
  font-size: 13px;
  color: var(--text-medium);
  border-top: 1px solid var(--border);
}

.faq-item.open .faq-answer { display: block; }
.faq-item.open .faq-icon { transform: rotate(180deg); }

.fixed-cta {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  padding: 12px 16px 24px;
  background: linear-gradient(to top, var(--bg-white) 80%, transparent);
  z-index: 90;
}

.fixed-cta.visible { display: block; }

.expandable-section {
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
}

.expand-button {
  width: 100%;
  display: flex;
  justify-content: space-between;
  padding: 12px 14px;
  background: var(--bg-light);
  border: none;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-medium);
  font-family: inherit;
}

.expand-icon.open { transform: rotate(180deg); }
.expandable-content { padding: 0 14px 14px; }

.resend-section { text-align: center; font-size: 13px; color: var(--text-light); margin-bottom: 16px; }
.resend-link { color: var(--primary); cursor: pointer; font-weight: 500; text-decoration: underline; }

.back-button {
  background: none;
  border: none;
  color: var(--primary);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  padding: 8px 16px;
}

.stats-box {
  background: var(--bg-light);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-top: 20px;
}

.stats-title { font-size: 13px; font-weight: 600; margin-bottom: 12px; text-align: center; }

.stat-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}

.stat-row:last-child { border-bottom: none; }
.stat-label { color: var(--text-medium); }
.stat-value { font-weight: 600; }

.legal-footer {
  margin-top: 24px;
  padding: 16px;
  background: var(--bg-light);
  border-radius: var(--radius-md);
  font-size: 9px;
  color: var(--text-light);
  line-height: 1.6;
}

.loading-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(255, 255, 255, 0.98);
  z-index: 1000;
  justify-content: center;
  align-items: center;
}

.loading-overlay.visible { display: flex; }
.loading-content { text-align: center; max-width: 320px; }

.loading-spinner {
  width: 80px;
  height: 80px;
  margin: 0 auto 20px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.spinner-ring {
  position: absolute;
  width: 100%;
  height: 100%;
  border: 4px solid var(--border);
  border-top-color: var(--primary);
  border-right-color: var(--secondary);
  border-radius: 50%;
  animation: spin 1.2s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.loading-icon { font-size: 32px; animation: pulse 1.5s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(1.1); opacity: 0.8; } }

.loading-title { font-size: 18px; font-weight: 700; margin-bottom: 8px; }
.loading-subtitle { font-size: 13px; color: var(--text-light); margin-bottom: 24px; }
.loading-steps { text-align: left; }

.loading-step {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  font-size: 14px;
  color: var(--text-light);
}

.loading-step.active { color: var(--primary); font-weight: 500; }
.loading-step.done { color: var(--success); }

.step-icon {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
}

.loading-step.active .step-icon { background: var(--primary); color: white; }
.loading-step.done .step-icon { background: var(--success); color: white; }

@media (min-width: 768px) {
  .app-container { max-width: 900px; margin: 0 auto; box-shadow: var(--shadow-xl); }
  .app-header { padding: 16px 24px; }
  .app-logo { width: 44px; height: 44px; font-size: 22px; }
  .app-title { font-size: 18px; }
  .page-content { padding: 20px 60px 60px; max-width: 720px; margin: 0 auto; }
  .hero { padding: 20px 0 32px; }
  .hero-title { font-size: 32px; }
  .hero-subtitle { font-size: 17px; max-width: 400px; }
  .choice-grid { flex-wrap: wrap; gap: 10px; }
  .choice-pill { padding: 12px 20px; font-size: 15px; }
  .btn-primary { padding: 16px 24px; font-size: 16px; max-width: 360px; margin: 32px auto; display: block; }
  .features-grid { grid-template-columns: repeat(3, 1fr); gap: 16px; }
  .feature-card { padding: 24px; }
  .feature-icon { font-size: 36px; margin-bottom: 8px; }
  .feature-title { font-size: 16px; }
  .feature-text { font-size: 13px; }
  .example-settings { gap: 10px; }
  .example-setting { padding: 4px 12px; font-size: 12px; }
  .fixed-cta { display: none !important; }
}
