.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(circle at top, rgba(232, 168, 124, 0.12), transparent 32%),
    radial-gradient(circle at bottom right, rgba(245, 240, 232, 0.08), transparent 28%),
    rgba(10, 8, 15, 0.78);
  backdrop-filter: blur(12px);
}

.modal {
  width: min(900px, 100%);
  max-height: min(92vh, 980px);
  overflow-y: auto;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 28px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent 18%),
    linear-gradient(145deg, rgba(28, 25, 42, 0.96), rgba(22, 19, 34, 0.97));
  box-shadow:
    0 32px 90px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.modal-hero,
.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding: 28px 30px 0;
}

.modal-hero h2,
.modal-header h2 {
  font-size: clamp(1.8rem, 3vw, 2.35rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
  color: var(--text);
}

.modal-hero-copy {
  max-width: 560px;
  margin-top: 12px;
  color: rgba(245, 240, 232, 0.7);
  font-size: 1rem;
  line-height: 1.6;
}

.modal-eyebrow {
  display: inline-flex;
  align-items: center;
  margin-bottom: 14px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(232, 168, 124, 0.14);
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.modal-close,
.modal-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-muted);
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.modal-close:hover:not(:disabled),
.modal-back:hover:not(:disabled) {
  transform: translateY(-1px);
  color: var(--text);
  border-color: rgba(232, 168, 124, 0.34);
  background: rgba(232, 168, 124, 0.08);
}

.modal-close:disabled,
.modal-back:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.modal-header-left {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.modal-type-select,
.modal-form {
  padding: 28px 30px 30px;
}

.modal-type-select {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.modal-section {
  padding: 22px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent 100%),
    rgba(28, 25, 42, 0.58);
  backdrop-filter: blur(16px) saturate(160%);
}

.modal-section-header {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 18px;
}

.modal-section-header h3,
.settings-card-header h3 {
  font-size: 1.08rem;
  color: var(--text);
}

.modal-section-header p,
.settings-card-header p {
  margin-top: 4px;
  color: var(--text-muted);
  line-height: 1.5;
}

.modal-section-step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(232, 168, 124, 0.22), rgba(245, 240, 232, 0.14));
  color: var(--text);
  font-weight: 700;
}

.modal-type-cards,
.mode-cards,
.modal-form-grid {
  display: grid;
  gap: 16px;
}

.modal-type-cards,
.mode-cards {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.type-card,
.mode-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  padding: 20px 20px 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent 100%),
    rgba(36, 33, 56, 0.68);
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.type-card:hover,
.mode-card:hover {
  transform: translateY(-2px);
  border-color: rgba(232, 168, 124, 0.36);
  box-shadow: 0 18px 32px rgba(2, 8, 23, 0.25);
}

.type-card--selected,
.mode-card--active {
  border-color: rgba(232, 168, 124, 0.55);
  background:
    linear-gradient(180deg, rgba(232, 168, 124, 0.12), rgba(245, 240, 232, 0.04)),
    rgba(28, 25, 42, 0.92);
  box-shadow: inset 0 0 0 1px rgba(232, 168, 124, 0.16);
}

.type-card-icon {
  display: inline-block;
  font-size: 1.55rem;
  line-height: 1;
  margin: 0 2px 0 0;
  transform: translateY(1px);
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.18));
}

.type-card-label,
.mode-card-label {
  color: var(--text);
  font-size: 1.04rem;
  font-weight: 700;
}

.type-card-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.type-card-desc,
.mode-card-desc {
  color: rgba(245, 240, 232, 0.66);
  line-height: 1.55;
  font-size: 0.92rem;
}

.mode-card-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(232, 168, 124, 0.14);
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.modal-type-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.modal-selection-summary,
.modal-summary-strip {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.summary-pill {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 600;
}

.summary-pill--accent {
  background: rgba(232, 168, 124, 0.12);
  border-color: rgba(232, 168, 124, 0.22);
  color: var(--accent);
}

.summary-caption {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.modal-continue {
  padding-inline: 22px;
}

.modal-form {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.modal-form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group--full {
  grid-column: 1 / -1;
}

.form-group label {
  color: var(--text);
  font-size: 0.92rem;
  font-weight: 600;
}

.form-help {
  color: var(--text-dim);
  font-size: 0.8rem;
  line-height: 1.5;
}

.form-input,
.form-textarea {
  width: 100%;
  padding: 13px 14px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 16px;
  background: rgba(18, 16, 26, 0.85);
  color: var(--text);
  font: inherit;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--text-dim);
}

.form-input:focus,
.form-textarea:focus {
  border-color: rgba(232, 168, 124, 0.52);
  box-shadow: 0 0 0 4px rgba(232, 168, 124, 0.12);
  background: rgba(18, 16, 26, 0.94);
}

.form-input[type='range'] {
  padding: 0;
  border: none;
  background: rgba(255, 255, 255, 0.1);
  box-shadow: none;
  cursor: pointer;
}

.form-textarea {
  resize: vertical;
  min-height: 120px;
}

.form-textarea--hero {
  min-height: 138px;
}

.settings-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 22px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 24px;
  background:
    radial-gradient(circle at top right, rgba(232, 168, 124, 0.08), transparent 28%),
    rgba(28, 25, 42, 0.58);
}

.slider-card {
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(18, 16, 26, 0.72);
}

.slider-card--compact {
  padding: 14px 16px;
}

.slider-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 12px;
}

.slider-label {
  display: block;
  color: var(--text);
  font-weight: 600;
}

.slider-copy {
  display: block;
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 0.82rem;
  line-height: 1.5;
}

.slider-value {
  min-width: 48px;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(232, 168, 124, 0.12);
  color: var(--accent);
  font-weight: 700;
  text-align: center;
}

.toggle-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.toggle-card {
  padding: 15px 16px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(28, 25, 42, 0.6);
}

.toggle-card--disabled {
  opacity: 0.55;
}

.toggle-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.toggle-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.toggle-title {
  color: var(--text);
  font-weight: 600;
}

.toggle-desc {
  color: var(--text-muted);
  font-size: 0.84rem;
  line-height: 1.5;
}

.toggle-switch {
  position: relative;
  flex-shrink: 0;
  width: 52px;
  height: 30px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.toggle-switch.on {
  background: rgba(232, 168, 124, 0.3);
  border-color: rgba(232, 168, 124, 0.4);
}

.toggle-switch-disabled {
  cursor: not-allowed;
}

.toggle-knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--text-muted);
  transition: transform 0.2s ease;
}

.toggle-switch.on .toggle-knob {
  transform: translateX(22px);
  background: var(--accent);
  box-shadow: 0 0 8px rgba(232, 168, 124, 0.4);
}

.expansive-options {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px;
  border-radius: 18px;
  border: 1px solid rgba(232, 168, 124, 0.14);
  background: rgba(232, 168, 124, 0.08);
}

.segmented-control {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.segmented-control-btn {
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(18, 16, 26, 0.66);
  color: var(--text-muted);
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.segmented-control-btn--active {
  background: rgba(232, 168, 124, 0.12);
  border-color: rgba(232, 168, 124, 0.34);
  color: var(--accent);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding-top: 2px;
}

@media (max-width: 860px) {
  .modal {
    width: 100%;
    border-radius: 24px;
  }

  .modal-hero,
  .modal-header,
  .modal-type-select,
  .modal-form {
    padding-inline: 22px;
  }
}

@media (max-width: 720px) {
  .modal-backdrop {
    padding: 12px;
  }

  .modal-hero,
  .modal-header {
    flex-direction: column;
  }

  .modal-close {
    align-self: flex-end;
  }

  .modal-type-cards,
  .mode-cards,
  .modal-form-grid {
    grid-template-columns: 1fr;
  }

  .modal-type-footer,
  .modal-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .toggle-label,
  .slider-card-header {
    align-items: flex-start;
  }
}
