:root {
  --viewport-width: min(100vw, 1600px);
  --b: calc(var(--viewport-width) / 160);
}

.progress {
  display: grid;
  -webkit-box-align: center;
      -ms-flex-align: center;
          align-items: center;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  gap: max(1rem, 5px);
  margin-bottom: max(2rem, 20px);
}
.progress__arrow {
  position: relative;
  width: 32px;
  height: 16px;
  background: #e0e0e0;
  -webkit-clip-path: polygon(0 0, 70% 0, 100% 50%, 70% 100%, 0 100%, 30% 50%);
          clip-path: polygon(0 0, 70% 0, 100% 50%, 70% 100%, 0 100%, 30% 50%);
  -webkit-transition: all 0.3s ease;
  transition: all 0.3s ease;
}
.progress__arrow.active {
  background: #00bcd4;
}
.progress__box {
  text-align: center;
}
.progress__box__number {
  display: block;
  width: 100%;
  padding: max(2rem, 15px) 0;
  border-radius: max(1rem, 5px);
  background: #e0e0e0;
  -webkit-transition: all 0.3s ease;
  transition: all 0.3s ease;
  color: #999;
  font-size: max(2rem, 14px);
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0;
}
.progress__box__number.active {
  background: #00bcd4;
  color: #fff;
}

.step {
  display: none;
}
.step.active {
  display: block;
  -webkit-animation: fadeIn 0.4s ease-out;
          animation: fadeIn 0.4s ease-out;
}
.step__wrapper {
  padding: max(3.5rem, 25px) 7.5%;
  -webkit-box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
          box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  border-radius: max(1rem, 5px);
  background: rgba(255, 255, 255, 0.6);
  -webkit-animation: fadeInUp 0.6s ease-out;
          animation: fadeInUp 0.6s ease-out;
}
.step__title {
  padding: max(2rem, 15px) 0;
  margin-bottom: max(4rem, 20px);
  text-align: center;
  background: linear-gradient(135deg, #FFD1DC 0%, #FFB6D9 35%, #D896FF 70%, #B8A8FF 100%);
  border-radius: max(1rem, 5px);
  color: #fff;
  font-size: max(3rem, 18px);
  font-weight: 700;
  line-height: 1.5;
  letter-spacing: 0.1em;
}
.step__preview {
  text-align: center;
  margin-bottom: max(2rem, 20px);
}
.step__preview img {
  width: 90%;
  max-width: 350px;
  height: auto;
}
.step__preview__placeholder {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-pack: center;
      -ms-flex-pack: center;
          justify-content: center;
  -webkit-box-align: center;
      -ms-flex-align: center;
          align-items: center;
  margin: 0 auto;
}
.step__description {
  margin-bottom: max(2rem, 20px);
  padding: max(2rem, 5%);
  background: #f8f9fa;
  border-radius: 12px;
}
.step__description p {
  font-size: max(1.5rem, 14px);
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: 0.05em;
  color: #666666;
}
.step__terms {
  padding: max(2rem, 5%);
  margin-bottom: max(2rem, 20px);
  background: #fff3f8;
  border: 2px solid #ffe4f0;
  border-radius: 12px;
}
.step__terms__title {
  color: #00bcd4;
  font-size: max(1.8rem, 16px);
  font-weight: 700;
  line-height: 1.5;
  letter-spacing: 0.05em;
  margin-bottom: max(1rem, 10px);
  text-align: center;
}
.step__terms__text {
  color: #666666;
  font-size: max(1.5rem, 14px);
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: 0.05em;
}
.step__agree {
  text-align: center;
  margin-bottom: max(2rem, 20px);
}
.step__agree__label {
  display: -webkit-inline-box;
  display: -ms-inline-flexbox;
  display: inline-flex;
  -webkit-box-align: center;
      -ms-flex-align: center;
          align-items: center;
  cursor: pointer;
  -webkit-user-select: none;
     -moz-user-select: none;
      -ms-user-select: none;
          user-select: none;
  position: relative;
  padding-left: 35px;
}
.step__agree__label:hover .step__agree__label__text::before {
  border-color: #D896FF;
  -webkit-transform: translateY(-50%) scale(1.05);
          transform: translateY(-50%) scale(1.05);
}
.step__agree__label__input {
  position: absolute;
  opacity: 0;
  cursor: pointer;
  height: 0;
  width: 0;
}
.step__agree__label__input:checked + .step__agree__label__text::before {
  background: linear-gradient(135deg, #FFD1DC 0%, #FFB6D9 35%, #D896FF 70%, #B8A8FF 100%);
  border-color: #D896FF;
}
.step__agree__label__input:checked + .step__agree__label__text::after {
  opacity: 1;
  -webkit-transform: translateY(-50%) scale(1) rotate(45deg);
          transform: translateY(-50%) scale(1) rotate(45deg);
}
.step__agree__label__input:focus + .step__agree__label__text::before {
  -webkit-box-shadow: 0 0 0 3px rgba(216, 150, 255, 0.2);
          box-shadow: 0 0 0 3px rgba(216, 150, 255, 0.2);
}
.step__agree__label__text {
  position: relative;
  color: #666666;
  font-size: max(1.5rem, 14px);
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: 0.05em;
}
.step__agree__label__text::before {
  content: "";
  position: absolute;
  left: -35px;
  top: 50%;
  -webkit-transform: translateY(-50%);
          transform: translateY(-50%);
  width: 24px;
  height: 24px;
  border: 2.5px solid #FFB6D9;
  border-radius: 6px;
  background: #fff;
  -webkit-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.step__agree__label__text::after {
  content: "";
  position: absolute;
  left: -26px;
  top: 50%;
  -webkit-transform: translateY(-50%) scale(0) rotate(45deg);
          transform: translateY(-50%) scale(0) rotate(45deg);
  width: 6px;
  height: 12px;
  border: solid #fff;
  border-width: 0 2.5px 2.5px 0;
  opacity: 0;
  -webkit-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.step__button {
  display: -webkit-inline-box;
  display: -ms-inline-flexbox;
  display: inline-flex;
  -webkit-box-align: center;
      -ms-flex-align: center;
          align-items: center;
  -webkit-box-pack: center;
      -ms-flex-pack: center;
          justify-content: center;
  width: 100%;
  gap: max(1rem, 10px);
  padding: max(2rem, 15px) 5%;
  border-radius: max(1rem, 5px);
  -webkit-transition: all 0.3s ease;
  transition: all 0.3s ease;
  font-size: max(1.7rem, 16px);
  font-weight: 700;
  line-height: 1.5;
  letter-spacing: 0.05em;
}
.step__button__icon {
  -ms-flex-negative: 0;
      flex-shrink: 0;
}
.step__button__icon path {
  color: #fff;
}
.step__button--primary {
  color: #fff;
  background: linear-gradient(135deg, #00bcd4, #0097a7);
  -webkit-box-shadow: 0 4px 12px rgba(0, 188, 212, 0.3);
          box-shadow: 0 4px 12px rgba(0, 188, 212, 0.3);
}
.step__button--primary:hover:not(:disabled) {
  -webkit-transform: translateY(-2px);
          transform: translateY(-2px);
  -webkit-box-shadow: 0 6px 16px rgba(0, 188, 212, 0.4);
          box-shadow: 0 6px 16px rgba(0, 188, 212, 0.4);
}
.step__button--primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.step__button--secondary {
  color: #ffffff;
  background: #6c757d;
}
.step__button--secondary:hover {
  background: #5a6268;
  -webkit-transform: translateY(-2px);
          transform: translateY(-2px);
}
.step__button--success {
  color: #fff;
  background: #4caf50;
  -webkit-box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
          box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}
.step__button--success:hover {
  background: #45a049;
  -webkit-transform: translateY(-2px);
          transform: translateY(-2px);
  -webkit-box-shadow: 0 6px 16px rgba(76, 175, 80, 0.4);
          box-shadow: 0 6px 16px rgba(76, 175, 80, 0.4);
}
.step__btnBox {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  gap: 12px;
  margin-top: 25px;
}
@media screen and (max-width: 768px) {
  .step__btnBox {
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
        -ms-flex-direction: column;
            flex-direction: column;
  }
}
.step__btnBox .step__button {
  -webkit-box-flex: 1;
      -ms-flex: 1;
          flex: 1;
}

.editor__container {
  margin-bottom: 25px;
}

.step__editor {
  margin-bottom: 30px;
}
.step__editor__canvas {
  position: relative;
  width: 100%;
  padding-top: 100%;
  background: #f8f9fa;
  border-radius: 16px;
  overflow: hidden;
  -ms-touch-action: none;
      touch-action: none;
}
.step__editor__canvas__overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.7);
  z-index: 2;
}
.step__editor__canvas__userImage {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  -o-object-fit: contain;
     object-fit: contain;
  cursor: move;
  z-index: 1;
  -webkit-transition: none;
  transition: none;
  -webkit-user-select: none;
     -moz-user-select: none;
      -ms-user-select: none;
          user-select: none;
  -webkit-user-drag: none;
}
.step__editor__canvas__frameImage {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  -o-object-fit: contain;
     object-fit: contain;
  pointer-events: none;
  z-index: 3;
}

.controls {
  margin-bottom: 20px;
}

.control__group {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
      -ms-flex-align: center;
          align-items: center;
  -webkit-column-gap: max(1rem, 15px);
     -moz-column-gap: max(1rem, 15px);
          column-gap: max(1rem, 15px);
  padding: max(2rem, 15px);
  background: #f8f9fa;
  border-radius: max(1rem, 5px);
}
@media screen and (max-width: 768px) {
  .control__group {
    -ms-flex-wrap: wrap;
        flex-wrap: wrap;
  }
}
.control__label {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
      -ms-flex-align: center;
          align-items: center;
  -webkit-column-gap: max(1rem, 0px);
     -moz-column-gap: max(1rem, 0px);
          column-gap: max(1rem, 0px);
  font-size: max(1.5rem, 14px);
  font-weight: 600;
  color: #333333;
  white-space: nowrap;
}
.control__value__box {
  -webkit-box-flex: 1;
      -ms-flex: 1;
          flex: 1;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
      -ms-flex-align: center;
          align-items: center;
  -webkit-column-gap: max(1rem, 10px);
     -moz-column-gap: max(1rem, 10px);
          column-gap: max(1rem, 10px);
}
.control__value {
  color: #00bcd4;
  font-size: max(1.5rem, 14px);
  font-weight: 700;
  line-height: 1.5;
  letter-spacing: 0.05em;
  text-align: right;
}

.slider {
  -webkit-box-flex: 1;
      -ms-flex: 1;
          flex: 1;
  height: 6px;
  border-radius: 3px;
  background: #e0e0e0;
  outline: none;
  -webkit-appearance: none;
}
.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #00bcd4;
  cursor: pointer;
}
.slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #00bcd4;
  cursor: pointer;
  border: none;
}

.step__saveHint {
  text-align: center;
  padding: max(2rem, 15px);
  margin-bottom: 20px;
  background: #f0f8ff;
  border: 1px solid #d0e8ff;
  border-radius: 12px;
}
.step__saveHint__text {
  color: #666666;
  font-size: max(1.5rem, 14px);
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: 0.05em;
  margin: 0;
}

.loading {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  z-index: 9999;
  -webkit-box-pack: center;
      -ms-flex-pack: center;
          justify-content: center;
  -webkit-box-align: center;
      -ms-flex-align: center;
          align-items: center;
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
      -ms-flex-direction: column;
          flex-direction: column;
}
.loading.active {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
}
.loading__spinner {
  width: 50px;
  height: 50px;
  border: 5px solid rgba(255, 255, 255, 0.3);
  border-top-color: #ffffff;
  border-radius: 50%;
  -webkit-animation: spin 1s linear infinite;
          animation: spin 1s linear infinite;
}
.loading p {
  color: #ffffff;
  margin-top: 20px;
  font-size: 16px;
}