/* Subscribe modal — Figma specs (Rectangle 187 + typography inspect) */

.sub-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(55, 55, 60, 0.92);
  opacity: 0;
  transition: opacity 0.25s ease;
}

.sub-modal-overlay.is-active {
  display: flex;
  opacity: 1;
}

.sub-modal {
  position: relative;
  width: 100%;
  max-width: 1237px;
  min-height: 412px;
  height: 412px;
  background: #ffffff;
  border: 0.5px solid #4b4b4b;
  border-radius: 20px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.28);
  /* Bottom 0 so illustration sits flush on modal edge */
  padding: 16px 40px 0 48px;
  overflow: hidden;
  box-sizing: border-box;
  font-family: var(--font-manrope), "Manrope", sans-serif;
  transform: translateY(20px);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.sub-modal-overlay.is-active .sub-modal {
  transform: translateY(0);
}

.sub-modal__close {
  position: absolute;
  top: 12px;
  right: 16px;
  z-index: 2;
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  color: #c0c4ce;
  font-size: 24px;
  font-weight: 300;
  line-height: 1;
  cursor: pointer;
}

.sub-modal__close:hover {
  color: #64748b;
}

.sub-modal__grid {
  display: grid;
  grid-template-columns: 397px 190px minmax(310px, 1fr);
  column-gap: 48px;
  align-items: stretch;
  height: 100%;
  min-height: 396px; /* 412 - top padding */
}

.sub-modal__fields {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 16px;
  min-width: 0;
  padding: 0 0 16px;
}

.sub-modal__field label {
  display: block;
  margin-bottom: 8px;
  font-family: var(--font-manrope), "Manrope", sans-serif;
  font-size: 16px;
  font-weight: 400;
  line-height: 150%;
  letter-spacing: 0;
  color: #4b4b4b;
}

.sub-modal__field input {
  display: block;
  width: 397px;
  max-width: 100%;
  height: 46px;
  padding: 0 14px;
  border: 0.5px solid #aaaaaa;
  border-radius: 4px;
  background: #f2f2f2;
  color: #1e293b;
  font-family: var(--font-manrope), "Manrope", sans-serif;
  font-size: 15px;
  line-height: 1.4;
  outline: none;
  box-sizing: border-box;
}

.sub-modal__field input::placeholder {
  color: #9ca3af;
}

.sub-modal__field input:focus {
  background: #f2f2f2;
  border-color: #aaaaaa;
  box-shadow: none;
}

.sub-modal__field.has-error input {
  border-color: #dc2626;
  background: #fff5f5;
}

.sub-modal__field-error {
  margin: 6px 0 0;
  font-family: var(--font-manrope), "Manrope", sans-serif;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.3;
  color: #dc2626;
}

.sub-modal__visual {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  line-height: 0;
  min-width: 0;
  align-self: stretch;
}

.sub-modal__visual img {
  display: block;
  width: 190px;
  height: 336px;
  max-width: 190px;
  max-height: 336px;
  object-fit: contain;
  object-position: center bottom;
}

.sub-modal__aside {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: flex-start;
  min-width: 0;
  padding: 24px 0 32px;
}

/* Figma: 310 × 110, Manrope ExtraBold 800 / 46px / 120% / 0% */
.sub-modal__heading {
  width: 310px;
  max-width: 100%;
  margin: 0 0 20px;
  padding: 0;
  font-family: var(--font-manrope), "Manrope", sans-serif;
  font-size: 46px;
  font-weight: 800;
  line-height: 120%;
  letter-spacing: 0;
  text-align: right;
  color: #1a1a7a;
  box-sizing: border-box;
}

.sub-modal__heading span {
  display: block;
  color: #6b7aef;
}

.sub-modal__portfolio {
  width: 310px;
  max-width: 100%;
  margin: -8px 0 12px;
  font-size: 13px;
  color: #94a3b8;
  text-align: right;
}

.sub-modal__portfolio strong {
  color: #1a1a7a;
  font-weight: 700;
}

.sub-modal__plans {
  display: flex;
  width: 310px;
  max-width: 100%;
  padding: 3px;
  border: 0.5px solid #d8dbe3;
  border-radius: 8px;
  background: #eceef3;
  gap: 0;
  box-sizing: border-box;
}

.sub-modal__plans--four {
  width: 100%;
  max-width: 380px;
}

.sub-modal__plans--four .sub-modal__plan {
  padding: 9px 4px;
  font-size: 11px;
  letter-spacing: -0.01em;
}

.sub-modal__plan {
  flex: 1;
  border: 0.5px solid transparent;
  border-radius: 6px;
  background: transparent;
  padding: 10px 6px;
  font-family: var(--font-manrope), "Manrope", sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: #8b93a3;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.sub-modal__plan.is-active {
  background: #ffffff;
  color: #3d4fc4;
  border-color: #7b88e8;
  box-shadow: none;
}

.sub-modal__plan.is-disabled,
.sub-modal__plan:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  color: #9aa3b2;
}

.sub-modal__plans.is-locked .sub-modal__plan:not(.is-active) {
  pointer-events: none;
}

.sub-modal__success-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  padding: 28px 16px 40px;
}

.sub-modal__cta--success {
  margin-top: 0;
  align-self: center;
}

.sub-modal__hint {
  width: 310px;
  max-width: 100%;
  margin: 10px 0 0;
  font-family: var(--font-manrope), "Manrope", sans-serif;
  font-size: 14px;
  font-weight: 400;
  line-height: 250%;
  letter-spacing: 0;
  color: #a0a7b5;
  text-align: right;
}

.sub-modal__error {
  width: 310px;
  max-width: 100%;
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #fef2f2;
  color: #991b1b;
  font-size: 13px;
  text-align: left;
}

.sub-modal__success {
  width: 100%;
  margin: 0;
  padding: 28px 16px;
  border-radius: 12px;
  background: #ecfdf5;
  color: #065f46;
  font-size: 15px;
  font-weight: 600;
  text-align: center;
}

.sub-modal__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: auto;
  padding: 12px 24px;
  border: none;
  border-radius: 6px;
  background: #15157d;
  color: #ffffff;
  font-family: var(--font-manrope), "Manrope", sans-serif;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
}

.sub-modal__cta:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.sub-modal__cta:hover:not(:disabled) {
  background: #10106a;
  color: #ffffff;
}

@media (max-width: 1280px) {
  .sub-modal {
    max-width: 1100px;
    height: auto;
    min-height: 412px;
    padding: 16px 32px 0 36px;
  }

  .sub-modal__grid {
    grid-template-columns: minmax(280px, 397px) 170px minmax(280px, 1fr);
    column-gap: 32px;
    min-height: 380px;
  }

  .sub-modal__visual img {
    width: 170px;
    height: 300px;
    max-width: 170px;
    max-height: 300px;
  }

  .sub-modal__heading {
    font-size: 40px;
    width: 280px;
  }

  .sub-modal__plans,
  .sub-modal__hint,
  .sub-modal__portfolio,
  .sub-modal__error {
    width: 280px;
  }
}

@media (max-width: 900px) {
  .sub-modal {
    height: auto;
    min-height: 0;
    padding: 28px 22px 24px;
    max-width: 520px;
  }

  .sub-modal__grid {
    grid-template-columns: 1fr;
    gap: 24px;
    min-height: 0;
    height: auto;
  }

  .sub-modal__fields,
  .sub-modal__aside {
    padding-bottom: 0;
  }

  .sub-modal__aside {
    align-items: stretch;
    padding: 8px 0 0;
  }

  .sub-modal__field input,
  .sub-modal__heading,
  .sub-modal__plans,
  .sub-modal__hint,
  .sub-modal__portfolio,
  .sub-modal__error {
    width: 100%;
  }

  .sub-modal__heading {
    font-size: 32px;
    text-align: left;
  }

  .sub-modal__hint {
    text-align: left;
  }

  .sub-modal__visual {
    order: -1;
    align-items: center;
  }

  .sub-modal__visual img {
    width: 140px;
    height: 248px;
    max-width: 140px;
    max-height: 248px;
  }

  .sub-modal__cta {
    align-self: stretch;
    width: 100%;
    margin-top: 20px;
  }
}
