@import url(https://fonts.googleapis.com/css?family=Montserrat:400,700);

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  cursor: default;
  outline: none;
}

*:focus {
  outline: none;
}

::-moz-selection {
  color: hsl(330, 100%, 60%);
}

::selection {
  color: hsl(330, 100%, 60%);
}

/* ========== POPUP ========== */
.popup-container {
  display: none;
  position: fixed;
  inset: 0;
  background: hsl(330, 25%, 10%);
  z-index: 9999;
  padding: 2rem;
  overflow-y: auto;

  align-items: center;
  justify-content: center;
}

.popup-content {
  position: relative;
  max-width: 95%;
  width: 100%;
  padding: 2rem;
  box-sizing: border-box;
}

/* ========== CLOSE BUTTON ========== */
.close-popup {
  position: absolute;
  top: 1rem;
  right: 1rem;
  font-size: 2rem;
  color: hsl(30, 100%, 75%);
  cursor: pointer;
  z-index: 1001;
}

.close-popup:hover {
  color: hsl(330, 100%, 60%);
}

/* ========== STEP NUMBER ========== */
#step {
  position: fixed;
  z-index: 0;
  bottom: 0;
  right: 1vw;
  font-size: 60vh;
  font-weight: 700;
  color: hsl(330, 25%, 15%);
  transition: 2s;
}

#step::before {
  content: 'Шаг';
  position: absolute;
  z-index: 1;
  top: 35%;
  right: 2vw;
  font-size: 20vh;
  font-weight: 700;
  color: hsl(330, 25%, 5%);
}

#step::after {
  content: 'из 4';
  position: absolute;
  z-index: 1;
  top: 65%;
  left: -2rem;
  font-size: 10vh;
  font-weight: 700;
  color: hsl(330, 25%, 20%);
}

/* ========== FORM ========== */
#hire_us {
  font-family: Montserrat, sans-serif;
  margin: 2rem;
  color: hsl(30, 100%, 75%);
  background: hsl(330, 25%, 10%);
}

input[type=text],
input[type=email],
[contenteditable] {
  font-family: Montserrat, sans-serif;
  font-size: 1.5rem;
  line-height: 2.5rem;
  color: hsl(30, 100%, 75%);
  background: transparent;
  border: 0 solid hsl(330, 10%, 25%);
  border-width: 0 0 .1rem 0;
  width: 3em;
  transition: 1s ease-out;
}

[contenteditable] {
  border-width: 0 .1rem;
  padding: 0 1em;
}

[contenteditable]:focus {
  color: hsl(30, 100%, 75%);
  border-color: hsl(330, 10%, 50%);
}

input[type=button] {
  position: relative;
  top: 0;
  font-family: Montserrat, sans-serif;
  font-size: 2rem;
  font-weight: 700;
  color: hsl(330, 10%, 25%);
  background: transparent;
  border: .2rem solid hsl(330, 10%, 25%);
  border-radius: .75rem;
  padding: 0.5rem 1rem;
  box-shadow: 0 0 0 hsl(330, 10%, 5%);
  transition: 1s ease-out;
  cursor: pointer;
}

input[type=button]:hover {
  top: -.5rem;
  color: hsl(30, 100%, 75%);
  border-color: hsl(30, 100%, 75%);
  box-shadow: 0 .5rem 0.5rem hsl(330, 10%, 5%);
}

/* ========== STEP CLASSES ========== */
.sleep {
  opacity: 0;
}

.rest {
  height: 0;
  opacity: 0;
}

.wake {
  opacity: 1;
}

.collapsed {
  height: 0;
}

/* ========== PIN (Текстовые блоки) ========== */
p {
  position: relative;
  z-index: 2;
  font-family: Montserrat, sans-serif;
  font-size: 1.5rem;
  line-height: 2rem;
  transition: 1s ease-out .5s;
  min-height: 5rem;
}

#pin_0 {
  opacity: 1;
  min-height: 5rem;
  padding: 1rem;
  font-size: 1.4rem;
  line-height: 1.5;
}

/* ========== Type area ========== */
#type {
  height: auto;
  margin: 2rem 0;
  width: 95%;
}

/* ========== Cursors ========== */
.click {
  cursor: pointer;
}

body.wait .click {
  cursor: default;
}

/* ========== Анимация Pulse ========== */
.pulse {
  animation: pulse 2s infinite linear;
}

.pulse:hover {
  animation: none;
}

@keyframes pulse {
  0% { opacity: .25; }
  50% { opacity: 1; }
  100% { opacity: .25; }
}
#pin_0 {
  position: relative;
  opacity: 1;
  min-height: 5rem;
  padding: 1rem;
  font-size: 1.4rem;
  line-height: 1.5;
}

.fields {
  position: relative;
  margin-top: 1rem;
  left: 0;
  width: 100%;
  padding-top: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  z-index: 5;
}

/* Стили для всех полей внутри .fields */
.fields input[type="text"],
.fields input[type="email"],
.fields input[type="button"],
.fields #type {
  width: 80%;
  max-width: 600px;
  padding: 0.75rem 1rem;
  font-size: 1.2rem;
  background: transparent;
  color: hsl(30, 100%, 75%);
  border: 1px solid hsl(330, 10%, 25%);
  border-radius: 0.5rem;
}

/* Контент-редактор */
.fields #type {
  min-height: 8rem;
  border-width: 1px;
}

/* Анимации появления */
.fields.sleep {
  display: none;
  opacity: 0;
}

.fields.wake {
  display: flex;
  opacity: 1;
}

#type:empty::before {
  content: attr(data-placeholder);
  color: hsl(30, 20%, 50%);
  pointer-events: none;
  display: block;
}
#type.collapsed {
  height: auto !important;
}
.step-button {
  display: none;
  margin-top: 1rem;
  padding: 0.75rem 1.5rem;
  font-size: 1.2rem;
  background-color: hsl(30, 100%, 75%);
  color: hsl(330, 25%, 10%);
  border: none;
  border-radius: 0.5rem;
  font-family: Montserrat, sans-serif;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.3s ease;
  
}

.step-button:hover {
  background-color: hsl(30, 100%, 85%);
}
.step-button {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.wake + .step-button {
  display: inline-block;
  opacity: 1;
  transform: translateY(0);
}

.fields .step-button {
  align-self: center;
}
.fields input.sleep,
.fields button.sleep,
.fields #type.sleep {
  display: none;
  opacity: 0;
}

.fields input.wake,
.fields button.wake,
.fields #type.wake {
  display: block !important;
  opacity: 1;
}

#type.wake {
  display: block !important;
  opacity: 1 !important;
}



/* ========== Адаптация под мобилки ========== */
@media screen and (max-width: 767px) {
  .popup-content {
    padding: 1rem;
    max-width: 95vw;
  }

  input[type=text],
  input[type=email],
  [contenteditable] {
    font-size: 1.2rem;
    width: 100% !important;
  }

  input[type=button] {
    font-size: 1.4rem;
    padding: 0.5rem 1rem;
    width: 100%;
  }

  #step {
    font-size: 30vh !important;
  }

  #step::before {
    font-size: 10vh !important;
  }

  #step::after {
    font-size: 6vh !important;
  }

  #pin_0 {
    font-size: 1.2rem;
    padding: 1rem 0.5rem;
  }
    input[type=button],
  #type {
    width: 100% !important;
    font-size: 1.1rem;
  }
  .step-button {
    font-size: 1rem;
    padding: 0.6rem 1rem;
    width: 100%;
    white-space: normal; /* позволяет тексту переноситься */
    word-break: break-word;
    text-align: center;
  }
}