.arrow {
  width: 20px;
  height: 20px;
  mask-repeat: no-repeat;
  mask-position: center;
  mask-size: contain;
  mask-image: url('/src/icon/arrow.svg');
  -webkit-mask-image: url('/src/icon/arrow.svg');
  background-color: var(--text-main);
  transition: all 0.3s ease;
}

/* button */

.button {
  display: block;
  -webkit-user-select: none;
  user-select: none;
  position: relative;
  width: max-content;
  padding: 10px 20px;
  font-size: 16px;
  font-weight: 500;
  line-height: 24px;
  letter-spacing: 0.005em;
  color: var(--text-button);
  text-decoration: none;
  background-color: var(--primary);
  border: none;
  border-radius: 16px;
  cursor: pointer;
  white-space: nowrap;
  transition: 0.3s cubic-bezier(0.65, 0.05, 0.36, 1);
}

.button:hover {
  background: var(--primary-hover);
}

.button:active {
  background: var(--thumb);
}

.button:focus {
  outline: none;
}

.button--primary {
  background: var(--primary);
  color: var(--text-button);
}

.button--primary:hover {
  background: var(--primary-hover);
}

.button--primary:focus {
  background: var(--primary-hover);
}

.button--primary:active {
  background: var(--primary-hover);
}

.button--primary:disabled {
  background: #fe7f51;
  cursor: not-allowed;
}

.button--wide {
  padding: 20px 40px;
}

.button--small {
  padding: 4px 20px;
  border-radius: 8px;
  font-size: 14px;
  line-height: 20px;
}

.button--big {
  width: 100%;
  border-radius: 16px;
  padding: 20px;
  text-align: center;
}

.button--loading {
  pointer-events: none;
  background: var(--primary-hover);
  color: transparent;
}

.button--loading .button__loader {
  opacity: 1;
}

.button__loader {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  opacity: 0;
  display: flex;
  gap: 8px;
}

.button--big .button__loader {
  left: 50%;
}

.button__loader span {
  width: 8px;
  height: 8px;
  background: var(--bg-main);
  border-radius: 50%;
  display: inline-block;
  animation: button-loader-dots 1.4s infinite ease-in-out both;
}

.button__loader span:nth-child(1) {
  animation-delay: -0.32s;
}

.button__loader span:nth-child(2) {
  animation-delay: -0.16s;
}

@keyframes button-loader-dots {
  0%, 80%, 100% { 
    transform: scale(0);
  } 40% { 
    transform: scale(1.0);
  }
}

/* Input */

.input {
  position: relative;
  width: 100%;
}

.input__container {
  display: block;
  background: var(--bg-main);
  border-radius: 16px;
  position: relative;
  transition: all 0.3s ease;
}

.input__container:hover .input__field {
  border: 1px solid var(--primary);
}

.input__field {
  width: 100%;
  color: var(--text-main);
  border: 1px solid var(--bg-main);
  outline: none;
  background: transparent;
  padding: 30px 56px 12px 16px;
  border-radius: 16px;
  transition: all 0.3s ease;
}

.input__field:-webkit-autofill {
  border: 1px solid var(--border);
}

.input__field:focus {
  border: 1px solid var(--primary);
}

.input__field.error {
  border-color: var(--error) !important;
  animation: shake 0.3s ease-in-out;
}

.input__placeholder {
  position: absolute;
  top: 21px;
  left: 16px;
  right: 56px;
  font-size: 16px;
  line-height: 24px;
  color: var(--text-second);
  pointer-events: none;
  transition: all 0.2s ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.input__field:focus + .input__placeholder,
.input__field:not(:placeholder-shown) + .input__placeholder {
  top: 12px;
  font-size: 12px;
  line-height: 18px;
  color: var(--text-second);
}

.input__field:not(:placeholder-shown) {
  border-color: var(--border);
}

.input--min .input__field {
  padding: 27px 12px 9px 16px;
}

@media (max-width: 479px) {
  .input--min .input__field {
    padding: 32px 12px 9px 16px;
  }
}

/* Textarea  */
.textarea {
  position: relative;
  width: 100%;
}

.textarea__container {
  display: block;
  background: var(--bg-main);
  border: 1px solid var(--bg-main);
  border-radius: 16px;
  position: relative;
  padding-top: 30px;
  transition: all 0.3s ease;
}

.textarea__container:hover,
.textarea__container:focus {
  border-color: var(--primary);
}

.textarea__container.error {
  border-color: var(--error) !important;
  animation: shake 0.3s ease-in-out;
}

.textarea__field {
  width: 100%;
  color: var(--text-main);
  outline: none;
  border: none;
  resize: none;
  background: transparent;
  padding: 0 16px 12px;
  display: block;
  min-height: 126px;
  pointer-events: auto;
}

.textarea__placeholder {
  display: block;
  pointer-events: none;
  position: absolute;
  top: 21px;
  left: 16px;
  right: 56px;
  font-size: 16px;
  line-height: 24px;
  color: var(--text-second);
  transition: 0.2s cubic-bezier(0.46, 0.03, 0.52, 0.96);
  will-change: transform;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.textarea__field:focus + .textarea__placeholder,
.textarea__field:not(:placeholder-shown) + .textarea__placeholder {
  top: 12px;
  font-size: 12px;
  line-height: 18px;
  color: var(--text-second);
}

@media (max-width: 479px) {
  .textarea__field {
    min-height: 120px;
  }
}

.select {
  position: relative;
  width: 100%;
}

.select__btn {
  cursor: pointer;
  transition: all 0.3s ease;
}

.select__list {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 10;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
}

.select__list--open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.select__option {
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.select__option:hover {
  background-color: var(--border);
}

.select__option--selected {
  color: var(--primary);
}

.select__option {
  animation: slideIn 0.3s ease forwards;
  opacity: 0;
  transform: translateY(-10px);
}

.select__option:nth-child(1) { animation-delay: 0.05s; }
.select__option:nth-child(2) { animation-delay: 0.1s; }
.select__option:nth-child(3) { animation-delay: 0.15s; }
.select__option:nth-child(4) { animation-delay: 0.2s; }

@keyframes slideIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* solution */

.select-solution {
  max-width: 700px;
  width: 64%;
  position: relative;
}

.select-solution .select__btn {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 19px 40px;
  background-color: var(--bg-hover);
  border-radius: 24px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

@media (max-width: 719px) {
  .select-solution {
    width: 100%;
  }

  .select-solution .select__btn {
    padding: 12px 24px;
  }
}

.select-solution .select__text {
  font-size: 48px;
  line-height: 1.2;
  font-weight: bold;
  flex: 1;
  min-width: 0;
}

@media (max-width: 719px) {
  .select-solution .select__text {
    font-size: 32px;
    line-height: 42px;
  }
}

.select-solution .select__placeholder {
  color: var(--text-second);
  margin: 0;
  width: 100%;
}

.select-solution .select__text > p {
  white-space: nowrap;        
  overflow: hidden;         
  text-overflow: ellipsis; 
}

.select-solution.select--has-value .select__placeholder {
  color: var(--text-main);
}

.select-solution .select__controls {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: 8px;
}

.select-solution .select__controls .arrow-select {
  width: 32px;
  height: 32px;
}

.select-solution .select__clear {
  display: none;
  align-items: center;
}

.select-solution.select--has-value .select__clear {
  display: flex;
}

.select-solution .select__clear-icon {
  width: 24px;
  height: 24px;
  margin: 2px;
  mask-repeat: no-repeat;
  mask-position: center;
  mask-size: contain;
  mask-image: url('/src/icon/close.svg');
  -webkit-mask-image: url('/src/icon/close.svg');
  background-color: var(--text-main);
  transition: all 0.3s ease;
}

.select-solution .select__clear--sep {
  width: 1px;
  height: 32px;
  background-color: var(--text-main);
  margin-left: 8px;
  margin-right: 8px;
}

.select-solution .arrow-select--open {
  transform: rotate(180deg);
}

.select-solution.select--active .arrow {
  transform: rotate(180deg);
}

.select-solution .select__list {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: var(--bg-hover);
  border-radius: 24px;
  padding: 8px;
  z-index: 100;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
}

.select-solution .select__list--open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.select-solution .select__option {
  padding: 19px 24px;
  font-size: 48px;
  font-weight: 600;
  line-height: 62px;
  border-radius: 16px;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.select-solution .select__option:hover {
  background-color: var(--border);
}

.select-solution .select__option--selected {
  color: var(--primary);
}

@media (max-width: 719px) {
  .select-solution .select__option {
    font-size: 32px;
    line-height: 42px;
    padding: 12px 20px;
  }
}

/* Select Form */
.select-form {
  position: relative;
  width: 100%;
  max-width: 100%;
}

.select-form .select__btn {
  background: var(--bg-main);
  border: 1px solid var(--bg-main);
  border-radius: 16px;
  min-height: 66px;
  padding: 0;
  cursor: pointer;
  outline: none;
  position: relative;
  outline: none;
}

.select-form .select__btn:hover {
  border-color: var(--primary);
}

.select-form .select__content {
  position: relative;
  width: 100%;
  height: 100%;
  padding: 30px 56px 12px 16px;
}

.select-form .select__placeholder {
  position: absolute;
  top: 12px;
  left: 16px;
  right: 56px;
  font-size: 12px;
  line-height: 18px;
  color: var(--text-second);
  transition: 0.2s cubic-bezier(0.46, 0.03, 0.52, 0.96);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
}

.select-form .select__value {
  font-size: 16px;
  line-height: 24px;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.select-form .select__value p {
  margin: 0;
}

.select-form .arrow {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  transition: transform 0.3s ease;
  pointer-events: none;
}

.select-form.select--active .arrow {
  transform: translateY(-50%) rotate(180deg);
}

.select-form .select__list {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--bg-main);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 8px;
  max-height: 244px;
  overflow-y: auto;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  z-index: 100;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: opacity 0.2s, visibility 0.2s, transform 0.2s;
}

.select-form.select--active .select__list {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.select-form .select__list::-webkit-scrollbar {
  width: 6px;
}

.select-form .select__list::-webkit-scrollbar-track {
  background: var(--bg-hover);
  border-radius: 3px;
}

.select-form .select__list::-webkit-scrollbar-thumb {
  background: var(--thumb);
  border-radius: 3px;
}

.select-form .select__option {
  padding: 12px 16px;
  font-size: 16px;
  line-height: 24px;
  border-radius: 12px;
  cursor: pointer;
  outline: none;
  transition: background-color 0.2s;
}

.select-form .select__option:hover {
  background-color: var(--bg-hover);
}

.select-form .select__option:focus {
  background-color: var(--bg-hover);
  outline: 1px solid var(--primary);
}

.select-form .select__option--selected {
  color: var(--primary);
  background-color: var(--bg-hover);
}

.select-form .select__btn:focus {
  border-color: var(--primary);
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}