:host {
  display: block;
  width: 100%;
  contain: content;
}

.stepper-container {
  display: flex;
  width: 100%;
}

.stepper-container.horizontal {
  flex-direction: column;
}

.stepper-container.vertical {
  flex-direction: column;
  width: 100%;
  overflow: visible;
}

.step-headers {
  position: relative;
  display: flex;
  flex-direction: row;
  width: 100%;
  margin-bottom: 1rem;
  align-items: flex-start;
}

.step-header {
  position: relative;
  flex: 1;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 0.5rem;
  transition: padding 0.3s, background-color 0.3s;
  cursor: pointer;
}

.step-header:not(.label-bottom):not(.label-right) {
  flex-direction: row;
  align-items: center;
}

.step-header.label-bottom {
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  text-align: center;
  position: relative;
  padding-top: 8px;
}

.step-header.label-bottom .step-icon {
  margin-right: 0;
}

.step-header.label-right {
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  position: relative;
  padding-right: 16px;
}

.step-header:hover:not(.disabled) {
  background-color: rgba(25, 118, 210, 0.1);
}

.step-header.disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.step-header.active {
  flex: 1;
}

.step-header.active.active-only {
  flex: 2;
}

.step-header.icons-only {
  justify-content: center;
  flex-direction: column;
  gap: 0.5rem;
}

.step-content-container {
  width: 100%;
  position: relative;
  min-height: 150px;
  display: flex;
  flex-direction: column;
}

.step-content-wrapper {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
  visibility: visible;
  opacity: 1;
  transition: opacity 0.2s ease-in-out, visibility 0.2s ease-in-out;
}

.step-content-wrapper[style*="display: none"] {
  visibility: hidden;
  opacity: 0;
  position: absolute;
  pointer-events: none;
}

.step-content-wrapper[style*="display: none"] {
  overflow: hidden;
}

.step-buttons {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
  padding: 1rem;
  width: 100%;
  box-sizing: border-box;
  will-change: transform;
}

.step {
  display: flex;
  position: relative;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  background-color: #fff;
}

.step.horizontal {
  flex: 1;
  min-width: 0;
  padding: 1rem;
}

.step.horizontal.active {
  flex: 2;
}

.step.alternative-label {
  flex-direction: column;
  align-items: center;
}

.step.clickable {
  cursor: pointer;
}

.step-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  margin-right: 8px;
  border: 2px solid var(--divider-color, #ccc);
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}

.step-icon.completed {
  background-color: var(--success-color, #4caf50);
  border-color: var(--success-color, #4caf50);
}

.step-icon.completed unity-typography {
  color: var(--text-inverse, #ffffff);
}

.step-icon.active {
  background-color: transparent;
  border-color: var(--primary-color, #1976d2);
}

.step-icon.active unity-typography {
  color: var(--primary-color, #1976d2);
}

.step-icon:not(.active):not(.completed) unity-typography {
  color: var(--text-secondary, rgba(0, 0, 0, 0.6));
}

.step-content {
  flex: 1;
}

.step-title {
  font-weight: bold;
  margin-bottom: 4px;
}

.step-subtitle {
  font-size: 0.875rem;
  color: #666;
}

.step-content-display {
  padding: 1rem;
  width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

.step-labels {
  display: flex;
  flex-direction: column;
}

.label-bottom .step-labels {
  text-align: center;
}

.label-right .step-labels {
  margin-left: 8px;
}

.step-header {
  position: relative;
}

.step-header:not(:last-child)::after {
  content: '';
  position: absolute;
  background-color: var(--divider-color, #e0e0e0);
  height: 1px;
}

.step-icon {
  position: relative;
  z-index: 1;
}

.step.vertical {
  display: flex;
  flex-direction: column;
  width: 100%;
  border: 1px solid var(--divider-color, #e0e0e0);
  border-radius: 4px;
  background-color: #fff;
  margin-bottom: 1rem;
  overflow: visible; 
  box-sizing: border-box; 
}

.step-content-vertical {
  width: 100%;
  box-sizing: border-box;
  overflow: visible;
}

.step-header-container {
  display: flex;
}

.step.vertical .step-header {
  width: 100%;
  padding: 1rem;
}

.step.vertical .step-header.label-right {
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
}

.step.vertical .step-labels {
  margin-left: 8px;
}

.step.vertical .step-content-wrapper {
  margin: 0;
  padding: 0;
  border: none;
}