/* Душа природы — натуральные масла холодного отжима */
:root {
  --green-forest: #2d4a2a;
  --green-sage: #4a6b47;
  --green-pale: #e5ede5;
  --green-soft: #7a9b76;
  --brown-wood: #5c4a3d;
  --brown-warm: #8b7355;
  --gold: #c9a227;
  --gold-light: #e8d9a8;
  --red-accent: #b53c3c;
  --red-hover: #9a3030;
  --cream: #f8f6f1;
  --cream-dark: #efece5;
  --text: #2c2c2a;
  --text-muted: #5a5a55;
  --bg-input: #fff;
  --success-overlay-bg: rgba(45, 74, 42, 0.85);
  --success-card-bg: #fff;
}

[data-theme="dark"] {
  --green-forest: #6fb36d;
  --green-sage: #7ab077;
  --green-pale: #151a15;
  --green-soft: #5a7d58;
  --brown-wood: #b5a898;
  --brown-warm: #7a6d5d;
  --cream: #242824;
  --cream-dark: #2e342e;
  --text: #e8e8e6;
  --text-muted: #9ca09a;
  --bg-input: #1c201c;
  --success-overlay-bg: rgba(0, 0, 0, 0.85);
  --success-card-bg: #1c201c;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--cream);
  background-image: radial-gradient(ellipse at 80% 20%, var(--green-pale) 0%, transparent 50%),
                    radial-gradient(ellipse at 20% 80%, rgba(232, 217, 168, 0.2) 0%, transparent 40%);
  min-height: 100vh;
  transition: background 0.3s ease, color 0.3s ease;
}

[data-theme="dark"] body {
  background: var(--cream);
  background-image: radial-gradient(ellipse at 80% 20%, var(--green-pale) 0%, transparent 50%),
                    radial-gradient(ellipse at 20% 80%, rgba(74, 107, 71, 0.08) 0%, transparent 40%);
}

.container {
  max-width: 640px;
  margin: 0 auto;
  padding: 32px 24px;
}

.brief-page { padding-top: 90px; padding-bottom: 24px; }

.brief-title {
  font-size: 1.75rem;
  font-weight: 700;
  margin: 0 0 10px;
  color: var(--green-forest);
  letter-spacing: -0.02em;
}

.brief-intro {
  color: var(--text-muted);
  margin: 0 0 36px;
  font-size: 0.95rem;
  line-height: 1.65;
}

.brief-section {
  margin-bottom: 24px;
  padding: 0 0 20px;
  border-bottom: 1px solid var(--cream-dark);
}

.brief-section:last-of-type { border-bottom: none; }

.brief-example-links {
  margin-top: 12px;
}

.brief-example-links .brief-field {
  margin-bottom: 14px;
}

.brief-example-links .brief-field:last-child {
  margin-bottom: 0;
}

.brief-section-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0 0 18px;
  padding-bottom: 10px;
  color: var(--green-sage);
  border-bottom: 2px solid var(--green-soft);
  display: inline-block;
}

.brief-required {
  color: var(--red-accent);
  font-weight: 700;
}

.brief-question {
  margin-bottom: 16px;
  padding: 14px 16px;
  background: var(--cream);
  border: 1px solid var(--cream-dark);
  border-radius: 8px;
}

[data-theme="dark"] .brief-question {
  background: var(--cream);
  border-color: var(--cream-dark);
}

.brief-question:last-child { margin-bottom: 0; }

.brief-question-text {
  font-weight: 500;
  margin: 0 0 10px;
  font-size: 0.95rem;
  color: var(--brown-wood);
}

.brief-question ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.brief-checkbox,
.brief-radio {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
  padding: 6px 0;
  cursor: pointer;
  font-size: 0.95rem;
  color: var(--text);
  border-bottom: 1px solid transparent;
  transition: background 0.15s;
}

.brief-checkbox:last-child,
.brief-radio:last-child { margin-bottom: 0; padding-bottom: 0; }

.brief-checkbox:not(:last-child),
.brief-radio:not(:last-child) {
  border-bottom: 1px solid var(--cream-dark);
}

.brief-checkbox:hover,
.brief-radio:hover {
  color: var(--green-forest);
}

.brief-checkbox input,
.brief-radio input {
  width: 18px;
  height: 18px;
  accent-color: var(--green-sage);
  cursor: pointer;
}

.brief-select-all {
  font-weight: 600;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--cream-dark);
}

.brief-sections-wrap .brief-checkbox:not(.brief-select-all) {
  margin-bottom: 6px;
}

.brief-field {
  margin-bottom: 20px;
  padding: 14px;
  background: var(--cream);
  border: 1px solid var(--cream-dark);
  border-radius: 8px;
}

[data-theme="dark"] .brief-field {
  background: var(--cream);
  border-color: var(--cream-dark);
}

.brief-field:last-of-type { margin-bottom: 0; }

.brief-field label {
  display: block;
  font-weight: 500;
  margin-bottom: 6px;
  font-size: 0.95rem;
  color: var(--brown-wood);
}

.brief-field input,
.brief-field textarea {
  width: 100%;
  padding: 10px 12px;
  font-size: 1rem;
  font-family: inherit;
  border: 1px solid var(--cream-dark);
  border-radius: 6px;
  background: var(--bg-input);
  color: var(--text);
}

[data-theme="dark"] .brief-field input,
[data-theme="dark"] .brief-field textarea {
  background: #1a1e1a;
  border-color: var(--cream-dark);
}

.brief-field input::placeholder,
.brief-field textarea::placeholder {
  color: var(--text-muted);
  opacity: 0.8;
}

.brief-field input:focus,
.brief-field textarea:focus {
  outline: none;
  border-color: var(--green-sage);
  box-shadow: 0 0 0 2px rgba(74, 107, 71, 0.2);
}

.brief-field textarea {
  resize: vertical;
  min-height: 88px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 32px;
  font-size: 1rem;
  font-weight: 600;
  font-family: inherit;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}

.btn-primary {
  background: var(--red-accent);
  color: #fff;
  border: 2px solid var(--red-accent);
}

.btn-primary:hover {
  background: var(--red-hover);
  border-color: var(--red-hover);
}

.btn-primary:active { transform: scale(0.98); }

.btn-primary:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

/* Прогресс заполнения — закреплён сверху */
.brief-progress-wrap {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 12px 24px 14px;
  background: var(--cream);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  transition: background 0.3s ease;
}

[data-theme="dark"] .brief-progress-wrap {
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
}

.brief-progress-inner {
  max-width: 640px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brief-progress-content {
  flex: 1;
  min-width: 0;
}

.brief-header-btns {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.brief-theme-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 36px;
  padding: 0;
  font-size: 1.1rem;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid var(--cream-dark);
  border-radius: 8px;
  cursor: pointer;
  transition: color 0.2s, background 0.2s, border-color 0.2s;
}

.brief-theme-btn:hover {
  color: var(--green-sage);
  background: var(--cream-dark);
}

.brief-theme-icon-moon { display: none; }
.brief-theme-icon-sun { display: inline; }
[data-theme="dark"] .brief-theme-icon-sun { display: none; }
[data-theme="dark"] .brief-theme-icon-moon { display: inline; }

.brief-support-btn {
  flex-shrink: 0;
  padding: 8px 16px;
  font-size: 0.9rem;
  font-weight: 600;
  font-family: inherit;
  color: var(--green-sage);
  background: transparent;
  border: 2px solid var(--green-sage);
  border-radius: 8px;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.brief-support-btn:hover {
  background: var(--green-sage);
  color: #fff;
}

.brief-progress-label {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.brief-progress-bar {
  height: 8px;
  background: var(--cream-dark);
  border-radius: 4px;
  overflow: hidden;
}

.brief-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #e67e22 0%, #4a6b47 100%);
  border-radius: 4px;
  transition: width 0.4s ease, background 0.4s ease;
}

.brief-progress-fill[data-progress="0"] {
  background: #e67e22;
}

.brief-progress-fill[data-progress="100"] {
  background: linear-gradient(90deg, var(--green-sage), var(--green-soft));
}

/* Кнопка отправки и статус */
.brief-submit-wrap {
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.btn-primary {
  position: relative;
  overflow: hidden;
}

.btn-primary .btn-loading {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-primary.is-loading .btn-text { display: none; }
.btn-primary.is-loading .btn-loading { display: inline-flex; }

.btn-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: brief-spin 0.8s linear infinite;
}

@keyframes brief-spin {
  to { transform: rotate(360deg); }
}

.brief-status {
  margin-top: 18px;
  font-size: 0.95rem;
  color: var(--text-muted);
}

.brief-status.success { color: var(--green-sage); }
.brief-status.error { color: var(--red-accent); }

/* Оверлей успешной отправки */
.brief-success-overlay {
  position: fixed;
  inset: 0;
  background: var(--success-overlay-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

.brief-success-overlay.is-visible {
  opacity: 1;
  visibility: visible;
}

.brief-success-card {
  background: var(--success-card-bg);
  padding: 40px 36px;
  border-radius: 16px;
  text-align: center;
  max-width: 320px;
  transform: scale(0.8) translateY(20px);
  opacity: 0;
  transition: transform 0.4s ease, opacity 0.4s ease;
  box-shadow: 0 24px 48px rgba(0,0,0,0.15);
}

.brief-success-overlay.is-visible .brief-success-card {
  transform: scale(1) translateY(0);
  opacity: 1;
}

.brief-success-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 20px;
  color: var(--green-sage);
  animation: brief-check-pop 0.5s ease 0.2s both;
}

.brief-success-icon svg {
  width: 100%;
  height: 100%;
}

@keyframes brief-check-pop {
  0% { transform: scale(0); opacity: 0; }
  50% { transform: scale(1.15); }
  100% { transform: scale(1); opacity: 1; }
}

.brief-success-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--green-forest);
  margin: 0 0 10px;
}

.brief-success-text {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin: 0 0 24px;
}

.brief-success-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 28px;
  font-size: 1rem;
  font-weight: 600;
  font-family: inherit;
  color: #fff;
  background: var(--green-sage);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}

.brief-success-btn:hover {
  background: var(--green-forest);
}

.brief-success-btn:active {
  transform: scale(0.98);
}

[data-theme="dark"] .brief-section {
  border-bottom-color: var(--cream-dark);
}

[data-theme="dark"] .brief-select-all {
  border-bottom-color: var(--cream-dark);
}

[data-theme="dark"] .brief-checkbox:not(:last-child),
[data-theme="dark"] .brief-radio:not(:last-child) {
  border-bottom-color: var(--cream-dark);
}
