:root {
  --bg: #F2F7F2;
  --card: #ffffff;
  --muted: #64748b;
  --text: #1e293b;
  --text-light: #475569;
  --primary: #3F7A46;
  --primary-hover: #2d5a32;
  --primary-light: #e8f5ea;
  --border: #e2e8f0;
  --border-light: #f1f5f9;
  --ok: #10b981;
  --shadow: rgba(0, 0, 0, 0.08);
  --shadow-lg: rgba(0, 0, 0, 0.12);
}

* { box-sizing: border-box; }
html, body { 
  height: 100%;
  max-height: 900px;
  overflow: hidden;
}
body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  background: #F2F7F2;
  color: var(--text);
  line-height: 1.6;
  overflow: hidden;
}

.container {
  min-height: 100%;
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  max-height: 900px;
  overflow: hidden;
  position: relative;
}

.card {
  width: 100%;
  max-width: 600px;
  background: var(--card);
  border-radius: 24px;
  padding: 40px 32px;
  box-shadow: 0 4px 20px var(--shadow), 0 1px 3px var(--shadow);
  position: relative;
  max-height: calc(900px - 48px);
  overflow-y: auto;
  overflow-x: hidden;
}

/* Progress Indicator */
.progress-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 48px;
  gap: 8px;
}

.progress-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--border);
  transition: all 0.3s ease;
}

.progress-dot.active {
  background: var(--primary);
  width: 16px;
  height: 16px;
  box-shadow: 0 0 0 4px var(--primary-light);
}

.progress-dot.completed {
  background: var(--ok);
}

.progress-line {
  flex: 1;
  height: 2px;
  background: var(--border);
  max-width: 60px;
  transition: background 0.3s ease;
}

.progress-line.completed {
  background: var(--ok);
}

/* Steps */
.step {
  display: none;
  animation: fadeIn 0.3s ease;
}

.step.active {
  display: block;
}

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

.step-content {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.step-title {
  margin: 0;
  font-size: 32px;
  font-weight: 700;
  color: var(--text);
  text-align: center;
}

.step-desc {
  margin: 0;
  color: var(--muted);
  text-align: center;
  font-size: 16px;
}

/* Options */
.options {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.option {
  border: 2px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--card);
  cursor: pointer;
  transition: all 0.2s ease;
}

.option:hover {
  border-color: var(--primary);
  background: var(--primary-light);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px var(--shadow);
}

.option input[type="radio"] {
  width: 20px;
  height: 20px;
  accent-color: var(--primary);
  cursor: pointer;
  flex-shrink: 0;
}

.option input[type="radio"]:checked + .option-content .option-title {
  color: var(--primary);
  font-weight: 600;
}

.option:has(input:checked) {
  border-color: var(--primary);
  background: var(--primary-light);
}

.option-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.option-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}

.option-subtitle {
  font-size: 14px;
  color: var(--muted);
}

/* Slider */
.slider-container {
  padding: 20px 0;
}

.slider-note {
  margin-top: 16px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
  font-style: italic;
}

.slider-row {
  display: flex;
  align-items: center;
  gap: 16px;
}

input[type="range"] {
  flex: 1;
  height: 8px;
  border-radius: 4px;
  background: var(--border);
  outline: none;
  -webkit-appearance: none;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
  box-shadow: 0 2px 8px var(--shadow);
  transition: all 0.2s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 12px var(--shadow-lg);
}

input[type="range"]::-moz-range-thumb {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
  border: none;
  box-shadow: 0 2px 8px var(--shadow);
}

.slider-value {
  display: flex;
  align-items: baseline;
  gap: 4px;
  min-width: 80px;
}

output {
  font-size: 32px;
  font-weight: 700;
  color: var(--primary);
  line-height: 1;
}

.slider-value span {
  font-size: 18px;
  color: var(--muted);
  font-weight: 500;
}

/* Input */
.input-container {
  margin: 8px 0;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="date"],
textarea {
  width: 100%;
  padding: 14px 18px;
  border-radius: 12px;
  border: 2px solid var(--border);
  background: var(--card);
  color: var(--text);
  font-size: 16px;
  font-family: inherit;
  transition: all 0.2s ease;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
input[type="date"]:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-light);
}

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

.help {
  color: var(--muted);
  margin: 8px 0 0;
  font-size: 14px;
  text-align: center;
}

/* Buttons */
.step-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
}

.btn {
  padding: 14px 28px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 16px;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
  flex: 1;
}

.btn-primary {
  background: var(--primary);
  color: white;
  box-shadow: 0 2px 8px var(--shadow);
}

.btn-primary:hover:not(:disabled) {
  background: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px var(--shadow-lg);
}

.btn-primary:active:not(:disabled) {
  transform: translateY(0);
}

.btn-secondary {
  background: transparent;
  color: var(--text);
  border: 2px solid var(--border);
}

.btn-secondary:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

/* Result */
.result {
  background: var(--primary-light);
  border-radius: 16px;
  padding: 32px;
  border: 2px solid var(--border-light);
}

.result h3 {
  margin: 0 0 24px;
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
  text-align: center;
}

.lines {
  display: grid;
  gap: 16px;
}

.line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.line:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.line .label {
  color: var(--muted);
  font-size: 16px;
  flex: 1;
}

.line .value {
  font-weight: 600;
  font-size: 16px;
  color: var(--text);
  text-align: right;
}

.line.total {
  padding-top: 20px;
  margin-top: 8px;
  border-top: 2px solid var(--primary);
  border-bottom: none;
}

.line.total .label {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
}

.line.total .value {
  font-size: 28px;
  font-weight: 700;
  color: var(--primary);
}

.note {
  margin-top: 24px;
  color: var(--muted);
  font-size: 14px;
  text-align: center;
  line-height: 1.6;
}

/* Modal */
.modal {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.2s ease;
  max-height: 900px;
}

.modal.hidden {
  display: none;
}

.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
}

.modal-content {
  position: relative;
  background: var(--card);
  border-radius: 24px;
  padding: 30px;
  max-width: 500px;
  width: 100%;
  max-height: calc(900px - 80px);
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  z-index: 1;
  animation: slideUp 0.3s ease;
  display: flex;
  flex-direction: column;
}

.message-modal-content {
  text-align: center;
  padding: 48px 40px;
}

.message-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  font-weight: 700;
  margin: 0 auto 24px;
}

.message-icon.message-success {
  background: #d1fae5;
  color: #10b981;
}

.message-icon.message-error {
  background: #fee2e2;
  color: #ef4444;
}

.message-title {
  margin: 0 0 12px;
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
}

.message-text {
  margin: 0 0 32px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.6;
}

.message-actions {
  display: flex;
  justify-content: center;
}

.message-actions .btn {
  min-width: 120px;
}

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

.modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: var(--border-light);
  color: var(--text);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.modal-close:hover {
  background: var(--border);
  transform: rotate(90deg);
}

.modal-title {
  margin: 0 0 6px;
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
  flex-shrink: 0;
}

.modal-desc {
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 14px;
  flex-shrink: 0;
}

/* Form */
#offerForm {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  flex: 1;
  min-height: 0;
}

.form-group {
  margin-bottom: 16px;
  flex-shrink: 0;
}

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

.form-actions {
  display: flex;
  gap: 12px;
  margin-top: auto;
  padding-top: 16px;
  flex-shrink: 0;
}

.form-actions .btn {
  flex: 1;
}

/* Footer */
.footer {
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}

.hidden {
  display: none !important;
}

/* Responsive */
@media (max-width: 640px) {
  .card {
    padding: 32px 24px;
  }

  .step-title {
    font-size: 28px;
  }

  .step-actions {
    flex-direction: column;
  }

  .step-actions .btn {
    width: 100%;
  }

  .modal-content {
    padding: 32px 24px;
  }
}
